|
@@ -338,10 +338,20 @@ static void sdhci_attach_drive(SDHCIState *sdhci, DriveInfo *dinfo, bool emmc,
|
|
|
return;
|
|
|
}
|
|
|
card = qdev_new(emmc ? TYPE_EMMC : TYPE_SD_CARD);
|
|
|
- if (emmc) {
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Force the boot properties of the eMMC device only when the
|
|
|
+ * machine is strapped to boot from eMMC. Without these
|
|
|
+ * settings, the machine would not boot.
|
|
|
+ *
|
|
|
+ * This also allows the machine to use an eMMC device without
|
|
|
+ * boot areas when booting from the flash device (or -kernel)
|
|
|
+ * Ideally, the device and its properties should be defined on
|
|
|
+ * the command line.
|
|
|
+ */
|
|
|
+ if (emmc && boot_emmc) {
|
|
|
qdev_prop_set_uint64(card, "boot-partition-size", 1 * MiB);
|
|
|
- qdev_prop_set_uint8(card, "boot-config",
|
|
|
- boot_emmc ? 0x1 << 3 : 0x0);
|
|
|
+ qdev_prop_set_uint8(card, "boot-config", 0x1 << 3);
|
|
|
}
|
|
|
qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo),
|
|
|
&error_fatal);
|