summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2015-05-14 19:23:27 -0700
committerPeter Maydell <peter.maydell@linaro.org>2015-05-18 16:41:14 +0100
commitb79b9d28f6b8f7879c50b6c053b4e3796de5b7d0 (patch)
tree060d1fee224d52653c2fd3577a3603faa99f89c2 /hw
parent859a0c5b5fb8be0c1ed78d96695a162c9210e1e6 (diff)
downloadqemu-b79b9d28f6b8f7879c50b6c053b4e3796de5b7d0.tar.gz
arm: xlnx-ep108: Add external RAM
Zynq MPSoC supports external DDR RAM. Add a RAM at 0 to the model. Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Tested-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: 2c25e2a4198402a6477aef2975d5df7c415dd341.1431381507.git.peter.crosthwaite@xilinx.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/arm/xlnx-ep108.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c
index 81704bb8f1..46f145b97d 100644
--- a/hw/arm/xlnx-ep108.c
+++ b/hw/arm/xlnx-ep108.c
@@ -18,11 +18,16 @@
#include "hw/arm/xlnx-zynqmp.h"
#include "hw/boards.h"
#include "qemu/error-report.h"
+#include "exec/address-spaces.h"
typedef struct XlnxEP108 {
XlnxZynqMPState soc;
+ MemoryRegion ddr_ram;
} XlnxEP108;
+/* Max 2GB RAM */
+#define EP108_MAX_RAM_SIZE 0x80000000ull
+
static void xlnx_ep108_init(MachineState *machine)
{
XlnxEP108 *s = g_new0(XlnxEP108, 1);
@@ -37,6 +42,21 @@ static void xlnx_ep108_init(MachineState *machine)
error_report("%s", error_get_pretty(err));
exit(1);
}
+
+ if (machine->ram_size > EP108_MAX_RAM_SIZE) {
+ error_report("WARNING: RAM size " RAM_ADDR_FMT " above max supported, "
+ "reduced to %llx", machine->ram_size, EP108_MAX_RAM_SIZE);
+ machine->ram_size = EP108_MAX_RAM_SIZE;
+ }
+
+ if (machine->ram_size <= 0x08000000) {
+ qemu_log("WARNING: RAM size " RAM_ADDR_FMT " is small for EP108",
+ machine->ram_size);
+ }
+
+ memory_region_allocate_system_memory(&s->ddr_ram, NULL, "ddr-ram",
+ machine->ram_size);
+ memory_region_add_subregion(get_system_memory(), 0, &s->ddr_ram);
}
static QEMUMachine xlnx_ep108_machine = {