Fix the CBAR initialisation by using the newly defined static property. Zynq will now correctly init the CBAR to the SCU base address.
Needed to boot Linux on the xilinx_zynq machine model. Signed-off-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com> --- hw/arm/xilinx_zynq.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index b4553e8..e21a0ab 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -35,6 +35,8 @@ #define IRQ_OFFSET 32 /* pic interrupts start from index 32 */ +#define SCU_BASE_ADDR 0xF8F00000 + static const int dma_irqs[8] = { 46, 47, 48, 49, 72, 73, 74, 75 }; @@ -121,6 +123,11 @@ static void zynq_init(QEMUMachineInitArgs *args) cpu = ARM_CPU(object_new(cpu_model)); g_free((void *)cpu_model); + object_property_set_int(OBJECT(cpu), SCU_BASE_ADDR, "cbar", &err); + if (err) { + fprintf(stderr, "%s\n", error_get_pretty(err)); + exit(1); + } object_property_set_bool(OBJECT(cpu), true, "realized", &err); if (err) { fprintf(stderr, "%s\n", error_get_pretty(err)); @@ -159,7 +166,7 @@ static void zynq_init(QEMUMachineInitArgs *args) qdev_prop_set_uint32(dev, "num-cpu", 1); qdev_init_nofail(dev); busdev = SYS_BUS_DEVICE(dev); - sysbus_mmio_map(busdev, 0, 0xF8F00000); + sysbus_mmio_map(busdev, 0, SCU_BASE_ADDR); sysbus_connect_irq(busdev, 0, qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ)); -- 1.8.4.4