Skip to content

Commit e908584

Browse files
committed
aspeed: Create sd devices only when defaults are enabled
When the -nodefaults option is set, sd devices should not be automatically created by the machine. Instead they should be defined on the command line. Note that it is not currently possible to define which bus an "sd-card" device is attached to: -blockdev node-name=drive0,driver=file,filename=/path/to/file.img \ -device sd-card,drive=drive0,id=sd0 and the first bus named "sd-bus" will be used. Reviewed-by: Jamin Lin <jamin_lin@aspeedtech.com> Acked-by: Philippe Mathieu-Daudé <philmd@linaro.org> Link: https://lore.kernel.org/qemu-devel/20250122070909.1138598-10-clg@redhat.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
1 parent f7ae961 commit e908584

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hw/arm/aspeed.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,14 @@ static void aspeed_machine_init(MachineState *machine)
456456
amc->i2c_init(bmc);
457457
}
458458

459-
for (i = 0; i < bmc->soc->sdhci.num_slots; i++) {
459+
for (i = 0; i < bmc->soc->sdhci.num_slots && defaults_enabled(); i++) {
460460
sdhci_attach_drive(&bmc->soc->sdhci.slots[i],
461461
drive_get(IF_SD, 0, i), false, false);
462462
}
463463

464464
boot_emmc = sc->boot_from_emmc(bmc->soc);
465465

466-
if (bmc->soc->emmc.num_slots) {
466+
if (bmc->soc->emmc.num_slots && defaults_enabled()) {
467467
emmc0 = drive_get(IF_SD, 0, bmc->soc->sdhci.num_slots);
468468
sdhci_attach_drive(&bmc->soc->emmc.slots[0], emmc0, true, boot_emmc);
469469
}

0 commit comments

Comments
 (0)