diff mbox

[v3,2/7] hw: Add maximum RAM specifications for ARM devboard models

Message ID 1301407704-24541-3-git-send-email-peter.maydell@linaro.org
State Rejected
Headers show

Commit Message

Peter Maydell March 29, 2011, 2:08 p.m. UTC
Specify the maximum memory permitted for the various ARM devboard
models (integratorcp, realview-eb, realview-eb-mpcore, realview-pb-a8,
realview-pbx-a9, versatilepb, versatileab). This means we now handle
attempts to specify too much RAM gracefully rather than causing
the guest to crash in an obscure fashion.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/integratorcp.c |    1 +
 hw/realview.c     |   11 +++++++++++
 hw/versatilepb.c  |    5 +++++
 3 files changed, 17 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index b049940..ccc44db 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -516,6 +516,7 @@  static QEMUMachine integratorcp_machine = {
     .name = "integratorcp",
     .desc = "ARM Integrator/CP (ARM926EJ-S)",
     .init = integratorcp_init,
+    .max_ram = 256 * 1024 * 1024,
     .is_default = 1,
 };
 
diff --git a/hw/realview.c b/hw/realview.c
index a67861e..a158ade 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -432,6 +432,7 @@  static QEMUMachine realview_eb_machine = {
     .desc = "ARM RealView Emulation Baseboard (ARM926EJ-S)",
     .init = realview_eb_init,
     .use_scsi = 1,
+    .max_ram = 256 * 1024 * 1024,
 };
 
 static QEMUMachine realview_eb_mpcore_machine = {
@@ -440,12 +441,18 @@  static QEMUMachine realview_eb_mpcore_machine = {
     .init = realview_eb_mpcore_init,
     .use_scsi = 1,
     .max_cpus = 4,
+    .max_ram = 256 * 1024 * 1024,
 };
 
 static QEMUMachine realview_pb_a8_machine = {
     .name = "realview-pb-a8",
     .desc = "ARM RealView Platform Baseboard for Cortex-A8",
     .init = realview_pb_a8_init,
+    /* The PB-A8 has 512MB; qemu also supports an extra PBX-A9-like
+     * 512MB although strictly speaking that area of the address
+     * space is 'reserved' on the PB-A8.
+     */
+    .max_ram = 1024 * 1024 * 1024,
 };
 
 static QEMUMachine realview_pbx_a9_machine = {
@@ -454,6 +461,10 @@  static QEMUMachine realview_pbx_a9_machine = {
     .init = realview_pbx_a9_init,
     .use_scsi = 1,
     .max_cpus = 4,
+    /* Realview PBX has 1GB of RAM (512MB on the motherboard
+     * and another 512MB on the daughterboard)
+     */
+    .max_ram = 1024 * 1024 * 1024,
 };
 
 static void realview_machine_init(void)
diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index 9f1bfcf..aeddd28 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -329,6 +329,10 @@  static QEMUMachine versatilepb_machine = {
     .desc = "ARM Versatile/PB (ARM926EJ-S)",
     .init = vpb_init,
     .use_scsi = 1,
+    /* Hardware allows for up to 512MB expansion memory in two
+     * non-contiguous sections, but we only support up to 256MB
+     */
+    .max_ram = 256 * 1024 * 1024,
 };
 
 static QEMUMachine versatileab_machine = {
@@ -336,6 +340,7 @@  static QEMUMachine versatileab_machine = {
     .desc = "ARM Versatile/AB (ARM926EJ-S)",
     .init = vab_init,
     .use_scsi = 1,
+    .max_ram = 256 * 1024 * 1024,
 };
 
 static void versatile_machine_init(void)