Skip to contentSkip to conversation

Drop ignore_memory_transaction_failures for xilink_zynq

PATCH Superseded Chao Liu 2 participants 4 messages Sep 22, 2024 – Sep 25, 2024 Arm/Zynq architecture

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Chao Liu

author
#0 lore raw

cover Drop ignore_memory_transaction_failures for xilink_zynq

The ignore_memory_transaction_failures is used for compatibility with legacy board models.

I attempted to remove this property from the xilink_zynq board and replace it with unimplemented devices to handle devices that are not implemented on the board.

Chao Liu (2):
xilink_zynq: Add various missing unimplemented devices
xilink-zynq-devcfg: Fix up for memory address range size not set
correctly

 hw/arm/xilinx_zynq.c      | 44 ++++++++++++++++++++++++++++++++++++++-
 hw/dma/xlnx-zynq-devcfg.c |  2 +-
 2 files changed, 44 insertions(+), 2 deletions(-)
Signature · 1 line
2.46.1
author
#1 lore raw

PATCH 1/2 xilink_zynq: Add various missing unimplemented devices

Add PMU, CAN, GPIO, I2C, and other as unimplemented devices.

Remove a ignore_memory_transaction_failures concurrently.

This allows operating systems such as Linux to run emulations such as xilinx_zynq-7000

---
 hw/arm/xilinx_zynq.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)
hw/arm/xilinx_zynq.c +43 -1
index 37c234f5ab..729e78660d 100644
@@ -34,6 +34,7 @@
 #include "hw/net/cadence_gem.h"
 #include "hw/cpu/a9mpcore.h"
 #include "hw/qdev-clock.h"
+#include "hw/misc/unimp.h"
 #include "sysemu/reset.h"
 #include "qom/object.h"
 #include "exec/tswap.h"
@@ -232,6 +233,48 @@ static void zynq_init(MachineState *machine)
     /* DDR remapped to address zero.  */
     memory_region_add_subregion(address_space_mem, 0, machine->ram);
 
+    /* PMU */
+    create_unimplemented_device("pmu.region0", 0xf8891000, 0x1000);
+    create_unimplemented_device("pmu.region1", 0xf8893000, 0x1000);
+
+    /* CAN */
+    create_unimplemented_device("amba.can0", 0xe0008000, 0x1000);
+    create_unimplemented_device("amba.can1", 0xe0009000, 0x1000);
+
+    /* GPIO */
+    create_unimplemented_device("amba.gpio0", 0xe000a000, 0x1000);
+
+    /* I2C */
+    create_unimplemented_device("amba.i2c0", 0xe0004000, 0x1000);
+    create_unimplemented_device("amba.i2c1", 0xe0005000, 0x1000);
+
+    /* Interrupt-Controller */
+    create_unimplemented_device("amba.intc.region0", 0xf8f00100, 0x100);
+    create_unimplemented_device("amba.intc.region1", 0xf8f01000, 0x1000);
+
+    /* Memory-Controller */
+    create_unimplemented_device("amba.mc", 0xf8006000, 0x1000);
+
+    /* SMCC */
+    create_unimplemented_device("amba.smcc", 0xe000e000, 0x1000);
+    create_unimplemented_device("amba.smcc.nand0", 0xe1000000, 0x1000000);
+
+    /* Timer */
+    create_unimplemented_device("amba.global_timer", 0xf8f00200, 0x20);
+    create_unimplemented_device("amba.scutimer", 0xf8f00600, 0x20);
+
+    /* WatchDog */
+    create_unimplemented_device("amba.watchdog0", 0xf8005000, 0x1000);
+
+    /* Other */
+    create_unimplemented_device("amba.devcfg", 0xf8007000, 0x100);
+    create_unimplemented_device("amba.efuse", 0xf800d000, 0x20);
+    create_unimplemented_device("amba.etb", 0xf8801000, 0x1000);
+    create_unimplemented_device("amba.tpiu", 0xf8803000, 0x1000);
+    create_unimplemented_device("amba.funnel", 0xf8804000, 0x1000);
+    create_unimplemented_device("amba.ptm.region0", 0xf889c000, 0x1000);
+    create_unimplemented_device("amba.ptm.region1", 0xf889d000, 0x1000);
+
     /* 256K of on-chip memory */
     memory_region_init_ram(ocm_ram, NULL, "zynq.ocm_ram", 256 * KiB,
                            &error_fatal);
@@ -394,7 +437,6 @@ static void zynq_machine_class_init(ObjectClass *oc, void *data)
     mc->init = zynq_init;
     mc->max_cpus = ZYNQ_MAX_CPUS;
     mc->no_sdcard = 1;
-    mc->ignore_memory_transaction_failures = true;
     mc->valid_cpu_types = valid_cpu_types;
     mc->default_ram_id = "zynq.ext_ram";
     prop = object_class_property_add_str(oc, "boot-mode", NULL,
Signature · 1 line
2.46.1
author
#2 lore raw

PATCH 2/2 xilink-zynq-devcfg: Fix up for memory address range size not set correctly

In reply to Chao Liu
---
 hw/dma/xlnx-zynq-devcfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/dma/xlnx-zynq-devcfg.c +1 -1
index b8544d0731..7170353a62 100644
@@ -372,7 +372,7 @@ static void xlnx_zynq_devcfg_init(Object *obj)
                               s->regs_info, s->regs,
                               &xlnx_zynq_devcfg_reg_ops,
                               XLNX_ZYNQ_DEVCFG_ERR_DEBUG,
-                              XLNX_ZYNQ_DEVCFG_R_MAX);
+                              XLNX_ZYNQ_DEVCFG_R_MAX * 4);
     memory_region_add_subregion(&s->iomem,
                                 A_CTRL,
                                 &reg_array->mem);
Signature · 1 line
2.46.1
Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH v1 2/2] xilink-zynq-devcfg: Fix up for memory address range size not set correctly

Quoted 1 line · Chao Liu
Quoted 20 lines
---
 hw/dma/xlnx-zynq-devcfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/dma/xlnx-zynq-devcfg.c +1 -1
index b8544d0731..7170353a62 100644
@@ -372,7 +372,7 @@ static void xlnx_zynq_devcfg_init(Object *obj)
                               s->regs_info, s->regs,
                               &xlnx_zynq_devcfg_reg_ops,
                               XLNX_ZYNQ_DEVCFG_ERR_DEBUG,
-                              XLNX_ZYNQ_DEVCFG_R_MAX);
+                              XLNX_ZYNQ_DEVCFG_R_MAX * 4);
     memory_region_add_subregion(&s->iomem,
                                 A_CTRL,
                                 &reg_array->mem);
Signature · 1 line
2.46.1