Skip to contentSkip to conversation

minor loongarch cleanups

GIT PULL Applied Richard Henderson 1 participant 5 messages Jul 30, 2022 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

As this is a new target this release, and these patches are so minor, I'm applying these as a bug fix.

r~

Xiaojuan Yang (2):
hw/loongarch: Rename file 'loongson3.XXX' to 'virt.XXX' hw/loongarch: Change macro name 'LS7A_XXX' to 'VIRT_XXX'

 include/hw/loongarch/virt.h          |  8 ++--
 include/hw/pci-host/ls7a.h           | 43 ++++++++++-----------
 hw/loongarch/acpi-build.c            | 18 ++++-----
 hw/loongarch/{loongson3.c => virt.c} | 56 ++++++++++++++--------------
 MAINTAINERS                          |  2 +-
 hw/loongarch/meson.build             |  2 +-
 target/loongarch/README              |  2 +-
 7 files changed, 64 insertions(+), 67 deletions(-)
 rename hw/loongarch/{loongson3.c => virt.c} (93%)
Signature · 1 line
2.34.1
#1 lore raw

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

From: Xiaojuan Yang <[email protected]>

1. Rename 'loongson3.c' to 'virt.c' and change the meson.build file.
2. Rename 'loongson3.rst' to 'virt.rst'.

Message-Id: <[email protected]>

---
 hw/loongarch/{loongson3.c => virt.c} | 0
 MAINTAINERS                          | 2 +-
 hw/loongarch/meson.build             | 2 +-
 target/loongarch/README              | 2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename hw/loongarch/{loongson3.c => virt.c} (100%)
hw/loongarch/virt.c renamed from hw/loongarch/loongson3.c +0 -0
similarity index 100%
rename from hw/loongarch/loongson3.c
rename to hw/loongarch/virt.c
MAINTAINERS +1 -1
index 6af9cd985c..5ce4227ff6 100644
@@ -1129,7 +1129,7 @@ Virt
 M: Xiaojuan Yang <[email protected]>
 M: Song Gao <[email protected]>
 S: Maintained
-F: docs/system/loongarch/loongson3.rst
+F: docs/system/loongarch/virt.rst
 F: configs/targets/loongarch64-softmmu.mak
 F: configs/devices/loongarch64-softmmu/default.mak
 F: hw/loongarch/
hw/loongarch/meson.build +1 -1
index 6a2a1b18e5..c0421502ab 100644
@@ -2,7 +2,7 @@ loongarch_ss = ss.source_set()
 loongarch_ss.add(files(
     'fw_cfg.c',
 ))
-loongarch_ss.add(when: 'CONFIG_LOONGARCH_VIRT', if_true: [files('loongson3.c'), fdt])
+loongarch_ss.add(when: 'CONFIG_LOONGARCH_VIRT', if_true: [files('virt.c'), fdt])
 loongarch_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-build.c'))
 
 hw_arch += {'loongarch': loongarch_ss}
target/loongarch/README +1 -1
index 9f5edd10c8..1823375d04 100644
@@ -15,7 +15,7 @@
   3A5000 support multiple interrupt cascading while here we just emulate the extioi interrupt
   cascading. LS7A1000 host bridge support multiple devices, such as sata, gmac, uart, rtc
   and so on. But we just realize the rtc. Others use the qemu common devices. It does not affect
-  the general use. We also introduced the emulation of devices at docs/system/loongarch/loongson3.rst.
+  the general use. We also introduced the emulation of devices at docs/system/loongarch/virt.rst.
 
   This version only supports running binary files in ELF format, and does not depend on BIOS and kernel file.
   You can compile the test program with 'make & make check-tcg' and run the test case with the following command:
Signature · 1 line
2.34.1
#2 lore raw

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

In reply to Richard Henderson

From: Xiaojuan Yang <[email protected]>

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.

Message-Id: <[email protected]>

