[RFC PATCH v6 24/29] hw/loongarch: Add default bios startup support.

2022-02-25 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 4 ++ hw/loongarch/fw_cfg.c| 33 ++ hw/loongarch/fw_cfg.h| 15 +++ hw/loongarch/loongson3.c | 76 +++- hw/loongarch

[RFC PATCH v6 02/29] target/loongarch: Add CSRs definition

2022-02-25 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 236 + target/loongarch/cpu.c | 35 ++ target/loongarch/cpu.h | 57 + 3 files changed, 328 insertions(+) create mode 100644 target/loongarch/cpu-csr.h

[RFC PATCH v6 01/29] target/loongarch: Add system emulation introduction

2022-02-25 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 8 +++ docs/system/loongarch/loongson3.rst | 37 + target/loongarch/README | 28 ++ 3 files changed, 73 insertions(+) create mode

[RFC PATCH v6 09/29] target/loongarch: Add TLB instruction support

2022-02-25 Thread Xiaojuan Yang
This includes: - TLBSRCH - TLBRD - TLBWR - TLBFILL - TLBCLR - TLBFLUSH - INVTLB Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/disas.c | 17 + target/loongarch/helper.h | 12 + .../insn_trans/trans_privileged.c.inc

[RFC PATCH v6 12/29] target/loongarch: Add timer related instructions support.

2022-02-25 Thread Xiaojuan Yang
This includes: -RDTIME{L/H}.W -RDTIME.D Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/helper.h | 1 + target/loongarch/insn_trans/trans_extra.c.inc | 32 +++ target/loongarch/op_helper.c | 6 target

[RFC PATCH v6 03/29] target/loongarch: Add basic vmstate description of CPU.

2022-02-25 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/cpu.c | 3 ++ target/loongarch/internals.h | 4 ++ target/loongarch/machine.c | 85 target/loongarch/meson.build | 6 +++ 4 files changed, 98

[RFC PATCH v6 23/29] hw/loongarch: Add LoongArch ls7a rtc device support

2022-02-25 Thread Xiaojuan Yang
This patch add ls7a rtc device support. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS| 1 + hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 4 + hw/rtc/Kconfig | 3 + hw/rtc/ls7a_rtc.c | 323

[RFC PATCH v6 16/29] hw/loongarch: Add LoongArch ipi interrupt support(IPI)

2022-02-25 Thread Xiaojuan Yang
This patch realize the IPI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 2 + hw/intc/Kconfig | 3 + hw/intc/loongarch_ipi.c | 164 hw/intc/meson.build

[RFC PATCH v6 21/29] Enable common virtio pci support for LoongArch

2022-02-25 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- softmmu/qdev-monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 01f3834db5..49491d74a1 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c

[RFC PATCH v6 06/29] target/loongarch: Add MMU support for LoongArch CPU.

2022-02-25 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-param.h | 2 +- target/loongarch/cpu.c| 30 target/loongarch/cpu.h| 42 - target/loongarch/internals.h | 9 + target/loongarch/machine.c| 17 ++ target/loongarch/meson.build

[RFC PATCH v6 08/29] target/loongarch: Add LoongArch IOCSR instruction

2022-02-25 Thread Xiaojuan Yang
This includes: - IOCSR{RD/WR}.{B/H/W/D} Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h| 4 + target/loongarch/disas.c | 8 + target/loongarch/helper.h | 2 + .../insn_trans

[RFC PATCH v6 04/29] target/loongarch: Implement qmp_query_cpu_definitions()

2022-02-25 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- qapi/machine-target.json | 6 -- target/loongarch/cpu.c | 26 ++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/qapi/machine-target.json b/qapi/machine

[RFC PATCH v6 25/29] hw/loongarch: Add -kernel and -initrd options support

2022-02-25 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 81 include/hw/loongarch/loongarch.h | 5 ++ 2 files changed, 86 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw/loongarch/loongson3.c index 2795fcc895

[RFC PATCH v6 20/29] hw/loongarch: Add irq hierarchy for the system

