[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
- [PATCH for-7.1 00/11] hw/arm: Add NPCM8XX support, Hao Wu, 2022/04/05
- [PATCH for-7.1 01/11] docs/system/arm: Add Description for NPCM8XX SoC, Hao Wu, 2022/04/05
- [PATCH for-7.1 06/11] hw/intc: Add a property to allow GIC to reset into non secure mode, Hao Wu, 2022/04/05
- [PATCH for-7.1 05/11] hw/misc: Store DRAM size in NPCM8XX GCR Module, Hao Wu, 2022/04/05
- [PATCH for-7.1 02/11] hw/ssi: Make flash size a property in NPCM7XX FIU, Hao Wu, 2022/04/05
- Re: [PATCH for-7.1 02/11] hw/ssi: Make flash size a property in NPCM7XX FIU,
Peter Maydell <=
- [PATCH for-7.1 08/11] hw/net: Add NPCM8XX PCS Module, Hao Wu, 2022/04/05
- [PATCH for-7.1 11/11] hw/arm: Add NPCM845 Evaluation board, Hao Wu, 2022/04/05
- [PATCH for-7.1 10/11] hw/arm: Add NPCM8XX SoC, Hao Wu, 2022/04/05
- [PATCH for-7.1 03/11] hw/misc: Support NPCM8XX GCR module, Hao Wu, 2022/04/05
- [PATCH for-7.1 07/11] hw/misc: Support 8-bytes memop in NPCM GCR module, Hao Wu, 2022/04/05
- [PATCH for-7.1 09/11] pc-bios: Add NPCM8xx Bootrom, Hao Wu, 2022/04/05