[PATCH v2 1/4] sam460ex: Suppress useless warning on -m 32 and -m 64

Markus Armbruster posted 4 patches 5 years, 9 months ago
Maintainers: David Gibson <david@gibson.dropbear.id.au>, Corey Minyard <cminyard@mvista.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, BALATON Zoltan <balaton@eik.bme.hu>, Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>, Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
[PATCH v2 1/4] sam460ex: Suppress useless warning on -m 32 and -m 64
Posted by Markus Armbruster 5 years, 9 months ago
Requesting 32 or 64 MiB of RAM with the sam460ex machine type produces
a useless warning:

    qemu-system-ppc: warning: Memory size is too small for SDRAM type, adjusting type

This is because sam460ex_init() asks spd_data_generate() for DDR2,
which is impossible, so spd_data_generate() corrects it to DDR.

The warning goes back to commit 08fd99179a "sam460ex: Clean up SPD
EEPROM creation".

Make sam460ex_init() pass the correct SDRAM type to get rid of the
warning.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/ppc/sam460ex.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 898453cf30..1e3eaac0db 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -335,7 +335,8 @@ static void sam460ex_init(MachineState *machine)
     dev = sysbus_create_simple(TYPE_PPC4xx_I2C, 0x4ef600700, uic[0][2]);
     i2c = PPC4xx_I2C(dev)->bus;
     /* SPD EEPROM on RAM module */
-    spd_data = spd_data_generate(DDR2, ram_sizes[0], &err);
+    spd_data = spd_data_generate(ram_sizes[0] < 128 * MiB ? DDR : DDR2,
+                                 ram_sizes[0], &err);
     if (err) {
         warn_report_err(err);
     }
-- 
2.21.1


Re: [PATCH v2 1/4] sam460ex: Suppress useless warning on -m 32 and -m 64
Posted by Philippe Mathieu-Daudé 5 years, 9 months ago
On 4/22/20 3:48 PM, Markus Armbruster wrote:
> Requesting 32 or 64 MiB of RAM with the sam460ex machine type produces
> a useless warning:
> 
>      qemu-system-ppc: warning: Memory size is too small for SDRAM type, adjusting type
> 
> This is because sam460ex_init() asks spd_data_generate() for DDR2,
> which is impossible, so spd_data_generate() corrects it to DDR.
> 
> The warning goes back to commit 08fd99179a "sam460ex: Clean up SPD
> EEPROM creation".
> 
> Make sam460ex_init() pass the correct SDRAM type to get rid of the
> warning.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   hw/ppc/sam460ex.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
> index 898453cf30..1e3eaac0db 100644
> --- a/hw/ppc/sam460ex.c
> +++ b/hw/ppc/sam460ex.c
> @@ -335,7 +335,8 @@ static void sam460ex_init(MachineState *machine)
>       dev = sysbus_create_simple(TYPE_PPC4xx_I2C, 0x4ef600700, uic[0][2]);
>       i2c = PPC4xx_I2C(dev)->bus;
>       /* SPD EEPROM on RAM module */
> -    spd_data = spd_data_generate(DDR2, ram_sizes[0], &err);
> +    spd_data = spd_data_generate(ram_sizes[0] < 128 * MiB ? DDR : DDR2,
> +                                 ram_sizes[0], &err);

Previous to this patch question, don't we need one for each module? We 
have 4 banks... Ah, there is a comment earlier "/* put all RAM on first 
bank because board has one slot". OK...

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>       if (err) {
>           warn_report_err(err);
>       }
>