---
 include/hw/loongarch/virt.h |  8 +++---
 include/hw/pci-host/ls7a.h  | 43 +++++++++++++---------------
 hw/loongarch/acpi-build.c   | 18 ++++++------
 hw/loongarch/virt.c         | 56 ++++++++++++++++++-------------------
 4 files changed, 61 insertions(+), 64 deletions(-)
include/hw/loongarch/virt.h +4 -4
index f4f24df428..92b84de1c5 100644
@@ -15,8 +15,8 @@
 
 #define LOONGARCH_MAX_VCPUS     4
 
-#define LOONGARCH_ISA_IO_BASE   0x18000000UL
-#define LOONGARCH_ISA_IO_SIZE   0x0004000
+#define VIRT_ISA_IO_BASE        0x18000000UL
+#define VIRT_ISA_IO_SIZE        0x0004000
 #define VIRT_FWCFG_BASE         0x1e020000UL
 #define VIRT_BIOS_BASE          0x1c000000UL
 #define VIRT_BIOS_SIZE          (4 * MiB)
@@ -28,8 +28,8 @@
 #define VIRT_GED_MEM_ADDR       (VIRT_GED_EVT_ADDR + ACPI_GED_EVT_SEL_LEN)
 #define VIRT_GED_REG_ADDR       (VIRT_GED_MEM_ADDR + MEMORY_HOTPLUG_IO_LEN)
 
-#define LA_FDT_BASE             0x1c400000
-#define LA_FDT_SIZE             0x100000
+#define VIRT_FDT_BASE           0x1c400000
+#define VIRT_FDT_SIZE           0x100000
 
 struct LoongArchMachineState {
     /*< private >*/
include/hw/pci-host/ls7a.h +20 -23

54 lines not on this page · raw message

hw/loongarch/acpi-build.c +9 -9
index b95b83b079..4b4529a3fb 100644
@@ -135,7 +135,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, LoongArchMachineState *lams)
     build_append_int_noprefix(table_data, 21, 1);        /* Type */
     build_append_int_noprefix(table_data, 19, 1);        /* Length */
     build_append_int_noprefix(table_data, 1, 1);         /* Version */
-    build_append_int_noprefix(table_data, LS7A_PCH_MSI_ADDR_LOW, 8);/* Address */
+    build_append_int_noprefix(table_data, VIRT_PCH_MSI_ADDR_LOW, 8);/* Address */
     build_append_int_noprefix(table_data, 0x40, 4);      /* Start */
     build_append_int_noprefix(table_data, 0xc0, 4);      /* Count */
 
@@ -143,7 +143,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, LoongArchMachineState *lams)
     build_append_int_noprefix(table_data, 22, 1);        /* Type */
     build_append_int_noprefix(table_data, 17, 1);        /* Length */
     build_append_int_noprefix(table_data, 1, 1);         /* Version */
-    build_append_int_noprefix(table_data, LS7A_PCH_REG_BASE, 8);/* Address */
+    build_append_int_noprefix(table_data, VIRT_PCH_REG_BASE, 8);/* Address */
     build_append_int_noprefix(table_data, 0x1000, 2);    /* Size */
     build_append_int_noprefix(table_data, 0, 2);         /* Id */
     build_append_int_noprefix(table_data, 0x40, 2);      /* Base */
@@ -307,7 +307,7 @@ static void build_uart_device_aml(Aml *table)
     Aml *dev;
     Aml *crs;
     Aml *pkg0, *pkg1, *pkg2;
-    uint32_t uart_irq = LS7A_UART_IRQ;
+    uint32_t uart_irq = VIRT_UART_IRQ;
 
     Aml *scope = aml_scope("_SB");
     dev = aml_device("COMA");
