qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-for-6.0?] hw/arm/imx25_pdk: Fix error message for invalid RAM size
@ 2021-04-07 22:56 Philippe Mathieu-Daudé
  2021-04-07 22:59 ` Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-07 22:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Igor Mammedov, qemu-arm,
	Philippe Mathieu-Daudé,
	Jean-Christophe Dubois

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

Fixes: bf350daae02 ("arm/imx25_pdk: drop RAM size fixup")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/arm/imx25_pdk.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c
index 1c201d0d8ed..51fde71b1bd 100644
--- a/hw/arm/imx25_pdk.c
+++ b/hw/arm/imx25_pdk.c
@@ -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);
     }
-- 
2.26.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH-for-6.0?] hw/arm/imx25_pdk: Fix error message for invalid RAM size
  2021-04-07 22:56 [PATCH-for-6.0?] hw/arm/imx25_pdk: Fix error message for invalid RAM size Philippe Mathieu-Daudé
@ 2021-04-07 22:59 ` Richard Henderson
  2021-04-08 19:56 ` Igor Mammedov
  2021-05-02 16:29 ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2021-04-07 22:59 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-arm, Jean-Christophe Dubois, Igor Mammedov

On 4/7/21 3:56 PM, Philippe Mathieu-Daudé wrote:
> 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
> 
> Fixes: bf350daae02 ("arm/imx25_pdk: drop RAM size fixup")
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   hw/arm/imx25_pdk.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH-for-6.0?] hw/arm/imx25_pdk: Fix error message for invalid RAM size
  2021-04-07 22:56 [PATCH-for-6.0?] hw/arm/imx25_pdk: Fix error message for invalid RAM size Philippe Mathieu-Daudé
  2021-04-07 22:59 ` Richard Henderson
@ 2021-04-08 19:56 ` Igor Mammedov
  2021-05-02 16:29 ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 5+ messages in thread
From: Igor Mammedov @ 2021-04-08 19:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, qemu-arm, qemu-devel, Jean-Christophe Dubois

On Thu,  8 Apr 2021 00:56:08 +0200
Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:

> 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
> 
> Fixes: bf350daae02 ("arm/imx25_pdk: drop RAM size fixup")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/arm/imx25_pdk.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c
> index 1c201d0d8ed..51fde71b1bd 100644
> --- a/hw/arm/imx25_pdk.c
> +++ b/hw/arm/imx25_pdk.c
> @@ -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);
>      }



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH-for-6.0?] hw/arm/imx25_pdk: Fix error message for invalid RAM size
  2021-04-07 22:56 [PATCH-for-6.0?] hw/arm/imx25_pdk: Fix error message for invalid RAM size Philippe Mathieu-Daudé
  2021-04-07 22:59 ` Richard Henderson
  2021-04-08 19:56 ` Igor Mammedov
@ 2021-05-02 16:29 ` Philippe Mathieu-Daudé
  2021-05-04 10:39   ` Peter Maydell
  2 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-05-02 16:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, qemu-arm, Jean-Christophe Dubois, Igor Mammedov

Hi Peter,

Could you take this patch via the ARM tree?
It has been reviewed twice.

Thanks,

Phil.

On 4/8/21 12:56 AM, Philippe Mathieu-Daudé wrote:
> 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
> 
> Fixes: bf350daae02 ("arm/imx25_pdk: drop RAM size fixup")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/arm/imx25_pdk.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c
> index 1c201d0d8ed..51fde71b1bd 100644
> --- a/hw/arm/imx25_pdk.c
> +++ b/hw/arm/imx25_pdk.c
> @@ -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);
>      }
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH-for-6.0?] hw/arm/imx25_pdk: Fix error message for invalid RAM size
  2021-05-02 16:29 ` Philippe Mathieu-Daudé
@ 2021-05-04 10:39   ` Peter Maydell
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2021-05-04 10:39 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Igor Mammedov, qemu-arm, QEMU Developers, Jean-Christophe Dubois

On Sun, 2 May 2021 at 17:29, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Hi Peter,
>
> Could you take this patch via the ARM tree?
> It has been reviewed twice.

Sure; applied to target-arm.next, thanks.

-- PMM


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-04 10:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07 22:56 [PATCH-for-6.0?] hw/arm/imx25_pdk: Fix error message for invalid RAM size Philippe Mathieu-Daudé
2021-04-07 22:59 ` Richard Henderson
2021-04-08 19:56 ` Igor Mammedov
2021-05-02 16:29 ` Philippe Mathieu-Daudé
2021-05-04 10:39   ` Peter Maydell

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).