From: Alistair Francis <alistair.francis@xilinx.com>
To: qemu-devel@nongnu.org
Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org,
crosthwaitepeter@gmail.com, edgar.iglesias@gmail.com,
alistair.francis@xilinx.com
Subject: [Qemu-devel] [PATCH v1 1/1] xlnx-ep108: Add support for high DDR memory regions
Date: Mon, 23 Nov 2015 21:00:02 -0800 [thread overview]
Message-ID: <ab5dd056f109b678e1c91468225177078617a4ad.1448340998.git.alistair.francis@xilinx.com> (raw)
The Xilinx EP108 supports three memory regions:
- A 2GB region starting at 0
- A 32GB region starting at 32GB
- A 256GB region starting at 768GB
This patch adds support for the middle memory region, which is
automatically created based on the size specified by the QEMU memory
command line argument.
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---
Also, the Xilinx ZynqMP TRM has been released, if anyone is interested
it is avalibale at:
http://www.xilinx.com/products/silicon-devices/soc/zynq-ultrascale-mpsoc.html?resultsTablePreSelect=documenttype:User%20Guides#documentation
hw/arm/xlnx-ep108.c | 47 +++++++++++++++++++++++++++++++++++------------
1 file changed, 35 insertions(+), 12 deletions(-)
diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c
index 2899698..8c59d6d 100644
--- a/hw/arm/xlnx-ep108.c
+++ b/hw/arm/xlnx-ep108.c
@@ -22,17 +22,22 @@
typedef struct XlnxEP108 {
XlnxZynqMPState soc;
- MemoryRegion ddr_ram;
+ MemoryRegion ddr_ram_low;
+ MemoryRegion ddr_ram_high;
} XlnxEP108;
-/* Max 2GB RAM */
-#define EP108_MAX_RAM_SIZE 0x80000000ull
+/* Maximum size of the low memory region */
+#define EP108_MAX_LOW_RAM_SIZE 0x80000000ull
+/* Total maximum size of the EP108 memory */
+#define EP108_MAX_RAM_SIZE 0x880000000ull
+#define EP108_HIGH_RAM_START 0x800000000ull
static struct arm_boot_info xlnx_ep108_binfo;
static void xlnx_ep108_init(MachineState *machine)
{
XlnxEP108 *s = g_new0(XlnxEP108, 1);
+ ram_addr_t ddr_low_size, ddr_high_size;
Error *err = NULL;
object_initialize(&s->soc, sizeof(s->soc), TYPE_XLNX_ZYNQMP);
@@ -45,20 +50,38 @@ static void xlnx_ep108_init(MachineState *machine)
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);
+ if (machine->ram_size > EP108_MAX_LOW_RAM_SIZE) {
+ ddr_low_size = EP108_MAX_LOW_RAM_SIZE;
+
+ /* The RAM size is above the maximum avaliable for the low DDR.
+ * Create the high DDR memory region as well
+ */
+ 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);
+ ddr_high_size = EP108_MAX_RAM_SIZE - EP108_MAX_LOW_RAM_SIZE;
+ } else {
+ ddr_high_size = machine->ram_size - EP108_MAX_LOW_RAM_SIZE;
+ }
+
+ memory_region_allocate_system_memory(&s->ddr_ram_high, NULL,
+ "ddr-ram-high",
+ ddr_high_size);
+ memory_region_add_subregion(get_system_memory(), EP108_HIGH_RAM_START,
+ &s->ddr_ram_high);
+ } else {
+ ddr_low_size = machine->ram_size;
+ }
+
+ memory_region_allocate_system_memory(&s->ddr_ram_low, NULL, "ddr-ram-low",
+ ddr_low_size);
+ memory_region_add_subregion(get_system_memory(), 0, &s->ddr_ram_low);
xlnx_ep108_binfo.ram_size = machine->ram_size;
xlnx_ep108_binfo.kernel_filename = machine->kernel_filename;
--
2.5.0
next reply other threads:[~2015-11-24 5:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 5:00 Alistair Francis [this message]
2015-11-25 6:33 ` [Qemu-devel] [PATCH v1 1/1] xlnx-ep108: Add support for high DDR memory regions Peter Crosthwaite
2015-12-16 19:08 ` Alistair Francis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ab5dd056f109b678e1c91468225177078617a4ad.1448340998.git.alistair.francis@xilinx.com \
--to=alistair.francis@xilinx.com \
--cc=crosthwaitepeter@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=edgar.iglesias@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).