[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/38] hw/arm/musicpal: Use the IEC binary prefix definitions
From: |
Peter Maydell |
Subject: |
[PULL 18/38] hw/arm/musicpal: Use the IEC binary prefix definitions |
Date: |
Fri, 13 Jan 2023 14:11:06 +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-9-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/musicpal.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index b65c020115a..73e2b7e4cef 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -10,6 +10,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/units.h"
#include "qapi/error.h"
#include "cpu.h"
#include "hw/sysbus.h"
@@ -1196,6 +1197,8 @@ static const TypeInfo musicpal_key_info = {
.class_init = musicpal_key_class_init,
};
+#define FLASH_SECTOR_SIZE (64 * KiB)
+
static struct arm_boot_info musicpal_binfo = {
.loader_start = 0x0,
.board_id = 0x20e,
@@ -1264,8 +1267,8 @@ static void musicpal_init(MachineState *machine)
BlockBackend *blk = blk_by_legacy_dinfo(dinfo);
flash_size = blk_getlength(blk);
- if (flash_size != 8*1024*1024 && flash_size != 16*1024*1024 &&
- flash_size != 32*1024*1024) {
+ if (flash_size != 8 * MiB && flash_size != 16 * MiB &&
+ flash_size != 32 * MiB) {
error_report("Invalid flash image size");
exit(1);
}
@@ -1277,7 +1280,7 @@ static void musicpal_init(MachineState *machine)
*/
pflash_cfi02_register(0x100000000ULL - MP_FLASH_SIZE_MAX,
"musicpal.flash", flash_size,
- blk, 0x10000,
+ blk, FLASH_SECTOR_SIZE,
MP_FLASH_SIZE_MAX / flash_size,
2, 0x00BF, 0x236D, 0x0000, 0x0000,
0x5555, 0x2AAA, 0);
--
2.34.1
- [PULL 11/38] hw/arm/pxa2xx: Simplify pxa255_init(), (continued)
- [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, 2023/01/13
- [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 <=
- [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
- [PULL 27/38] hw/gpio/omap_gpio: Use CamelCase for TYPE_OMAP1_GPIO type name, Peter Maydell, 2023/01/13
- [PULL 37/38] hw/timer/xilinx_timer: Use XpsTimerState instead of 'struct timerblock', Peter Maydell, 2023/01/13
- [PULL 35/38] hw/misc/sbsa_ec: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE(), Peter Maydell, 2023/01/13
- [PULL 31/38] hw/arm/stellaris: Use CamelCase for STELLARIS_ADC type name, Peter Maydell, 2023/01/13
- [PULL 29/38] hw/intc/omap_intc: Use CamelCase for TYPE_OMAP_INTC type name, Peter Maydell, 2023/01/13