[PATCH 1/1] LoongArch: step down as general arch maintainer

2023-10-12 Thread Xiaojuan Yang
I haven't really been working on LoongArch for some time now, so let's remove myself from this entry. Signed-off-by: Xiaojuan Yang --- MAINTAINERS | 2 -- 1 file changed, 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index c3cc12dc29..5c386f1f37 100644 --- a/MAINTAINERS +++ b

[PATCH v4] hw/loongarch/virt: Add cfi01 pflash device

2022-11-30 Thread Xiaojuan Yang
Add cfi01 pflash device for LoongArch virt machine Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig| 1 + hw/loongarch/acpi-build.c | 18 +++ hw/loongarch/virt.c | 62 + include/hw/loongarch/virt.h | 5 +++ 4 files changed, 86

[PATCH v3] hw/loongarch: Add cfi01 pflash device

2022-11-29 Thread Xiaojuan Yang
Add cfi01 pflash device for LoongArch virt machine Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig| 1 + hw/loongarch/acpi-build.c | 18 +++ hw/loongarch/virt.c | 62 + include/hw/loongarch/virt.h | 5 +++ 4 files changed, 86

[PATCH v2] hw/loongarch: Add cfi01 pflash device

2022-11-22 Thread Xiaojuan Yang
Add cfi01 pflash device for LoongArch virt machine Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig| 1 + hw/loongarch/acpi-build.c | 18 + hw/loongarch/virt.c | 80 - include/hw/loongarch/virt.h | 5 +++ 4 files changed, 103

[PATCH] hw/loongarch: Fix setprop_sized method in fdt rtc node.

2022-11-15 Thread Xiaojuan Yang
Fix setprop_sized method in fdt rtc node. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index b9c18ee517..958be74fa1 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c

[PATCH] hw/loongarch: Add cfi01 pflash device

2022-11-15 Thread Xiaojuan Yang
Add cfi01 pflash device for LoongArch virt machine Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig| 1 + hw/loongarch/acpi-build.c | 39 +++ hw/loongarch/virt.c | 130 +--- include/hw/loongarch/virt.h | 7 ++ 4 files changed

[PATCH] hw/loongarch: Replace the value of uart info with macro

2022-11-15 Thread Xiaojuan Yang
Using macro to replace the value of uart info such as addr, size in acpi_build method. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c index 68dfb9f88a

[PATCH] hw/loongarch: Add default stdout uart in fdt

2022-11-15 Thread Xiaojuan Yang
Add "chosen" subnode into LoongArch fdt, and set it's "stdout-path" prop to uart node. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 5e4c2790bf..b59c07972a 10064

[PATCH v2 0/3] Improve FDT and support TPM for LoongArch

2022-10-27 Thread Xiaojuan Yang
T base addr to 2 MiB. 2. Add uart and rtc info into FDT. 3. Add TPM device support. Xiaojuan Yang (3): hw/loongarch: Load FDT table into dram memory space hw/loongarch: Improve fdt for LoongArch virt machine hw/loongarch: Add TPM device for LoongArch virt machine hw/loongarch

[PATCH v2 3/3] hw/loongarch: Add TPM device for LoongArch virt machine

2022-10-27 Thread Xiaojuan Yang
Add TPM device for LoongArch virt machine, including establish TPM acpi info and add TYPE_TPM_TIS_SYSBUS to dynamic_sysbus_devices list. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 50 +-- hw/loongarch/virt.c | 4 2 files changed

[PATCH v2 2/3] hw/loongarch: Improve fdt for LoongArch virt machine

2022-10-27 Thread Xiaojuan Yang
Add new items into LoongArch FDT, including rtc and uart info. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c| 31 +++ include/hw/pci-host/ls7a.h | 1 + 2 files changed, 32 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index

[PATCH v2 1/3] hw/loongarch: Load FDT table into dram memory space

2022-10-27 Thread Xiaojuan Yang
Load FDT table into dram memory space, and the addr is 2 MiB. Since lowmem region starts from 0, FDT base address is located at 2 MiB to avoid NULL pointer access. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c | 18 +++--- include/hw/loongarch/virt.h | 3 --- 2 files

[PATCH v1 0/3] Improve FDT and support TPM for LoongArch

2022-10-21 Thread Xiaojuan Yang
This series change FDT base addr and add uart,rtc info into FDT, Add TPM device for LoongArch virt machine. Changes for v1: 1. Change FDT base addr to 2 MiB. 2. Add uart and rtc info into FDT. 3. Add TPM device support. Xiaojuan Yang (3): hw/loongarch: Change FDT base addr to 2 MiB hw

[PATCH v1 1/3] hw/loongarch: Change FDT base addr to 2 MiB

2022-10-21 Thread Xiaojuan Yang
Change FDT base addr to 2 MiB in lowmem region. Since lowmem region starts from 0, FDT base address is located at 2 MiB to avoid NULL pointer access. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c | 18 +++--- include/hw/loongarch/virt.h | 3 --- 2 files changed, 11

