[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/38] hw/arm/collie: Simplify flash creation using for() loop
From: |
Peter Maydell |
Subject: |
[PULL 14/38] hw/arm/collie: Simplify flash creation using for() loop |
Date: |
Fri, 13 Jan 2023 14:11:02 +0000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230109115316.2235-5-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/collie.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/hw/arm/collie.c b/hw/arm/collie.c
index d59c376e601..9edff593708 100644
--- a/hw/arm/collie.c
+++ b/hw/arm/collie.c
@@ -40,7 +40,6 @@ static struct arm_boot_info collie_binfo = {
static void collie_init(MachineState *machine)
{
- DriveInfo *dinfo;
MachineClass *mc = MACHINE_GET_CLASS(machine);
CollieMachineState *cms = COLLIE_MACHINE(machine);
@@ -55,15 +54,13 @@ 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", FLASH_SIZE,
- dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
- FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0);
-
- dinfo = drive_get(IF_PFLASH, 0, 1);
- pflash_cfi01_register(SA_CS1, "collie.fl2", FLASH_SIZE,
- dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
- FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0);
+ for (unsigned i = 0; i < 2; i++) {
+ DriveInfo *dinfo = drive_get(IF_PFLASH, 0, i);
+ pflash_cfi01_register(i ? SA_CS1 : SA_CS0,
+ i ? "collie.fl2" : "collie.fl1", FLASH_SIZE,
+ dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
+ FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0);
+ }
sysbus_create_simple("scoop", 0x40800000, NULL);
--
2.34.1
- [PULL 20/38] hw/arm/omap_sx1: Use the IEC binary prefix definitions, (continued)
- [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
- [PULL 25/38] hw/gpio/omap_gpio: Add local variable to avoid embedded cast, Peter Maydell, 2023/01/13
- [PULL 32/38] hw/arm/bcm2836: Remove definitions generated by OBJECT_DECLARE_TYPE(), Peter Maydell, 2023/01/13
- [PULL 12/38] hw/arm/pxa2xx: Simplify pxa270_init(), Peter Maydell, 2023/01/13
- [PULL 14/38] hw/arm/collie: Simplify flash creation using for() loop,
Peter Maydell <=
- [PULL 24/38] hw/arm/pxa: Avoid forward-declaring PXA2xxI2CState, Peter Maydell, 2023/01/13
- [PULL 17/38] hw/arm/mainstone: Use the IEC binary prefix definitions, Peter Maydell, 2023/01/13
- [PULL 22/38] hw/arm/vexpress: Remove dead code in vexpress_common_init(), Peter Maydell, 2023/01/13
- [PULL 38/38] target/arm: allow writes to SCR_EL3.HXEn bit when FEAT_HCX is enabled, Peter Maydell, 2023/01/13
- [PULL 26/38] hw/arm/omap: Drop useless casts from void * to pointer, Peter Maydell, 2023/01/13
- [PULL 33/38] hw/arm/npcm7xx: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE(), Peter Maydell, 2023/01/13
- [PULL 34/38] hw/misc/sbsa_ec: Rename TYPE_SBSA_EC -> TYPE_SBSA_SECURE_EC, Peter Maydell, 2023/01/13
- [PULL 36/38] hw/intc/xilinx_intc: Use 'XpsIntc' typedef instead of 'struct xlx_pic', Peter Maydell, 2023/01/13
- Re: [PULL 00/38] target-arm queue, Peter Maydell, 2023/01/13