hw/arm/imx25_pdk: Fix error message for invalid RAM size
The i.MX25 PDK board has 2 banks for SDRAM, each can address up to 256 MiB. So the total RAM usable for this board is 512M. When we ask for more we get a misleading error message:
$ qemu-system-arm -M imx25-pdk -m 513M qemu-system-arm: Invalid RAM size, should be 128 MiB
Update the error message to better match the reality:
$ qemu-system-arm -M imx25-pdk -m 513M qemu-system-arm: RAM size more than 512 MiB is not supported
--- hw/arm/imx25_pdk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
hw/arm/imx25_pdk.c +2 -3
@@ -67,7 +67,6 @@ static struct arm_boot_info imx25_pdk_binfo;static void imx25_pdk_init (MachineState *machine) { -MachineClass *mc =MACHINE_GET_CLASS (machine);IMX25PDK *s =g_new0 (IMX25PDK ,1 );unsigned int ram_size;unsigned int alias_offset;
@@ -79,8 +78,8 @@ static void imx25_pdk_init(MachineState *machine)/* We need to initialize our memory */ if (machine->ram_size > (FSL_IMX25_SDRAM0_SIZE +FSL_IMX25_SDRAM1_SIZE )) { -char *sz =size_to_str (mc->default_ram_size); -error_report ("Invalid RAM size, should be %s" , sz); +char *sz =size_to_str (FSL_IMX25_SDRAM0_SIZE +FSL_IMX25_SDRAM1_SIZE ); +error_report ("RAM size more than %s is not supported" , sz);g_free (sz);exit (EXIT_FAILURE ); }
Signature · 1 line
2.26.3
Richard Henderson
Reviewed-byQuoted 10 lines · Philippe Mathieu-Daudé
The i.MX25 PDK board has 2 banks for SDRAM, each can address up to 256 MiB. So the total RAM usable for this board is 512M. When we ask for more we get a misleading error message:
$ qemu-system-arm -M imx25-pdk -m 513M qemu-system-arm: Invalid RAM size, should be 128 MiBUpdate the error message to better match the reality:
Quoted 8 lines
$ qemu-system-arm -M imx25-pdk -m 513M qemu-system-arm: RAM size more than 512 MiB is not supportedFixes bf350daae02 ("arm/imx25_pdk: drop RAM size fixup")Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- hw/arm/imx25_pdk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
r~
Igor Mammedov
Reviewed-byQuoted 8 lines · On Thu, 8 Apr 2021 00:56:08 +0200 Philippe Mathieu-Daudé <[email protected]>…
The i.MX25 PDK board has 2 banks for SDRAM, each can address up to 256 MiB. So the total RAM usable for this board is 512M. When we ask for more we get a misleading error message:
$ qemu-system-arm -M imx25-pdk -m 513M qemu-system-arm: Invalid RAM size, should be 128 MiB
Quoted 7 lines
Update the error message to better match the reality:
$ qemu-system-arm -M imx25-pdk -m 513M qemu-system-arm: RAM size more than 512 MiB is not supportedFixes bf350daae02 ("arm/imx25_pdk: drop RAM size fixup")Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 27 lines
--- hw/arm/imx25_pdk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)hw/arm/imx25_pdk.c +2
-3@@ -67,7 +67,6 @@ static struct arm_boot_info imx25_pdk_binfo;static void imx25_pdk_init (MachineState *machine) { -MachineClass *mc =MACHINE_GET_CLASS (machine);IMX25PDK *s =g_new0 (IMX25PDK ,1 );unsigned int ram_size;unsigned int alias_offset;@@ -79,8 +78,8 @@ static void imx25_pdk_init(MachineState *machine)/* We need to initialize our memory */ if (machine->ram_size > (FSL_IMX25_SDRAM0_SIZE +FSL_IMX25_SDRAM1_SIZE )) { -char *sz =size_to_str (mc->default_ram_size); -error_report ("Invalid RAM size, should be %s" , sz); +char *sz =size_to_str (FSL_IMX25_SDRAM0_SIZE +FSL_IMX25_SDRAM1_SIZE ); +error_report ("RAM size more than %s is not supported" , sz);g_free (sz);exit (EXIT_FAILURE ); }
Hi Peter,
Could you take this patch via the ARM tree?
It has been reviewed twice.
Thanks,
Phil.
Quoted 43 lines · Philippe Mathieu-Daudé
The i.MX25 PDK board has 2 banks for SDRAM, each can address up to 256 MiB. So the total RAM usable for this board is 512M. When we ask for more we get a misleading error message:
$ qemu-system-arm -M imx25-pdk -m 513M qemu-system-arm: Invalid RAM size, should be 128 MiBUpdate the error message to better match the reality:
$ qemu-system-arm -M imx25-pdk -m 513M qemu-system-arm: RAM size more than 512 MiB is not supportedFixes bf350daae02 ("arm/imx25_pdk: drop RAM size fixup")Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/arm/imx25_pdk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)hw/arm/imx25_pdk.c +2
-3@@ -67,7 +67,6 @@ static struct arm_boot_info imx25_pdk_binfo;static void imx25_pdk_init (MachineState *machine) { -MachineClass *mc =MACHINE_GET_CLASS (machine);IMX25PDK *s =g_new0 (IMX25PDK ,1 );unsigned int ram_size;unsigned int alias_offset;@@ -79,8 +78,8 @@ static void imx25_pdk_init(MachineState *machine)/* We need to initialize our memory */ if (machine->ram_size > (FSL_IMX25_SDRAM0_SIZE +FSL_IMX25_SDRAM1_SIZE )) { -char *sz =size_to_str (mc->default_ram_size); -error_report ("Invalid RAM size, should be %s" , sz); +char *sz =size_to_str (FSL_IMX25_SDRAM0_SIZE +FSL_IMX25_SDRAM1_SIZE ); +error_report ("RAM size more than %s is not supported" , sz);g_free (sz);exit (EXIT_FAILURE ); }
Quoted 5 lines · Philippe Mathieu-Daudé
Hi Peter,
Could you take this patch via the ARM tree?
It has been reviewed twice.
Sure; applied to target-arm.next, thanks.
-- PMM