[PATCH v8 1/2] hw/intc: Convert the memops to with_attrs in LoongArch extioi

2022-10-21 Thread Xiaojuan Yang
Converting the MemoryRegionOps read/write handlers to with_attrs in LoongArch extioi emulation. Signed-off-by: Xiaojuan Yang Reviewed-by: Philippe Mathieu-Daudé --- hw/intc/loongarch_extioi.c | 31 +-- hw/intc/trace-events | 3 +-- 2 files changed, 18

[PATCH v1 3/3] hw/loongarch: Add TPM device for LoongArch virt machine

2022-10-20 Thread Xiaojuan Yang
Add TPM device for LoongArch virt machine, including establish TPM acpi info and add TYPE_TPM_TIS_SYSBUS to dynamic_sysbus_devices list. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 50 +-- hw/loongarch/virt.c | 4 2 files changed

[PATCH v1 2/3] hw/loongarch: Improve fdt for LoongArch virt machine

2022-10-20 Thread Xiaojuan Yang
Add new items into LoongArch FDT, including rtc and uart info. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c| 31 +++ include/hw/pci-host/ls7a.h | 1 + 2 files changed, 32 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index

[PATCH v8 2/2] hw/intc: Fix LoongArch extioi coreisr accessing

2022-10-20 Thread Xiaojuan Yang
1. When cpu read or write extioi COREISR reg, it should access the reg belonged to itself, so the cpu index of 's->coreisr' is current cpu number. Using MemTxAttrs' requester_id to get the cpu index. 2. it need not to mask 0x1f when calculate the coreisr array index. Signed-off-by: Xiaojuan Y

[PATCH v8 0/2] Fix LoongArch extioi coreisr accessing

2022-10-20 Thread Xiaojuan Yang
ioi function 3. Fix LoongArch ipi device emulation Xiaojuan Yang (2): hw/intc: Convert the memops to with_attrs in LoongArch extioi hw/intc: Fix LoongArch extioi coreisr accessing hw/intc/loongarch_extioi.c | 41 ++--- hw/intc/trace-events| 3 +-- tar

[PATCH v7 2/2] hw/intc: Fix LoongArch extioi coreisr accessing

2022-10-20 Thread Xiaojuan Yang
1. When cpu read or write extioi COREISR reg, it should access the reg belonged to itself, so the cpu index of 's->coreisr' is current cpu number. Using MemTxAttrs' requester_id to get the cpu index. 2. It need not to mask 0x1f when calculate the coreisr array index. Signed-off-by: Xiaojuan Y

[PATCH v7 1/2] hw/intc: Convert the memops to with_attrs in LoongArch extioi

2022-10-20 Thread Xiaojuan Yang
Converting the MemoryRegionOps read/write handlers to with_attrs in LoongArch extioi emulation. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_extioi.c | 32 +--- hw/intc/trace-events| 3 +-- target/loongarch/iocsr_helper.c | 18

[PATCH v7 0/2] Fix LoongArch extioi coreisr accessing

2022-10-20 Thread Xiaojuan Yang
wed. Changes for v2: 1. Adjust the position of 'PLATFORM' element in memmap table Changes for v1: 1. Add memmap table for LoongArch virt machine 2. Fix LoongArch extioi function 3. Fix LoongArch ipi device emulation Xiaojuan Yang (2): hw/intc: Convert the memops to with_attrs in LoongArch extioi

[PATCH v6 0/1] Fix LoongArch extioi coreisr accessing

2022-10-19 Thread Xiaojuan Yang
ice emulation Xiaojuan Yang (1): hw/intc: Fix LoongArch extioi coreisr accessing hw/intc/loongarch_extioi.c | 42 ++--- hw/intc/trace-events| 3 +-- target/loongarch/iocsr_helper.c | 18 +++--- 3 files changed, 34 insertions(+), 29 deleti

[PATCH v6 1/1] hw/intc: Fix LoongArch extioi coreisr accessing

2022-10-19 Thread Xiaojuan Yang
When cpu read or write extioi COREISR reg, it should access the reg belonged to itself, so the cpu index of 's->coreisr' is current cpu number. Using MemTxAttrs' requester_id to get the cpu index. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_extioi.c |

[PATCH v5 2/3] hw/intc: Remove unused extioi system memory region of LoongArch

2022-10-10 Thread Xiaojuan Yang
Remove the unused extioi system memory region and we only support the extioi iocsr memory region now. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_extioi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/intc/loongarch_extioi.c b/hw/intc/loongarch_extioi.c index a703dd30de

[PATCH v5 1/3] hw/intc: Fix LoongArch extioi function

2022-10-10 Thread Xiaojuan Yang
When cpu read or write extioi COREISR reg, it should access the reg belonged to itself, so the index of 's->coreisr' is current cpu number. Using MemTxAttrs' requester_type and id to get the cpu index. Based-on: <20220927141504.3886314-1-alex.ben...@linaro.org> Signed-off-by: Xiao

