[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/38] hw/arm/collie: Use the IEC binary prefix definitions
From: |
Peter Maydell |
Subject: |
[PULL 13/38] hw/arm/collie: Use the IEC binary prefix definitions |
Date: |
Fri, 13 Jan 2023 14:11:01 +0000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
IEC binary prefixes ease code review: the unit is explicit.
Add definitions for RAM / Flash / Flash blocksize.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230109115316.2235-4-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/collie.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/hw/arm/collie.c b/hw/arm/collie.c
index 8df31e27932..d59c376e601 100644
--- a/hw/arm/collie.c
+++ b/hw/arm/collie.c
@@ -20,6 +20,10 @@
#include "cpu.h"
#include "qom/object.h"
+#define RAM_SIZE (512 * MiB)
+#define FLASH_SIZE (32 * MiB)
+#define FLASH_SECTOR_SIZE (64 * KiB)
+
struct CollieMachineState {
MachineState parent;
@@ -31,7 +35,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(CollieMachineState, COLLIE_MACHINE)
static struct arm_boot_info collie_binfo = {
.loader_start = SA_SDCS0,
- .ram_size = 0x20000000,
+ .ram_size = RAM_SIZE,
};
static void collie_init(MachineState *machine)
@@ -52,14 +56,14 @@ static void collie_init(MachineState *machine)
memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ram);
dinfo = drive_get(IF_PFLASH, 0, 0);
- pflash_cfi01_register(SA_CS0, "collie.fl1", 0x02000000,
+ pflash_cfi01_register(SA_CS0, "collie.fl1", FLASH_SIZE,
dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
- 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0);
+ FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0);
dinfo = drive_get(IF_PFLASH, 0, 1);
- pflash_cfi01_register(SA_CS1, "collie.fl2", 0x02000000,
+ pflash_cfi01_register(SA_CS1, "collie.fl2", FLASH_SIZE,
dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
- 64 * KiB, 4, 0x00, 0x00, 0x00, 0x00, 0);
+ FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0);
sysbus_create_simple("scoop", 0x40800000, NULL);
@@ -75,7 +79,7 @@ static void collie_machine_class_init(ObjectClass *oc, void
*data)
mc->init = collie_init;
mc->ignore_memory_transaction_failures = true;
mc->default_cpu_type = ARM_CPU_TYPE_NAME("sa1110");
- mc->default_ram_size = 0x20000000;
+ mc->default_ram_size = RAM_SIZE;
mc->default_ram_id = "strongarm.sdram";
}
--
2.34.1
- [PULL 07/38] hw/arm: Add AXP209 to Cubieboard, (continued)
- [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, 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 <=
- [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
- [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