2022-02-25 Thread Xiaojuan Yang
This patch add the irq hierarchy for the virt board. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS| 1 + hw/loongarch/loongson3.c | 99 ++ include/hw/pci-host/ls7a.h | 30 3 files changed, 130 insertions

[RFC PATCH v6 07/29] target/loongarch: Add LoongArch CSR instruction

2022-02-25 Thread Xiaojuan Yang
This includes: - CSRRD - CSRWR - CSRXCHG Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h| 88 target/loongarch/csr_helper.c | 112 target/loongarch/disas.c | 15

[RFC PATCH v6 14/29] hw/loongarch: Add support loongson3 virt machine type.

2022-02-25 Thread Xiaojuan Yang
are emulated. More detailed info you can see https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 3 + .../devices/loongarch64-softmmu/default.mak | 3 + configs/targets/loongarch64

[RFC PATCH v7 22/29] hw/loongarch: Add some devices support for 3A5000.

2022-03-28 Thread Xiaojuan Yang
1.Add uart,virtio-net,vga and usb for 3A5000. 2.Add irq set and map for the pci host. Non pci device use irq 0-16, pci device use 16-64. 3.Add some unimplented device to emulate guest unused memory space. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 7

[RFC PATCH v7 23/29] hw/loongarch: Add LoongArch ls7a rtc device support

2022-03-28 Thread Xiaojuan Yang
This patch add ls7a rtc device support. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS| 1 + hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 4 + hw/rtc/Kconfig | 3 + hw/rtc/ls7a_rtc.c | 323

[RFC PATCH v7 01/29] target/loongarch: Add system emulation introduction

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 8 +++ docs/system/loongarch/loongson3.rst | 37 + target/loongarch/README | 28 ++ 3 files changed, 73 insertions(+) create mode

[RFC PATCH v7 10/29] target/loongarch: Add other core instructions support

2022-03-28 Thread Xiaojuan Yang
This includes: -CACOP -LDDIR -LDPTE -ERTN -DBCL -IDLE Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h| 2 + target/loongarch/disas.c | 17 target/loongarch/helper.h | 4 + .../insn_trans

[RFC PATCH v7 14/29] hw/loongarch: Add support loongson3 virt machine type.

2022-03-28 Thread Xiaojuan Yang
are emulated. More detailed info you can see https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 3 + .../devices/loongarch64-softmmu/default.mak | 3 + configs/targets/loongarch64

[RFC PATCH v7 13/29] target/loongarch: Add gdb support.

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 2 + configs/targets/loongarch64-softmmu.mak | 1 + gdb-xml/loongarch-base64.xml| 44 +++ gdb-xml/loongarch-fpu64.xml | 57 ++ target/loongarch/cpu.c

[RFC PATCH v7 15/29] hw/loongarch: Add LoongArch cpu interrupt support(CPUINTC)

2022-03-28 Thread Xiaojuan Yang
son.git/tree/Documentation/loongarch?h=loongarch-next 2.https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 25 + 1 file changed, 25 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw/loongar

[RFC PATCH v7 27/29] hw/loongarch: Add LoongArch acpi support

2022-03-28 Thread Xiaojuan Yang
Add a simple acpi model for LoongArch cpu More complex functions will be added later Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 2 + hw/acpi/Kconfig | 4 + hw/acpi/ls7a.c | 374 ++ hw/acpi

[RFC PATCH v7 06/29] target/loongarch: Add MMU support for LoongArch CPU.

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-param.h | 2 +- target/loongarch/cpu.c| 30 target/loongarch/cpu.h| 42 - target/loongarch/internals.h | 9 + target/loongarch/machine.c| 17 ++ target/loongarch/meson.build

[RFC PATCH v7 24/29] hw/loongarch: Add default bios startup support.

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 4 ++ hw/loongarch/fw_cfg.c| 33 ++ hw/loongarch/fw_cfg.h| 15 +++ hw/loongarch/loongson3.c | 76 +++- hw/loongarch

[RFC PATCH v7 09/29] target/loongarch: Add TLB instruction support

