diff mbox series

[3/5] hw/mips/malta: Add the FLASH_SECTOR_SIZE definition

Message ID 20230109120154.2868-4-philmd@linaro.org
State New
Headers show
Series hw: Cleanups around PFLASH use | expand

Commit Message

Philippe Mathieu-Daudé Jan. 9, 2023, 12:01 p.m. UTC
Ease code review by using the IEC binary prefix definition
for the FLASH_SIZE.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/mips/malta.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index c0a2e0ab04..e645ba1322 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -69,7 +69,8 @@ 
 #define FPGA_ADDRESS        0x1f000000ULL
 #define RESET_ADDRESS       0x1fc00000ULL
 
-#define FLASH_SIZE          0x400000
+#define FLASH_SIZE          (4 * MiB)
+#define FLASH_SECTOR_SIZE   (64 * KiB)
 
 typedef struct {
     MemoryRegion iomem;
@@ -1289,7 +1290,7 @@  void mips_malta_init(MachineState *machine)
     fl = pflash_cfi01_register(FLASH_ADDRESS, "mips_malta.bios",
                                FLASH_SIZE,
                                dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
-                               65536,
+                               FLASH_SECTOR_SIZE,
                                4, 0x0000, 0x0000, 0x0000, 0x0000, be);
     bios = pflash_cfi01_get_memory(fl);
     fl_idx++;