[PATCH v5 0/3] Add memmap and fix bugs for LoongArch

2022-10-10 Thread Xiaojuan Yang
machine 2. Fix LoongArch extioi function 3. Fix LoongArch ipi device emulation Xiaojuan Yang (3): hw/intc: Fix LoongArch extioi function hw/intc: Remove unused extioi system memory region of LoongArch hw/intc: Fix LoongArch ipi device emulation hw/intc/loongarch_extioi.c | 53

[PATCH v4 2/2] hw/intc: Fix LoongArch ipi device emulation

2022-09-30 Thread Xiaojuan Yang
in this case. Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- hw/intc/loongarch_ipi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c index 4f3c58f872..aa4bf9eb74 100644 --- a/hw/intc/loongarch_ipi.c +++ b/hw/intc

[PATCH v4 1/2] hw/intc: Fix LoongArch extioi function

2022-09-30 Thread Xiaojuan Yang
ory region now. Based-on: <20220927141504.3886314-1-alex.ben...@linaro.org> Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_extioi.c | 51 +++-- hw/intc/trace-events| 2 +- target/loongarch/iocsr_helper.c | 16 +-- 3 files changed, 38 i

[PATCH v4 0/2] Add memmap and fix bugs for LoongArch

2022-09-30 Thread Xiaojuan Yang
device emulation Xiaojuan Yang (2): hw/intc: Fix LoongArch extioi function hw/intc: Fix LoongArch ipi device emulation hw/intc/loongarch_extioi.c | 51 +++-- hw/intc/loongarch_ipi.c | 1 - hw/intc/trace-events| 2 +- target/loongarch

[PATCH v3 2/2] hw/intc: Fix LoongArch ipi device emulation

2022-09-30 Thread Xiaojuan Yang
in this case. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_ipi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c index 4f3c58f872..aa4bf9eb74 100644 --- a/hw/intc/loongarch_ipi.c +++ b/hw/intc/loongarch_ipi.c @@ -88,7 +88,6 @@ static void

[PATCH v3 0/2] Add memmap and fix bugs for LoongArch

2022-09-30 Thread Xiaojuan Yang
: 1. Add memmap table for LoongArch virt machine 2. Fix LoongArch extioi function 3. Fix LoongArch ipi device emulation Xiaojuan Yang (2): hw/intc: Fix LoongArch extioi function hw/intc: Fix LoongArch ipi device emulation hw/intc/loongarch_extioi.c | 51

[PATCH v3 1/2] hw/intc: Fix LoongArch extioi function

2022-09-30 Thread Xiaojuan Yang
ory region now. Based-on: <20220927141504.3886314-1-alex.ben...@linaro.org> Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_extioi.c | 51 +++-- hw/intc/trace-events| 2 +- target/loongarch/iocsr_helper.c | 16 +-- 3 files changed, 38 i

[PATCH v2 1/3] hw/loongarch: Add memmap for LoongArch virt machine

2022-09-27 Thread Xiaojuan Yang
Using memmap table for loongarch virt machine type, this method comes from arm/riscv architectures. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 46 ++-- hw/loongarch/fw_cfg.c | 5 +- hw/loongarch/virt.c | 138

[PATCH v2 2/3] hw/intc: Fix LoongArch extioi function

2022-09-27 Thread Xiaojuan Yang
1.When cpu read or write extioi COREISR reg, it should access the reg belonged to itself, so the index of 's->coreisr' is current cpu number. 2.Remove the unused extioi system memory region and we only support the extioi iocsr memory region now. Signed-off-by: Xiaojuan Yang --- hw/i

[PATCH v2 0/3] Add memmap and fix bugs for LoongArch

2022-09-27 Thread Xiaojuan Yang
emulation Thanks for your reviewing. Xiaojuan Yang (3): hw/loongarch: Add memmap for LoongArch virt machine hw/intc: Fix LoongArch extioi function hw/intc: Fix LoongArch ipi device emulation hw/intc/loongarch_extioi.c | 17 +++-- hw/intc/loongarch_ipi.c | 1 - hw/loongarch/acpi

[PATCH v2 3/3] hw/intc: Fix LoongArch ipi device emulation

2022-09-27 Thread Xiaojuan Yang
In ipi_send function, it should not to set irq before writing data to dest cpu iocsr space, as the irq will trigger after data writing. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_ipi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c

[PATCH v1 1/3] hw/loongarch: Add memmap for LoongArch virt machine

2022-09-22 Thread Xiaojuan Yang
Using memmap table for loongarch virt machine type, this method comes from arm/riscv architectures. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 46 ++-- hw/loongarch/fw_cfg.c | 5 +- hw/loongarch/virt.c | 138

[PATCH v1 3/3] hw/intc: Fix LoongArch ipi device emulation

2022-09-22 Thread Xiaojuan Yang
In ipi_send function, it should not to set irq before writing data to dest cpu iocsr space, as the irq will trigger after data writing. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_ipi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c

[PATCH v1 0/3] Add memmap and fix bugs for LoongArch