2022-03-28 Thread Xiaojuan Yang
This includes: - TLBSRCH - TLBRD - TLBWR - TLBFILL - TLBCLR - TLBFLUSH - INVTLB Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/disas.c | 17 + target/loongarch/helper.h | 12 + .../insn_trans/trans_privileged.c.inc

[RFC PATCH v7 20/29] hw/loongarch: Add irq hierarchy for the system

2022-03-28 Thread Xiaojuan Yang
This patch add the irq hierarchy for the virt board. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS| 1 + hw/loongarch/loongson3.c | 99 ++ include/hw/pci-host/ls7a.h | 30 3 files changed, 130 insertions

[RFC PATCH v7 26/29] hw/loongarch: Add LoongArch smbios support

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 43 include/hw/loongarch/loongarch.h | 1 + 3 files changed, 45 insertions(+) diff --git a/hw/loongarch/Kconfig b/hw/loongarch

[RFC PATCH v7 16/29] hw/loongarch: Add LoongArch ipi interrupt support(IPI)

2022-03-28 Thread Xiaojuan Yang
This patch realize the IPI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 2 + hw/intc/Kconfig | 3 + hw/intc/loongarch_ipi.c | 164 hw/intc/meson.build

[RFC PATCH v7 29/29] tests/tcg/loongarch64: Add hello/memory test in loongarch64 system

2022-03-28 Thread Xiaojuan Yang
- We write a very minimal softmmu harness. - This is a very simple smoke test with no need to run a full Linux/kernel. - The Makefile.softmmu-target record the rule to run. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 1 + tests/tcg

[RFC PATCH v7 08/29] target/loongarch: Add LoongArch IOCSR instruction

2022-03-28 Thread Xiaojuan Yang
This includes: - IOCSR{RD/WR}.{B/H/W/D} Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h| 4 + target/loongarch/disas.c | 8 + target/loongarch/helper.h | 2 + .../insn_trans

[RFC PATCH v7 11/29] target/loongarch: Add LoongArch interrupt and exception handle

2022-03-28 Thread Xiaojuan Yang
1.This patch Add loongarch interrupt and exception handle. 2.Rename the user excp to the exccode from the csr defintions. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- linux-user/loongarch64/cpu_loop.c | 8 +- target/loongarch/cpu.c| 260

[RFC PATCH v7 28/29] hw/loongarch: Add fdt support.

2022-03-28 Thread Xiaojuan Yang
Add tree nodes for 3A5000 device tree. - cpu nodes; - fw_cfg nodes; - pcie nodes. The lastest loongarch bios have supported fdt. - https://github.com/loongson/edk2 - https://github.com/loongson/edk2-platforms Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c

[RFC PATCH v7 07/29] target/loongarch: Add LoongArch CSR instruction

2022-03-28 Thread Xiaojuan Yang
This includes: - CSRRD - CSRWR - CSRXCHG Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h| 88 target/loongarch/csr_helper.c | 112 target/loongarch/disas.c | 15

[RFC PATCH v7 05/29] target/loongarch: Add constant timer support

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/constant_timer.c | 62 +++ target/loongarch/cpu.h| 10 + target/loongarch/meson.build | 1 + 3 files changed, 73 insertions(+) create mode 100644 target/loongarch

[RFC PATCH v7 18/29] hw/intc: Add LoongArch ls7a msi interrupt controller support(PCH-MSI)

2022-03-28 Thread Xiaojuan Yang
This patch realize PCH-MSI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig | 5 ++ hw/intc/loongarch_pch_msi.c | 75 + hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v7 25/29] hw/loongarch: Add -kernel and -initrd options support

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 81 include/hw/loongarch/loongarch.h | 5 ++ 2 files changed, 86 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw/loongarch/loongson3.c index 2795fcc895

[RFC PATCH v7 19/29] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-03-28 Thread Xiaojuan Yang
This patch realize the EIOINTC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig| 3 + hw/intc/loongarch_extioi.c | 408 + hw/intc/meson.build| 1 + hw/intc/trace-events

