hw/arm/z2: Use the IEC binary prefix definitions
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>
This commit is contained in:
parent
d7f1bd196e
commit
96c85ef86b
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
#include "qemu/units.h"
|
||||||
#include "hw/arm/pxa.h"
|
#include "hw/arm/pxa.h"
|
||||||
#include "hw/arm/boot.h"
|
#include "hw/arm/boot.h"
|
||||||
#include "hw/i2c/i2c.h"
|
#include "hw/i2c/i2c.h"
|
||||||
@ -297,9 +298,10 @@ static const TypeInfo aer915_info = {
|
|||||||
.class_init = aer915_class_init,
|
.class_init = aer915_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define FLASH_SECTOR_SIZE (64 * KiB)
|
||||||
|
|
||||||
static void z2_init(MachineState *machine)
|
static void z2_init(MachineState *machine)
|
||||||
{
|
{
|
||||||
uint32_t sector_len = 0x10000;
|
|
||||||
PXA2xxState *mpu;
|
PXA2xxState *mpu;
|
||||||
DriveInfo *dinfo;
|
DriveInfo *dinfo;
|
||||||
void *z2_lcd;
|
void *z2_lcd;
|
||||||
@ -312,7 +314,7 @@ static void z2_init(MachineState *machine)
|
|||||||
dinfo = drive_get(IF_PFLASH, 0, 0);
|
dinfo = drive_get(IF_PFLASH, 0, 0);
|
||||||
if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE,
|
if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE,
|
||||||
dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
|
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");
|
error_report("Error registering flash memory");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user