2022-09-22 Thread Xiaojuan Yang
This series add memmap table and fix extioi, ipi device emulation for LoongArch virt machine. Changes for v1: 1. Add memmap table for LoongArch virt machine 2. Fix LoongArch extioi function 3. Fix LoongArch ipi device emulation Thanks for your reviewing. Xiaojuan Yang (3): hw/loongarch: Add

[PATCH v1 2/3] hw/intc: Fix LoongArch extioi function

2022-09-22 Thread Xiaojuan Yang
1.When cpu read or write extioi COREISR reg, it should access the reg belonged to itself, so the index of 's->coreisr' is current cpu number. 2.Remove the unused extioi system memory region and we only support the extioi iocsr memory region now. Signed-off-by: Xiaojuan Yang --- hw/i

[PATCH v1 1/9] hw/loongarch: Remove vga device when loongarch init

2022-09-08 Thread Xiaojuan Yang
Remove the vga device when loongarch machine init and we will support other display device in the future. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig | 1 - hw/loongarch/virt.c | 3 --- 2 files changed, 4 deletions(-) diff --git a/hw/loongarch/Kconfig b/hw/loongarch/Kconfig index

[PATCH v1 7/9] hw/loongarch: Fix acpi ged irq number in dsdt table

2022-09-08 Thread Xiaojuan Yang
In dsdt, acpi ged irq should use gsi number, and the VIRT_SCI_IRQ means it. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c index d0f01a6485..95e30975a8 100644

[PATCH v1 3/9] hw/loongarch: Add interrupt information to FDT table

2022-09-08 Thread Xiaojuan Yang
Add interrupt information to FDT table, such as interrupt controller info, compatiable info, etc. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c | 29 + 1 file changed, 29 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 4f833a2044

[PATCH v1 5/9] hw/loongarch: Add hotplug handler for machine

2022-09-08 Thread Xiaojuan Yang
Add hotplug handler for LoongArch virt machine and now only support the dynamic sysbus device. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c | 32 1 file changed, 32 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 3976e8a058

[PATCH v1 4/9] hw/loongarch: Add platform bus support

2022-09-08 Thread Xiaojuan Yang
Add platform bus support and add the bus information such as address, size, irq number to FDT table. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig| 1 + hw/loongarch/virt.c | 33 + include/hw/loongarch/virt.h | 1 + include/hw/pci-host

[PATCH v1 2/9] hw/loongarch: Support fw_cfg dma function

2022-09-08 Thread Xiaojuan Yang
Support fw_cfg dma function for LoongArch virt machine. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig | 1 + hw/loongarch/fw_cfg.c | 3 ++- hw/loongarch/virt.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/Kconfig b/hw/loongarch/Kconfig index

[PATCH v1 9/9] hw/loongarch: Improve acpi dsdt table

2022-09-08 Thread Xiaojuan Yang
Cleanup the previous pci information in acpi dsdt table. And using the common acpi_dsdt_add_gpex function to build the gpex and pci information. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 159 +--- hw/loongarch/virt.c | 1 + include

[PATCH v1 8/9] hw/loongarch: Support memory hotplug

2022-09-08 Thread Xiaojuan Yang
Add hotplug/unplug interface for memory device. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig | 2 + hw/loongarch/acpi-build.c | 32 +--- hw/loongarch/virt.c | 105 +- 3 files changed, 132 insertions(+), 7 deletions(-) diff

[PATCH v1 0/9] Fix bugs and improve functions for LoongArch

2022-09-08 Thread Xiaojuan Yang
list 7. Fix acpi ged irq number in dsdt table 8. Support memory hotplug 9. Improve acpi dsdt table Xiaojuan Yang (9): hw/loongarch: Remove vga device when loongarch init hw/loongarch: Support fw_cfg dma function hw/loongarch: Add interrupt information to FDT table hw/loongarch: Add

[PATCH v1 6/9] hw/loongarch: Add RAMFB to dynamic_sysbus_devices list

2022-09-08 Thread Xiaojuan Yang
Add RAMFB device to dynamic_sysbus_devices list so that it can be hotpluged to the machine. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index a3dd35d579..1e1dc699ef 100644 --- a/hw/loongarch

[PATCH v1 0/2] Add mem hotplug and improve acpi dsdt

2022-08-26 Thread Xiaojuan Yang
This series based on the 'Add funtions for LoongArch virt machine patch'(11 Aug) and 'Fix acpi ged irq number in dsdt table patch'(19 Aug). Changes for v1: 1.Support memory hotplug 2.Improve acpi dsdt table Xiaojuan Yang (2): hw/loongarch: Support memory hotplug hw/loongarch: Improve acpi

[PATCH v1 1/2] hw/loongarch: Support memory hotplug

2022-08-26 Thread Xiaojuan Yang
Add hotplug/unplug interface for memory device. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig | 2 + hw/loongarch/acpi-build.c | 32 +--- hw/loongarch/virt.c | 105 +- 3 files changed, 132 insertions(+), 7 deletions(-) diff