[RFC PATCH v7 00/29] Add LoongArch softmmu support

2022-03-28 Thread Xiaojuan Yang
me emulate errors when use the kernel from the github. 5.Adjust some format problem and the Naming problem 6.Others mainly follow Richard's code review comments. Please help review! Thanks Xiaojuan Yang (29): target/loongarch: Add system emulation introduction target/loongarch: Add CSRs definitio

[RFC PATCH v7 02/29] target/loongarch: Add CSRs definition

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 236 + target/loongarch/cpu.c | 35 ++ target/loongarch/cpu.h | 57 + 3 files changed, 328 insertions(+) create mode 100644 target/loongarch/cpu-csr.h

[RFC PATCH v7 04/29] target/loongarch: Implement qmp_query_cpu_definitions()

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- qapi/machine-target.json | 6 -- target/loongarch/cpu.c | 26 ++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/qapi/machine-target.json b/qapi/machine

[RFC PATCH v7 03/29] target/loongarch: Add basic vmstate description of CPU.

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/cpu.c | 3 ++ target/loongarch/internals.h | 4 ++ target/loongarch/machine.c | 85 target/loongarch/meson.build | 6 +++ 4 files changed, 98

[RFC PATCH v7 17/29] hw/intc: Add LoongArch ls7a interrupt controller support(PCH-PIC)

2022-03-28 Thread Xiaojuan Yang
This patch realize the PCH-PIC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig | 4 + hw/intc/loongarch_pch_pic.c | 488 hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v7 12/29] target/loongarch: Add timer related instructions support.

2022-03-28 Thread Xiaojuan Yang
This includes: -RDTIME{L/H}.W -RDTIME.D Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/helper.h | 1 + target/loongarch/insn_trans/trans_extra.c.inc | 32 +++ target/loongarch/op_helper.c | 6 target

[RFC PATCH v7 21/29] Enable common virtio pci support for LoongArch

2022-03-28 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- softmmu/qdev-monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 12fe60c467..bb5897fc76 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c

[RFC PATCH v5 00/30] Add LoongArch softmmu support

2022-01-27 Thread Xiaojuan Yang
ome format problem and the Naming problem 6.Others mainly follow Richard's code review comments. Please help review! Thanks Xiaojuan Yang (30): target/loongarch: Add system emulation introduction target/loongarch: Add CSRs definition target/loongarch: Add basic vmstate description of CPU

[RFC PATCH v5 09/30] target/loongarch: Add TLB instruction support

2022-01-27 Thread Xiaojuan Yang
This includes: - TLBSRCH - TLBRD - TLBWR - TLBFILL - TLBCLR - TLBFLUSH - INVTLB Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/disas.c | 17 + target/loongarch/helper.h | 12 + .../insn_trans/trans_privileged.c.inc

[RFC PATCH v5 25/30] hw/loongarch: Add default bios startup support.

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 4 hw/loongarch/fw_cfg.c| 33 ++ hw/loongarch/fw_cfg.h| 15 ++ hw/loongarch/loongson3.c | 35

[RFC PATCH v5 26/30] hw/loongarch: Add -kernel and -initrd options support

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 81 include/hw/loongarch/loongarch.h | 5 ++ 2 files changed, 86 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw/loongarch/loongson3.c index ef46a5cfc4

[RFC PATCH v5 21/30] hw/loongarch: Add irq hierarchy for the system

2022-01-27 Thread Xiaojuan Yang
This patch add the irq hierarchy for the virt board. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 88 ++ include/hw/pci-host/ls7a.h | 13 ++ 2 files changed, 101 insertions(+) diff --git a/hw/loongarch/loongson3

[RFC PATCH v5 15/30] hw/loongarch: Add support loongson3-ls7a machine type.

2022-01-27 Thread Xiaojuan Yang
are emulated. More detailed info you can see https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- .../devices/loongarch64-softmmu/default.mak | 3 + configs/targets/loongarch64-softmmu.mak | 3 + hw/Kconfig