@@ -367,7 +367,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, MachineState *machine)
     if (lams->acpi_ged) {
         build_ged_aml(dsdt, "\\_SB."GED_DEVICE,
                       HOTPLUG_HANDLER(lams->acpi_ged),
-                      LS7A_SCI_IRQ - PCH_PIC_IRQ_OFFSET, AML_SYSTEM_MEMORY,
+                      VIRT_SCI_IRQ - PCH_PIC_IRQ_OFFSET, AML_SYSTEM_MEMORY,
                       VIRT_GED_EVT_ADDR);
     }
 
@@ -385,9 +385,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, MachineState *machine)
     aml_append(crs,
         aml_dword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED,
                          AML_CACHEABLE, AML_READ_WRITE,
-                         0, LS7A_PCI_MEM_BASE,
-                         LS7A_PCI_MEM_BASE + LS7A_PCI_MEM_SIZE - 1,
-                         0, LS7A_PCI_MEM_BASE));
+                         0, VIRT_PCI_MEM_BASE,
+                         VIRT_PCI_MEM_BASE + VIRT_PCI_MEM_SIZE - 1,
+                         0, VIRT_PCI_MEM_BASE));
     aml_append(scope, aml_name_decl("_CRS", crs));
     aml_append(dsdt, scope);
 
@@ -462,8 +462,8 @@ static void acpi_build(AcpiBuildTables *tables, MachineState *machine)
     acpi_add_table(table_offsets, tables_blob);
     {
         AcpiMcfgInfo mcfg = {
-           .base = cpu_to_le64(LS_PCIECFG_BASE),
-           .size = cpu_to_le64(LS_PCIECFG_SIZE),
+           .base = cpu_to_le64(VIRT_PCI_CFG_BASE),
+           .size = cpu_to_le64(VIRT_PCI_CFG_SIZE),
         };
         build_mcfg(tables_blob, tables->linker, &mcfg, lams->oem_id,
                    lams->oem_table_id);
hw/loongarch/virt.c +28 -28

138 lines not on this page · raw message

Signature · 1 line
2.34.1
#3 lore raw
In reply to Richard Henderson
Quoted 4 lines · Richard Henderson

As this is a new target this release, and these patches are so minor, I'm applying these as a bug fix.

r~

Dangit, impatience

https://gitlab.com/rth7680/qemu.git pull-la-20220729

r~

Quoted 14 lines

Xiaojuan Yang (2):
hw/loongarch: Rename file 'loongson3.XXX' to 'virt.XXX' hw/loongarch: Change macro name 'LS7A_XXX' to 'VIRT_XXX'

  include/hw/loongarch/virt.h          |  8 ++--
  include/hw/pci-host/ls7a.h           | 43 ++++++++++-----------
  hw/loongarch/acpi-build.c            | 18 ++++-----
  hw/loongarch/{loongson3.c => virt.c} | 56 ++++++++++++++--------------
  MAINTAINERS                          |  2 +-
  hw/loongarch/meson.build             |  2 +-
  target/loongarch/README              |  2 +-
  7 files changed, 64 insertions(+), 67 deletions(-)

rename hw/loongarch/{loongson3.c => virt.c} (93%)

author Applied
#4 lore raw
In reply to Richard Henderson
Quoted 17 lines · Richard Henderson

As this is a new target this release, and these patches are so minor, I'm applying these as a bug fix.

r~

Xiaojuan Yang (2):
hw/loongarch: Rename file 'loongson3.XXX' to 'virt.XXX' hw/loongarch: Change macro name 'LS7A_XXX' to 'VIRT_XXX'

  include/hw/loongarch/virt.h          |  8 ++--
  include/hw/pci-host/ls7a.h           | 43 ++++++++++-----------
  hw/loongarch/acpi-build.c            | 18 ++++-----
  hw/loongarch/{loongson3.c => virt.c} | 56 ++++++++++++++--------------
  MAINTAINERS                          |  2 +-
  hw/loongarch/meson.build             |  2 +-
  target/loongarch/README              |  2 +-
  7 files changed, 64 insertions(+), 67 deletions(-)
Quoted 2 lines

rename hw/loongarch/{loongson3.c => virt.c} (93%)

Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate.

r~