[PATCH v1 2/2] hw/loongarch: Improve acpi dsdt table

2022-08-26 Thread Xiaojuan Yang
Cleanup the previous pci information in acpi dsdt table. And using the common acpi_dsdt_add_gpex function to build the gpex and pci information. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 159 +--- hw/loongarch/virt.c | 1 + include

[PATCH v1] hw/loongarch: Fix acpi ged irq number in dsdt table

2022-08-19 Thread Xiaojuan Yang
In dsdt, acpi ged irq should use gsi number, and the VIRT_SCI_IRQ means it. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c index d0f01a6485..95e30975a8 100644

[PATCH for-7.1] docs/system/loongarch: Update the LoongArch document

2022-08-12 Thread Xiaojuan Yang
1. Add some information about how to boot the LoongArch virt machine by uefi bios and linux kernel and how to access the source code or binary file. 2. Move the explanation of LoongArch system emulation in the target/loongarch/README to docs/system/loongarch/loongson3.rst Signed-off-by: Xiaojuan

[PATCH v1 5/6] hw/loongarch: Add hotplug handler for machine

2022-08-10 Thread Xiaojuan Yang
Add hotplug handler for LoongArch virt machine and now only support the dynamic sysbus device. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c | 32 1 file changed, 32 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 3976e8a058

[PATCH v1 4/6] hw/loongarch: Add platform bus support

2022-08-10 Thread Xiaojuan Yang
Add platform bus support and add the bus information such as address, size, irq number to FDT table. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig| 1 + hw/loongarch/virt.c | 33 + include/hw/loongarch/virt.h | 1 + include/hw/pci-host

[PATCH v1 1/6] hw/loongarch: Remove vga device when loongarch init

2022-08-10 Thread Xiaojuan Yang
Remove the vga device when loongarch machine init and we will support other display device in the future. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig | 1 - hw/loongarch/virt.c | 3 --- 2 files changed, 4 deletions(-) diff --git a/hw/loongarch/Kconfig b/hw/loongarch/Kconfig index

[PATCH v1 0/6] Add funtions for LoongArch virt machine

2022-08-10 Thread Xiaojuan Yang
table. 4. Add platform bus support. 5. Add hotplug handler for machine. 6. Add RAMFB to dynamic_sysbus_devices list. Please help review. Thanks. Xiaojuan Yang (6): hw/loongarch: Remove vga device when loongarch init hw/loongarch: Support fw_cfg dma function hw/loongarch: Add interrupt

[PATCH v1 3/6] hw/loongarch: Add interrupt information to FDT table

2022-08-10 Thread Xiaojuan Yang
Add interrupt information to FDT table, such as interrupt controller info, compatiable info, etc. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c | 29 + 1 file changed, 29 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 4f833a2044

[PATCH v1 6/6] hw/loongarch: Add RAMFB to dynamic_sysbus_devices list

2022-08-10 Thread Xiaojuan Yang
Add RAMFB device to dynamic_sysbus_devices list so that it can be hotpluged to the machine. Signed-off-by: Xiaojuan Yang --- hw/loongarch/virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index a3dd35d579..1e1dc699ef 100644 --- a/hw/loongarch

[PATCH v1 2/6] hw/loongarch: Support fw_cfg dma function

2022-08-10 Thread Xiaojuan Yang
Support fw_cfg dma function for LoongArch virt machine. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig | 1 + hw/loongarch/fw_cfg.c | 3 ++- hw/loongarch/virt.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/loongarch/Kconfig b/hw/loongarch/Kconfig index

[PATCH v1 1/2] hw/loongarch: Rename file 'loongson3.XXX' to 'virt.XXX'

2022-07-29 Thread Xiaojuan Yang
1. Rename 'loongson3.c' to 'virt.c' and change the meson.build file. 2. Rename 'loongson3.rst' to 'virt.rst'. Signed-off-by: Xiaojuan Yang --- MAINTAINERS | 2 +- hw/loongarch/meson.build | 2 +- hw/loongarch/{loongson3.c => virt.c} | 0 target/loonga

[PATCH v1 0/2] Change 'loongson3.XXX' file name and 'LS7A_XXX' macro name

2022-07-29 Thread Xiaojuan Yang
This series change 'loongson3.XXX' file name and 'LS7A_XXX' macro name. Changes for v1: 1. Rename 'loongson3.c' to 'virt.c' and change the meson.build file. 2. Rename 'loongson3.rst' to 'virt.rst'. 3. Change macro name 'LS7A_XXX' to 'VIRT_XXX'. Xiaojuan Yang (2): hw/loongarch: Rename file

[PATCH v1 2/2] hw/loongarch: Change macro name 'LS7A_XXX' to 'VIRT_XXX'

2022-07-29 Thread Xiaojuan Yang
Change macro name 'LS7A_XXX' to 'VIRT_XXX', as the loongarch virt machinue use the GPEX bridge instead of LS7A bridge. So the macro name should keep consistency. Signed-off-by: Xiaojuan Yang --- hw/loongarch/acpi-build.c | 18 ++-- hw/loongarch/virt.c | 56