[RFC PATCH v5 20/30] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-01-27 Thread Xiaojuan Yang
This patch realize the EIOINTC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig| 3 + hw/intc/loongarch_extioi.c | 409 + hw/intc/meson.build| 1 + hw/intc/trace-events

[RFC PATCH v5 29/30] hw/loongarch: Add fdt support.

2022-01-27 Thread Xiaojuan Yang
Add tree nodes for 3A5000 device tree. - cpu nodes; - fw_cfg nodes; - pcie nodes. The lastest loongarch bios have supported fdt. - https://github.com/loongson/edk2 - https://github.com/loongson/edk2-platforms Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c

[RFC PATCH v5 00/30] Add LoongArch softmmu support

2022-01-27 Thread Xiaojuan Yang
ome format problem and the Naming problem 6.Others mainly follow Richard's code review comments. Please help review! Thanks Xiaojuan Yang (30): target/loongarch: Add system emulation introduction target/loongarch: Add CSRs definition target/loongarch: Add basic vmstate description of CPU

[RFC PATCH v5 08/30] target/loongarch: Add LoongArch IOCSR instruction

2022-01-27 Thread Xiaojuan Yang
This includes: - IOCSR{RD/WR}.{B/H/W/D} Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c| 8 + target/loongarch/cpu.h| 4 + target/loongarch/disas.c | 8 + target/loongarch/helper.h

[RFC PATCH v5 16/30] hw/loongarch: Add LoongArch cpu interrupt support(CPUINTC)

2022-01-27 Thread Xiaojuan Yang
son.git/tree/Documentation/loongarch?h=loongarch-next 2.https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/hw/loongarch/loongson3.c b/

[RFC PATCH v5 24/30] hw/loongarch: Add LoongArch ls7a rtc device support

2022-01-27 Thread Xiaojuan Yang
This patch add ls7a rtc device support. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 4 + hw/rtc/Kconfig | 3 + hw/rtc/ls7a_rtc.c | 322 + hw/rtc

[RFC PATCH v5 17/30] hw/loongarch: Add LoongArch ipi interrupt support(IPI)

2022-01-27 Thread Xiaojuan Yang
This patch realize the IPI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig | 3 + hw/intc/loongarch_ipi.c | 164 hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v5 04/30] target/loongarch: Implement qmp_query_cpu_definitions()

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- qapi/machine-target.json | 6 -- target/loongarch/cpu.c | 26 ++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/qapi/machine-target.json b/qapi/machine

[RFC PATCH v5 14/30] hw/pci-host: Add ls7a1000 PCIe Host bridge support for Loongson3 Platform

2022-01-27 Thread Xiaojuan Yang
interrupt sources. For more detailed info about ls7a1000 you can see the doc at https://github.com/loongson/LoongArch-Documentation/releases/latest/ download/Loongson-7A1000-usermanual-2.00-EN.pdf Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/pci-host/Kconfig| 4 + hw/pci-host

[RFC PATCH v5 18/30] hw/intc: Add LoongArch ls7a interrupt controller support(PCH-PIC)

2022-01-27 Thread Xiaojuan Yang
This patch realize the PCH-PIC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig | 4 + hw/intc/loongarch_pch_pic.c | 488 hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v5 02/30] target/loongarch: Add CSRs definition

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 236 + target/loongarch/cpu.c | 35 ++ target/loongarch/cpu.h | 57 + 3 files changed, 328 insertions(+) create mode 100644 target/loongarch/cpu-csr.h

[RFC PATCH v5 01/30] target/loongarch: Add system emulation introduction

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- docs/system/loongarch/loongson3.rst | 78 + target/loongarch/README | 28 +++ 2 files changed, 106 insertions(+) create mode 100644 docs/system/loongarch/loongson3.rst diff --git a/docs

[RFC PATCH v5 03/30] target/loongarch: Add basic vmstate description of CPU.

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/cpu.c | 3 ++ target/loongarch/internals.h | 4 ++ target/loongarch/machine.c | 85 target/loongarch/meson.build | 6 +++ 4 files changed, 98

