qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC v2 32/34] arm: xilinx_zynq: Add a Microblaze


From: Peter Crosthwaite
Subject: [Qemu-devel] [RFC v2 32/34] arm: xilinx_zynq: Add a Microblaze
Date: Sat, 30 May 2015 23:12:05 -0700

From: Peter Crosthwaite <address@hidden>

Add a Microblaze processor with full system visibility to the machine
model. This emulates a single Microblaze implemented in the Zynq SoC
programmable logic.

Use the standard microblaze bootloader to loader software.

Conditionally compile these components on TARGET_MULTI so the board
still can be used for arm single-arch.

Signed-off-by: Peter Crosthwaite <address@hidden>
---
 hw/arm/xilinx_zynq.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index a4e7b5c..d583871 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -25,6 +25,11 @@
 #include "sysemu/block-backend.h"
 #include "hw/loader.h"
 #include "hw/ssi.h"
+
+#ifdef TARGET_MULTI
+#include "hw/microblaze/boot.h"
+#endif
+
 #include "qemu/error-report.h"
 
 #define NUM_SPI_FLASHES 4
@@ -110,6 +115,9 @@ static void zynq_init(MachineState *machine)
     const char *initrd_filename = machine->initrd_filename;
     ObjectClass *cpu_oc;
     ARMCPU *cpu;
+#ifdef TARGET_MULTI
+    MicroBlazeCPU *mb_cpu;
+#endif
     MemoryRegion *address_space_mem = get_system_memory();
     MemoryRegion *ext_ram = g_new(MemoryRegion, 1);
     MemoryRegion *ocm_ram = g_new(MemoryRegion, 1);
@@ -160,6 +168,13 @@ static void zynq_init(MachineState *machine)
         ram_size = 0x80000000;
     }
 
+#ifdef TARGET_MULTI
+    mb_cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
+    object_property_set_bool(OBJECT(mb_cpu), true, "realized", &error_abort);
+    microblaze_load_kernel(mb_cpu, 0, ram_size, NULL, NULL, NULL);
+#endif
+
+
     /* DDR remapped to address zero.  */
     memory_region_allocate_system_memory(ext_ram, NULL, "zynq.ext_ram",
                                          ram_size);
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]