[PATCH v1] target/loongarch/cpu: Fix cpucfg default value

2022-07-15 Thread Xiaojuan Yang
We should config cpucfg[20] to set value for the scache's ways, sets, and size arguments when loongarch cpu init. However, the old code wirte 'sets argument' twice, so we change one of them to 'size argument'. Signed-off-by: Xiaojuan Yang --- target/loongarch/cpu.c | 2 +- 1 file changed, 1

[PATCH v3 1/5] target/loongarch/cpu: Fix cpu_class_by_name function

2022-07-15 Thread Xiaojuan Yang
In loongarch_cpu_class_by_name(char *cpu_model) function, the argument cpu_model already has the suffix '-loongarch-cpu', so we should remove the LOONGARCH_CPU_TYPE_NAME(cpu_model) macro. And add the assertion that 'cpu_model' resolves to a class of the appropriate type. Signed-off-by: Xiaojuan

[PATCH v3 0/5] Fix LoongArch coverity error and cpu name bug

2022-07-15 Thread Xiaojuan Yang
nds, integer overflow, cond_at_most, etc. 2. Fix loongarch_cpu_class_by_name function. Please help review Thanks. Xiaojuan Yang (5): target/loongarch/cpu: Fix cpu_class_by_name function hw/intc/loongarch_pch_pic: Fix bugs for update_irq function target/loongarch/cpu: Fix coverity

[PATCH v3 3/5] target/loongarch/cpu: Fix coverity errors about excp_names

2022-07-15 Thread Xiaojuan Yang
Fix out-of-bounds errors when access excp_names[] array. the valid boundary size of excp_names should be 0 to ARRAY_SIZE(excp_names)-1. However, the general code do not consider the max boundary. Fix coverity CID: 1489758 Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target

[PATCH v3 2/5] hw/intc/loongarch_pch_pic: Fix bugs for update_irq function

2022-07-15 Thread Xiaojuan Yang
verity CID: 1489761 1489764 1489765 Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_pch_pic.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/hw/intc/loongarch_pch_pic.c b/hw/intc/loongarch_pch_pic.c index 3c9814a3b4..8fa64d2030 100644 --- a/h

[PATCH v3 4/5] target/loongarch/tlb_helper: Fix coverity integer overflow error

2022-07-15 Thread Xiaojuan Yang
Replace '1 << shift' with 'MAKE_64BIT_MASK(shift, 1)' to fix unintentional integer overflow errors in tlb_helper file. Fix coverity CID: 1489759 1489762 Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/tlb_helper.c | 4 ++-- 1 file changed, 2 insertions

[PATCH v3 5/5] target/loongarch/op_helper: Fix coverity cond_at_most error

2022-07-15 Thread Xiaojuan Yang
The boundary size of cpucfg array should be 0 to ARRAY_SIZE(cpucfg)-1. So, using index bigger than max boundary to access cpucfg[] must be forbidden. Fix coverity CID: 1489760 Signed-off-by: Xiaojuan Yang Reviewed-by: Richard Henderson --- target/loongarch/op_helper.c | 2 +- 1 file changed

[PATCH v2 0/5] Fix LoongArch coverity error and cpu name bug

2022-07-13 Thread Xiaojuan Yang
3. Add the assertion that 'cpu_model' resolve to a class of the appropriate type. Xiaojuan Yang (5): target/loongarch/cpu: Fix cpu_class_by_name function hw/intc/loongarch_pch_pic: Fix coverity errors in update irq target/loongarch/cpu: Fix coverity errors about excp_names target/loo

[PATCH 1/5] target/loongarch/cpu: Fix cpu_class_by_name function

2022-07-13 Thread Xiaojuan Yang
In loongarch_cpu_class_by_name(char *cpu_model) function, the argument cpu_model already has the suffix '-loongarch-cpu', so we should remove the LOONGARCH_CPU_TYPE_NAME(cpu_model) macro. And add the assertion that 'cpu_model' resolves to a class of the appropriate type. Signed-off-by: Xiaojuan

[PATCH 5/5] target/loongarch/op_helper: Fix coverity cond_at_most error

2022-07-13 Thread Xiaojuan Yang
The boundary size of cpucfg array should be 0 to 20. So, using index bigger than 20 to access cpucfg[] must be forbidden. Fix coverity CID: 1489760 Signed-off-by: Xiaojuan Yang --- target/loongarch/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/loongarch

[PATCH 2/5] hw/intc/loongarch_pch_pic: Fix coverity errors in update irq