[RFC PATCH v5 05/30] target/loongarch: Add constant timer support

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/constant_timer.c | 62 +++ target/loongarch/cpu.h| 10 + target/loongarch/meson.build | 1 + 3 files changed, 73 insertions(+) create mode 100644 target/loongarch

[RFC PATCH v5 11/30] target/loongarch: Add LoongArch interrupt and exception handle

2022-01-27 Thread Xiaojuan Yang
1.This patch Add loongarch interrupt and exception handle. 2.Rename the user excp to the exccode from the csr defintions. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- linux-user/loongarch64/cpu_loop.c | 8 +- target/loongarch/cpu.c| 251

[RFC PATCH v5 12/30] target/loongarch: Add timer related instructions support.

2022-01-27 Thread Xiaojuan Yang
This includes: -RDTIME{L/H}.W -RDTIME.D Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/helper.h | 1 + target/loongarch/insn_trans/trans_extra.c.inc | 32 +++ target/loongarch/op_helper.c | 6 target

[RFC PATCH v5 22/30] Enable common virtio pci support for LoongArch

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- softmmu/qdev-monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 01f3834db5..49491d74a1 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c

[RFC PATCH v5 28/30] hw/loongarch: Add LoongArch acpi support

2022-01-27 Thread Xiaojuan Yang
Add a simple acpi model for LoongArch cpu More complex functions will be added later Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/acpi/Kconfig | 4 + hw/acpi/ls7a.c | 374 ++ hw/acpi/meson.build | 1 + hw

[RFC PATCH v5 30/30] tests/tcg/loongarch64: Add hello/memory test in loongarch64 system

2022-01-27 Thread Xiaojuan Yang
- We write a very minimal softmmu harness. - This is a very simple smoke test with no need to run a full Linux/kernel. - The Makefile.softmmu-target record the rule to run. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- tests/tcg/loongarch64/Makefile.softmmu-target | 33

[RFC PATCH v5 23/30] hw/loongarch: Add some devices support for 3A5000.

2022-01-27 Thread Xiaojuan Yang
1.Add uart,virtio-net,vga and usb for 3A5000. 2.Add irq set and map for the pci host. Non pci device use irq 0-16, pci device use 16-64. 3.Add some unimplented device to emulate guest unused memory space. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 7

[RFC PATCH v5 10/30] target/loongarch: Add other core instructions support

2022-01-27 Thread Xiaojuan Yang
This includes: -CACOP -LDDIR -LDPTE -ERTN -DBCL -IDLE Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h| 2 + target/loongarch/disas.c | 17 target/loongarch/helper.h | 4 + .../insn_trans

[RFC PATCH v5 07/30] target/loongarch: Add LoongArch CSR instruction

2022-01-27 Thread Xiaojuan Yang
This includes: - CSRRD - CSRWR - CSRXCHG Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h| 88 target/loongarch/csr_helper.c | 112 target/loongarch/disas.c | 15

[RFC PATCH v5 06/30] target/loongarch: Add MMU support for LoongArch CPU.

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-param.h | 2 +- target/loongarch/cpu.c| 30 target/loongarch/cpu.h| 42 - target/loongarch/internals.h | 9 + target/loongarch/machine.c| 17 ++ target/loongarch/meson.build

[RFC PATCH v5 13/30] target/loongarch: Add gdb support.

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- configs/targets/loongarch64-softmmu.mak | 1 + gdb-xml/loongarch-base64.xml| 43 +++ gdb-xml/loongarch-fpu64.xml | 57 +++ target/loongarch/cpu.c | 7 ++ target/loongarch

[RFC PATCH v5 27/30] hw/loongarch: Add LoongArch smbios support

2022-01-27 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 42 include/hw/loongarch/loongarch.h | 1 + 3 files changed, 44 insertions(+) diff --git a/hw/loongarch/Kconfig b/hw/loongarch

[RFC PATCH v5 19/30] hw/intc: Add LoongArch ls7a msi interrupt controller support(PCH-MSI)

2022-01-27 Thread Xiaojuan Yang
This patch realize PCH-MSI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig | 5 ++ hw/intc/loongarch_pch_msi.c | 75 + hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v4 30/30] tests/tcg/loongarch64: Add hello/memory test in loongarch64 system

2022-01-08 Thread Xiaojuan Yang
- We write a very minimal softmmu harness. - This is a very simple smoke test with no need to run a full Linux/kernel. - The Makefile.softmmu-target record the rule to run. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- tests/tcg/loongarch64/Makefile.softmmu-target | 33

[RFC PATCH v4 13/30] target/loongarch: Add gdb support.

2022-01-08 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- configs/targets/loongarch64-softmmu.mak | 1 + gdb-xml/loongarch-base64.xml| 43 +++ gdb-xml/loongarch-fpu64.xml | 57 +++ target/loongarch/cpu.c | 7 ++ target/loongarch

[RFC PATCH v4 06/30] target/loongarch: Add MMU support for LoongArch CPU.

2022-01-08 Thread Xiaojuan Yang
This patch introduces basic TLB interfaces. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-param.h | 2 +- target/loongarch/cpu.c| 32 target/loongarch/cpu.h| 45 - target/loongarch/internals.h | 10 ++ target/loongarch/machine.c

[RFC PATCH v4 10/30] target/loongarch: Add other core instructions support

2022-01-08 Thread Xiaojuan Yang
This includes: -CACOP -LDDIR -LDPTE -ERTN -DBCL -IDLE Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h | 2 + target/loongarch/disas.c | 17 target/loongarch/helper.h| 4 + target/loongarch

[RFC PATCH v4 25/30] hw/loongarch: Add default bios startup support.

2022-01-08 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 4 hw/loongarch/fw_cfg.c| 33 ++ hw/loongarch/fw_cfg.h| 15 ++ hw/loongarch/loongson3.c | 35

[RFC PATCH v4 29/30] hw/loongarch: Add fdt support.

2022-01-08 Thread Xiaojuan Yang
Add tree nodes for 3A5000 device tree. - cpu nodes; - fw_cfg nodes; - pcie nodes. The lastest loongarch bios have supported fdt. - https://github.com/loongson/edk2 - https://github.com/loongson/edk2-platforms Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c

[RFC PATCH v4 18/30] hw/intc: Add LoongArch ls7a interrupt controller support(PCH-PIC)

2022-01-08 Thread Xiaojuan Yang
This patch realize the PCH-PIC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig | 4 + hw/intc/loongarch_pch_pic.c | 428 hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v4 00/30] Add LoongArch softmmu support.

2022-01-08 Thread Xiaojuan Yang
. Please help review! Thanks Xiaojuan Yang (30): target/loongarch: Update README target/loongarch: Add CSR registers definition target/loongarch: Add basic vmstate description of CPU. target/loongarch: Implement qmp_query_cpu_definitions() target/loongarch: Add constant timer support

[RFC PATCH v4 09/30] target/loongarch: Add TLB instruction support

2022-01-08 Thread Xiaojuan Yang
This includes: - TLBSRCH - TLBRD - TLBWR - TLBFILL - TLBCLR - TLBFLUSH - INVTLB Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/disas.c | 17 + target/loongarch/helper.h| 12 + target/loongarch/insn_trans/trans_core.c.inc

[RFC PATCH v4 07/30] target/loongarch: Add LoongArch CSR instruction

2022-01-08 Thread Xiaojuan Yang
This includes: - CSRRD - CSRWR - CSRXCHG Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.h | 88 + target/loongarch/csr_helper.c| 112 + target/loongarch/disas.c | 15

[RFC PATCH v4 17/30] hw/loongarch: Add LoongArch ipi interrupt support(IPI)

2022-01-08 Thread Xiaojuan Yang
This patch realize the IPI interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig | 3 + hw/intc/loongarch_ipi.c | 164 hw/intc/meson.build | 1 + hw/intc/trace-events

