mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
hw/arm/collie: Simplify flash creation using for() loop
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>
This commit is contained in:
parent
50f9b33b1d
commit
ec177b7300
1 changed files with 7 additions and 10 deletions
|
@ -40,7 +40,6 @@ static struct arm_boot_info collie_binfo = {
|
||||||
|
|
||||||
static void collie_init(MachineState *machine)
|
static void collie_init(MachineState *machine)
|
||||||
{
|
{
|
||||||
DriveInfo *dinfo;
|
|
||||||
MachineClass *mc = MACHINE_GET_CLASS(machine);
|
MachineClass *mc = MACHINE_GET_CLASS(machine);
|
||||||
CollieMachineState *cms = COLLIE_MACHINE(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);
|
memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ram);
|
||||||
|
|
||||||
dinfo = drive_get(IF_PFLASH, 0, 0);
|
for (unsigned i = 0; i < 2; i++) {
|
||||||
pflash_cfi01_register(SA_CS0, "collie.fl1", FLASH_SIZE,
|
DriveInfo *dinfo = drive_get(IF_PFLASH, 0, i);
|
||||||
dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
|
pflash_cfi01_register(i ? SA_CS1 : SA_CS0,
|
||||||
FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0);
|
i ? "collie.fl2" : "collie.fl1", FLASH_SIZE,
|
||||||
|
dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
|
||||||
dinfo = drive_get(IF_PFLASH, 0, 1);
|
FLASH_SECTOR_SIZE, 4, 0x00, 0x00, 0x00, 0x00, 0);
|
||||||
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);
|
|
||||||
|
|
||||||
sysbus_create_simple("scoop", 0x40800000, NULL);
|
sysbus_create_simple("scoop", 0x40800000, NULL);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue