[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/13] hw/arm/z2: Use the IEC binary prefix definitions
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 11/13] hw/arm/z2: Use the IEC binary prefix definitions |
Date: |
Mon, 9 Jan 2023 12:53:14 +0100 |
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>
---
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 8eb6f495bc..839be3ca16 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.38.1
- [PATCH 01/13] hw/arm/pxa2xx: Simplify pxa255_init(), (continued)
- [PATCH 01/13] hw/arm/pxa2xx: Simplify pxa255_init(), Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 02/13] hw/arm/pxa2xx: Simplify pxa270_init(), Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 03/13] hw/arm/collie: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 04/13] hw/arm/collie: Simplify flash creation using for() loop, Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 06/13] hw/arm/gumstix: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 05/13] hw/arm/gumstix: Improve documentation, Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 07/13] hw/arm/mainstone: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 08/13] hw/arm/musicpal: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 09/13] hw/arm/omap_sx1: Remove unused 'total_ram' definitions, Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 10/13] hw/arm/omap_sx1: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 11/13] hw/arm/z2: Use the IEC binary prefix definitions,
Philippe Mathieu-Daudé <=
- [PATCH 12/13] hw/arm/vexpress: Remove dead code in vexpress_common_init(), Philippe Mathieu-Daudé, 2023/01/09
- [PATCH 13/13] hw/arm: Remove unreachable code calling pflash_cfi01_register(), Philippe Mathieu-Daudé, 2023/01/09
- Re: [PATCH 00/13] hw/arm: Cleanups before pflash refactor, Richard Henderson, 2023/01/09
- Re: [PATCH 00/13] hw/arm: Cleanups before pflash refactor, Peter Maydell, 2023/01/12