2022-07-13 Thread Xiaojuan Yang
ccured when 'irq' >= 64. So we add a condition to avoid this. 3. Use 'MAKE_64BIT_MASK(irq, 1)' to replace '1ULL << shift'. Fix coverity CID: 1489761 1489764 1489765 Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_pch_pic.c | 19 --- 1 file changed, 12 insertions(

[PATCH 3/5] target/loongarch/cpu: Fix coverity errors about excp_names

2022-07-13 Thread Xiaojuan Yang
Fix out-of-bounds errors when access excp_names[] array. the valid boundary size of excp_names should be 0 to ARRAY_SIZE(excp_names)-1. However, the general code do not consider the max boundary. Fix coverity CID: 1489758 Signed-off-by: Xiaojuan Yang --- target/loongarch/cpu.c | 6 +++--- 1

[PATCH 4/5] target/loongarch/tlb_helper: Fix coverity integer overflow error

2022-07-13 Thread Xiaojuan Yang
Replace '1 << shift' with 'MAKE_64BIT_MASK(shift, 1)' to fix unintentional integer overflow errors in tlb_helper file. Fix coverity CID: 1489759 1489762 Signed-off-by: Xiaojuan Yang --- target/loongarch/tlb_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/

[PATCH 6/6] hw/loongarch: Add fdt support

2022-07-12 Thread Xiaojuan Yang
. Signed-off-by: Xiaojuan Yang --- hw/loongarch/loongson3.c| 136 +++- include/hw/loongarch/virt.h | 4 ++ target/loongarch/cpu.c | 1 + target/loongarch/cpu.h | 3 + 4 files changed, 141 insertions(+), 3 deletions(-) diff --git a/hw/loongarch

[PATCH 3/6] hw/loongarch: Add linux kernel booting support

2022-07-12 Thread Xiaojuan Yang
There are two situations to start system by kernel file. If exists bios option, system will boot from loaded bios file, else system will boot from hardcoded auxcode, and jump to kernel elf entry. Signed-off-by: Xiaojuan Yang --- hw/loongarch/loongson3.c | 114

[PATCH 1/6] hw/loongarch: Add fw_cfg table support

2022-07-12 Thread Xiaojuan Yang
Add fw_cfg table for loongarch virt machine, including memmap table. Signed-off-by: Xiaojuan Yang --- hw/loongarch/fw_cfg.c | 33 ++ hw/loongarch/fw_cfg.h | 15 hw/loongarch/loongson3.c| 47 - hw/loongarch

[PATCH 2/6] hw/loongarch: Add uefi bios loading support

2022-07-12 Thread Xiaojuan Yang
Add uefi bios loading support, now only uefi bios is porting to loongarch virt machine. Signed-off-by: Xiaojuan Yang --- hw/loongarch/loongson3.c| 34 ++ include/hw/loongarch/virt.h | 4 2 files changed, 38 insertions(+) diff --git a/hw/loongarch

[PATCH 4/6] hw/loongarch: Add smbios support

2022-07-12 Thread Xiaojuan Yang
Add smbios support for loongarch virt machine, and put them into fw_cfg table so that bios can parse them quickly. The weblink of smbios spec: https://www.dmtf.org/dsp/DSP0134, the version is 3.6.0. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig| 1 + hw/loongarch/loongson3.c

[PATCH v1 0/6] Support booting bios and kernel for LoongArch

2022-07-12 Thread Xiaojuan Yang
file: * https://github.com/loongson/linux/tree/loongarch-next The bios file: * https://github.com/loongson/edk2 * https://github.com/loongson/edk2-platforms Xiaojuan Yang (6): hw/loongarch: Add fw_cfg table support hw/loongarch: Add uefi bios loading support hw/loongarch: Add linux

[PATCH v1 0/5] Fix LoongArch coverity error and cpu name bug

2022-07-12 Thread Xiaojuan Yang
This series fix some errors for LoongArch virt machine 1. Fix coverity errors such as out-of-bounds, integer overflow, cond_at_most, etc. 2. Fix loongarch_cpu_class_by_name function. Xiaojuan Yang (5): target/loongarch/cpu: Fix cpu_class_by_name function hw/intc/loongarch_pch_pic: Fix

[PATCH 5/6] hw/loongarch: Add acpi ged support

2022-07-12 Thread Xiaojuan Yang
, and will release soon. Signed-off-by: Xiaojuan Yang --- hw/loongarch/Kconfig| 2 + hw/loongarch/acpi-build.c | 609 hw/loongarch/loongson3.c| 78 - hw/loongarch/meson.build| 1 + include/hw/loongarch/virt.h | 13 + include/hw/pci-host/ls7a.h

[PATCH 3/5] target/loongarch/cpu: Fix coverity errors about excp_names

2022-07-12 Thread Xiaojuan Yang
Fix out-of-bounds errors when access excp_names[] array. the valid boundary size of excp_names should be 0 to ARRAY_SIZE(excp_names)-1. However, the general code do not consider the max boundary. Fix coverity CID: 1489758 Signed-off-by: Xiaojuan Yang --- target/loongarch/cpu.c | 6 +++--- 1

[PATCH 1/5] target/loongarch/cpu: Fix cpu_class_by_name function

2022-07-12 Thread Xiaojuan Yang
In loongarch_cpu_class_by_name(char *cpu_model) function, the argument cpu_model already has the suffix '-loongarch-cpu', so we should remove the LOONGARCH_CPU_TYPE_NAME(cpu_model) macro. Signed-off-by: Xiaojuan Yang --- target/loongarch/cpu.c | 5 + 1 file changed, 1 insertion(+), 4

[PATCH 2/5] hw/intc/loongarch_pch_pic: Fix coverity errors in update irq

2022-07-12 Thread Xiaojuan Yang
ccured when 'irq' >= 64. So we add a condition to avoid this. Fix coverity CID: 1489761 1489764 1489765 Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_pch_pic.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/intc/loongarch_pch_pic.c

[PATCH 5/5] target/loongarch/op_helper: Fix coverity cond_at_most error

2022-07-12 Thread Xiaojuan Yang
The boundary size of cpucfg array should be 0 to 20. So, using index bigger than 20 to access cpucfg[] must be forbidden. Fix coverity CID: 1489760 Signed-off-by: Xiaojuan Yang --- target/loongarch/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/loongarch

[PATCH 4/5] target/loongarch/tlb_helper: Fix coverity integer overflow error

2022-07-12 Thread Xiaojuan Yang
Replace '1' with '1UL' to fix unintentional integer overflow errors in tlb_helper file. Fix coverity CID: 1489759 1489762 Signed-off-by: Xiaojuan Yang --- target/loongarch/tlb_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/loongarch/tlb_helper.c b

[PATCH 1/2] hw/intc/loongarch_ipi: Fix ipi device access of 64bits

2022-07-05 Thread Xiaojuan Yang
In general loongarch ipi device, 32bit registers is emulated, however for anysend/mailsend device only 64bit register access is supported. So separate the ipi memory region into two regions, including 32 bits and 64 bits. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_ipi.c | 38

[PATCH 2/2] hw/intc/loongarch_ipi: Fix mail send and any send function

2022-07-05 Thread Xiaojuan Yang
By the document of ipi mailsend device, byte is written only when the mask bit is 0. The original code discards mask bit and overwrite the data always, this patch fixes the issue. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_ipi.c | 54 +++-- 1 file

[PATCH v3 0/2] Fix IPI device emulation for LoongArch machine

2022-07-05 Thread Xiaojuan Yang
(), as the mask is 0 at most time. Xiaojuan Yang (2): hw/intc/loongarch_ipi: Fix ipi device access of 64bits hw/intc/loongarch_ipi: Fix mail send and any send function hw/intc/loongarch_ipi.c | 92 ++--- hw/loongarch/loongson3.c| 5 +- include/hw/intc

[PATCH 10/11] hw/intc/loongarch_ipi: Fix ipi device access of 64bits

2022-07-01 Thread Xiaojuan Yang
In general loongarch ipi device, 32bit registers is emulated, however for anysend/mailsend device only 64bit register access is supported. So separate the ipi memory region into two regions, including 32 bits and 64 bits. Signed-off-by: Xiaojuan Yang --- hw/intc/loongarch_ipi.c | 38

[PATCH 02/11] hw/rtc/ls7a_rtc: Fix timer call back function

2022-07-01 Thread Xiaojuan Yang
Replace qemu_irq_pulse with qemu_irq_raise in ls7a_timer_cb function to keep consistent with hardware behavior when raise irq. Signed-off-by: Xiaojuan Yang --- hw/rtc/ls7a_rtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/rtc/ls7a_rtc.c b/hw/rtc/ls7a_rtc.c index

[PATCH 09/11] target/loongarch: Add lock when writing timer clear reg

2022-07-01 Thread Xiaojuan Yang
Add mutex iothread lock around loongarch_cpu_set_irq in csrwr_ticlr() to fix the bug. Signed-off-by: Xiaojuan Yang --- target/loongarch/csr_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/loongarch/csr_helper.c b/target/loongarch/csr_helper.c index 24a9389364..7e02787895

[PATCH 01/11] hw/rtc/ls7a_rtc: Fix uninitialied bugs and toymatch writing function

2022-07-01 Thread Xiaojuan Yang
: Coverity CID 1489766, 1489763 Signed-off-by: Xiaojuan Yang --- hw/rtc/ls7a_rtc.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/hw/rtc/ls7a_rtc.c b/hw/rtc/ls7a_rtc.c index fe6710310f..b88a90de8b 100644 --- a/hw/rtc/ls7a_rtc.c +++ b/hw/rtc/ls7a_rtc.c

[PATCH 07/11] hw/rtc/ls7a_rtc: Fix 'calculate' spelling errors

2022-07-01 Thread Xiaojuan Yang
Fix 'calculate' spelling errors. Signed-off-by: Xiaojuan Yang --- hw/rtc/ls7a_rtc.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/rtc/ls7a_rtc.c b/hw/rtc/ls7a_rtc.c index 85cd2d22a5..e8b75701e4 100644 --- a/hw/rtc/ls7a_rtc.c +++ b/hw/rtc/ls7a_rtc.c

  1   2   3   4   5   6   7   >