[RFC PATCH v4 24/30] hw/loongarch: Add LoongArch ls7a rtc device support

2022-01-08 Thread Xiaojuan Yang
This patch add ls7a rtc device support. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/Kconfig | 1 + hw/loongarch/loongson3.c | 4 + hw/rtc/Kconfig | 3 + hw/rtc/ls7a_rtc.c | 322 + hw/rtc

[RFC PATCH v4 26/30] hw/loongarch: Add -kernel and -initrd options support

2022-01-08 Thread Xiaojuan Yang
Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 81 include/hw/loongarch/loongarch.h | 5 ++ 2 files changed, 86 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw/loongarch/loongson3.c index 31c285a74d

[RFC PATCH v4 21/30] hw/loongarch: Add irq hierarchy for the system

2022-01-08 Thread Xiaojuan Yang
This patch add the irq hierarchy for the virt board. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 85 ++ include/hw/pci-host/ls7a.h | 13 ++ 2 files changed, 98 insertions(+) diff --git a/hw/loongarch/loongson3.c

[RFC PATCH v4 08/30] target/loongarch: Add LoongArch IOCSR instruction

2022-01-08 Thread Xiaojuan Yang
This includes: - IOCSR{RD/WR}.{B/H/W/D} Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c | 8 ++ target/loongarch/cpu.h | 4 + target/loongarch/disas.c | 8 ++ target/loongarch/helper.h

[RFC PATCH v4 04/30] target/loongarch: Implement qmp_query_cpu_definitions()

2022-01-08 Thread Xiaojuan Yang
This patch introduce qmp_query_cpu_definitions interface. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- qapi/machine-target.json | 6 -- target/loongarch/cpu.c | 26 ++ 2 files changed, 30 insertions(+), 2 deletions

[RFC PATCH v4 16/30] hw/loongarch: Add LoongArch cpu interrupt support(CPUINTC)

2022-01-08 Thread Xiaojuan Yang
son.git/tree/Documentation/loongarch?h=loongarch-next 2.https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/loongarch/loongson3.c | 24 1 file changed, 24 insertions(+) diff --git a/hw/loongarch/loongson3.c b/hw/loongar

[RFC PATCH v4 11/30] target/loongarch: Add LoongArch interrupt and exception handle

2022-01-08 Thread Xiaojuan Yang
1.This patch Add loongarch interrupt and exception handle. 2.Rename the user excp to the exccode from the csr defintions. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- linux-user/loongarch64/cpu_loop.c | 8 +- target/loongarch/cpu.c| 252

[RFC PATCH v4 15/30] hw/loongarch: Add support loongson3-ls7a machine type.

2022-01-08 Thread Xiaojuan Yang
are emulated. More detailed info you can see https://github.com/loongson/LoongArch-Documentation Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- .../devices/loongarch64-softmmu/default.mak | 3 + configs/targets/loongarch64-softmmu.mak | 3 + hw/Kconfig

[RFC PATCH v4 20/30] hw/intc: Add LoongArch extioi interrupt controller(EIOINTC)

2022-01-08 Thread Xiaojuan Yang
This patch realize the EIOINTC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig| 3 + hw/intc/loongarch_extioi.c | 376 + hw/intc/meson.build| 1 + hw/intc/trace-events

[RFC PATCH v4 02/30] target/loongarch: Add CSR registers definition

2022-01-08 Thread Xiaojuan Yang
1.Define All the CSR registers and its field. 2.Set some default csr values. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu-csr.h | 236 + target/loongarch/cpu.c | 35 ++ target/loongarch/cpu.h | 57 + 3

[RFC PATCH v4 03/30] target/loongarch: Add basic vmstate description of CPU.

2022-01-08 Thread Xiaojuan Yang
This patch introduce vmstate_loongarch_cpu Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao Reviewed-by: Richard Henderson --- target/loongarch/cpu.c | 3 ++ target/loongarch/internals.h | 4 ++ target/loongarch/machine.c | 84 target

<    1   2   3   4   5   6   7   >