Skip to contentSkip to conversation

z2: Make providing flash images non-mandatory

PATCH Applied Guenter Roeck 3 participants 3 messages Feb 17, 2020 – Feb 18, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 z2: Make providing flash images non-mandatory

Up to now, the z2 machine only boots if a flash image is provided. This is not really necessary; the machine can boot from initrd or from SD without it. At the same time, having to provide dummy flash images is a nuisance and does not add any real value. Make it optional.

---
 hw/arm/z2.c | 6 ------
 1 file changed, 6 deletions(-)
hw/arm/z2.c +0 -6
index 34794fe3ae..4bb237f22d 100644
@@ -314,12 +314,6 @@ static void z2_init(MachineState *machine)
     be = 0;
 #endif
     dinfo = drive_get(IF_PFLASH, 0, 0);
-    if (!dinfo && !qtest_enabled()) {
-        error_report("Flash image must be given with the "
-                     "'pflash' parameter");
-        exit(1);
-    }
-
     if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE,
                                dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
                                sector_len, 4, 0, 0, 0, 0, be)) {
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Guenter Roeck

Up to now, the z2 machine only boots if a flash image is provided. This is not really necessary; the machine can boot from initrd or from SD without it. At the same time, having to provide dummy flash images is a nuisance and does not add any real value. Make it optional.

---
  hw/arm/z2.c | 6 ------
  1 file changed, 6 deletions(-)
hw/arm/z2.c +0 -0
index 34794fe3ae..4bb237f22d 100644
@@ -314,12 +314,6 @@ static void z2_init(MachineState *machine)
      be = 0;
  #endif

hw/arm/z2.c static void z2_init(MachineState *machine) · line 319

Quoted 10 lines
hw/arm/z2.c +0 -6
      dinfo = drive_get(IF_PFLASH, 0, 0);
-    if (!dinfo && !qtest_enabled()) {
-        error_report("Flash image must be given with the "
-                     "'pflash' parameter");
-        exit(1);
-    }
-
      if (!pflash_cfi01_register(Z2_FLASH_BASE, "z2.flash0", Z2_FLASH_SIZE,
                                 dinfo ? blk_by_legacy_dinfo(dinfo) : NULL,
                                 sector_len, 4, 0, 0, 0, 0, be)) {
#2 lore raw
In reply to Guenter Roeck
Quoted 10 lines · Guenter Roeck

Up to now, the z2 machine only boots if a flash image is provided. This is not really necessary; the machine can boot from initrd or from SD without it. At the same time, having to provide dummy flash images is a nuisance and does not add any real value. Make it optional.

---
 hw/arm/z2.c | 6 ------
 1 file changed, 6 deletions(-)

Applied to target-arm.next, thanks.

-- PMM