qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-7.1 02/11] hw/ssi: Make flash size a property in NPCM7XX


From: Peter Maydell
Subject: Re: [PATCH for-7.1 02/11] hw/ssi: Make flash size a property in NPCM7XX FIU
Date: Thu, 21 Apr 2022 11:48:06 +0100

On Tue, 5 Apr 2022 at 23:38, Hao Wu <wuhaotsh@google.com> wrote:
>
> This allows different FIUs to have different flash sizes, useful
> in NPCM8XX which has multiple different sized FIU modules.
>
> Signed-off-by: Hao Wu <wuhaotsh@google.com>
> Reviewed-by: Patrick Venture <venture@google.com>
> ---
>  hw/arm/npcm7xx.c             | 6 ++++++
>  hw/ssi/npcm7xx_fiu.c         | 6 ++----
>  include/hw/ssi/npcm7xx_fiu.h | 1 +
>  3 files changed, 9 insertions(+), 4 deletions(-)

> @@ -525,7 +522,7 @@ static void npcm7xx_fiu_realize(DeviceState *dev, Error 
> **errp)
>          flash->fiu = s;
>          memory_region_init_io(&flash->direct_access, OBJECT(s),
>                                &npcm7xx_fiu_flash_ops, &s->flash[i], "flash",
> -                              NPCM7XX_FIU_FLASH_WINDOW_SIZE);
> +                              s->flash_size);
>          sysbus_init_mmio(sbd, &flash->direct_access);

Creating a zero-sized memory region if the user forgets to set
the flash-size property is going to be a bit confusing, so I think
it would be better to have at least a basic sanity check of the
property in realize.

Otherwise looks good.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]