[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/38] hw/arm/z2: Use the IEC binary prefix definitions
From: |
Peter Maydell |
Subject: |
[PULL 21/38] hw/arm/z2: Use the IEC binary prefix definitions |
Date: |
Fri, 13 Jan 2023 14:11:09 +0000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
IEC binary prefixes ease code review: the unit is explicit.
Add the FLASH_SECTOR_SIZE definition.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230109115316.2235-12-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/z2.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index 8eb6f495bc9..839be3ca169 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -12,6 +12,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/units.h"
#include "hw/arm/pxa.h"
#include "hw/arm/boot.h"
#include "hw/i2c/i2c.h"
@@ -297,9 +298,10 @@ static const TypeInfo aer915_info = {
.class_init = aer915_class_init,
};
+#define FLASH_SECTOR_SIZE (64 * KiB)
+
static void z2_init(MachineState *machine)
{
- uint32_t sector_len = 0x10000;
PXA2xxState *mpu;
DriveInfo *dinfo;
void *z2_lcd;
@@ -312,7 +314,7 @@ static void z2_init(MachineState *machine)
dinfo = drive_get(IF_PFLASH, 0, 0);
if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE,
dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
- sector_len, 4, 0, 0, 0, 0, 0)) {
+ FLASH_SECTOR_SIZE, 4, 0, 0, 0, 0, 0)) {
error_report("Error registering flash memory");
exit(1);
}
--
2.34.1
- [PULL 02/38] hw/arm: Add Olimex H405, (continued)
- [PULL 02/38] hw/arm: Add Olimex H405, Peter Maydell, 2023/01/13
- [PULL 01/38] hw/arm/stm32f405: correctly describe the memory layout, Peter Maydell, 2023/01/13
- [PULL 05/38] {hw/i2c,docs/system/arm}: Allwinner TWI/I2C Emulation, Peter Maydell, 2023/01/13
- [PULL 07/38] hw/arm: Add AXP209 to Cubieboard, Peter Maydell, 2023/01/13
- [PULL 10/38] target/arm: Fix sve_probe_page, Peter Maydell, 2023/01/13
- [PULL 11/38] hw/arm/pxa2xx: Simplify pxa255_init(), Peter Maydell, 2023/01/13
- [PULL 04/38] hw/misc: Allwinner A10 DRAM Controller Emulation, Peter Maydell, 2023/01/13
- [PULL 03/38] hw/misc: Allwinner-A10 Clock Controller Module Emulation, Peter Maydell, 2023/01/13
- [PULL 09/38] tests/avocado: Add SD boot test to Cubieboard, Peter Maydell, 2023/01/13
- [PULL 15/38] hw/arm/gumstix: Improve documentation, Peter Maydell, 2023/01/13
- [PULL 21/38] hw/arm/z2: Use the IEC binary prefix definitions,
Peter Maydell <=
- [PULL 06/38] hw/misc: AXP209 PMU Emulation, Peter Maydell, 2023/01/13
- [PULL 08/38] hw/arm: Allwinner A10 enable SPL load from MMC, Peter Maydell, 2023/01/13
- [PULL 13/38] hw/arm/collie: Use the IEC binary prefix definitions, Peter Maydell, 2023/01/13
- [PULL 23/38] hw/arm: Remove unreachable code calling pflash_cfi01_register(), Peter Maydell, 2023/01/13
- [PULL 18/38] hw/arm/musicpal: Use the IEC binary prefix definitions, Peter Maydell, 2023/01/13
- [PULL 30/38] hw/arm/stellaris: Drop useless casts from void * to pointer, Peter Maydell, 2023/01/13
- [PULL 16/38] hw/arm/gumstix: Use the IEC binary prefix definitions, Peter Maydell, 2023/01/13
- [PULL 28/38] hw/gpio/omap_gpio: Use CamelCase for TYPE_OMAP2_GPIO type name, Peter Maydell, 2023/01/13
- [PULL 20/38] hw/arm/omap_sx1: Use the IEC binary prefix definitions, Peter Maydell, 2023/01/13
- [PULL 19/38] hw/arm/omap_sx1: Remove unused 'total_ram' definitions, Peter Maydell, 2023/01/13