qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: "Cédric Le Goater" <clg@redhat.com>,
	"Jamin Lin" <jamin_lin@aspeedtech.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 09/12] aspeed: Create sd devices only when defaults are enabled
Date: Mon, 27 Jan 2025 10:42:36 +0100	[thread overview]
Message-ID: <20250127094239.636526-10-clg@redhat.com> (raw)
In-Reply-To: <20250127094239.636526-1-clg@redhat.com>

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>
---
 hw/arm/aspeed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 53a859a6e4aa..d9418e2b9f2c 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -456,14 +456,14 @@ static void aspeed_machine_init(MachineState *machine)
         amc->i2c_init(bmc);
     }
 
-    for (i = 0; i < bmc->soc->sdhci.num_slots; i++) {
+    for (i = 0; i < bmc->soc->sdhci.num_slots && defaults_enabled(); i++) {
         sdhci_attach_drive(&bmc->soc->sdhci.slots[i],
                            drive_get(IF_SD, 0, i), false, false);
     }
 
     boot_emmc = sc->boot_from_emmc(bmc->soc);
 
-    if (bmc->soc->emmc.num_slots) {
+    if (bmc->soc->emmc.num_slots && defaults_enabled()) {
         emmc0 = drive_get(IF_SD, 0, bmc->soc->sdhci.num_slots);
         sdhci_attach_drive(&bmc->soc->emmc.slots[0], emmc0, true, boot_emmc);
     }
-- 
2.48.1



  parent reply	other threads:[~2025-01-27  9:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-27  9:42 [PULL 00/12] aspeed queue Cédric Le Goater
2025-01-27  9:42 ` [PULL 01/12] hw/arm/aspeed: fix connect_serial_hds_to_uarts Cédric Le Goater
2025-01-27  9:42 ` [PULL 02/12] hw/sd/sdhci: Introduce a new Write Protected pin inverted property Cédric Le Goater
2025-01-27  9:42 ` [PULL 03/12] hw/arm/aspeed: Invert sdhci write protected pin for AST2600 EVB Cédric Le Goater
2025-01-27  9:42 ` [PULL 04/12] hw/timer/aspeed: Refactor Timer Callbacks for SoC-Specific Implementations Cédric Le Goater
2025-01-27  9:42 ` [PULL 05/12] hw/timer/aspeed: Add AST2700 Support Cédric Le Goater
2025-01-27  9:42 ` [PULL 06/12] aspeed/soc: Support Timer for AST2700 Cédric Le Goater
2025-01-27  9:42 ` [PULL 07/12] test/functional: Update the Aspeed aarch64 test Cédric Le Goater
2025-01-27  9:42 ` [PULL 08/12] test/functional: Update buildroot images to 2024.11 Cédric Le Goater
2025-01-27  9:42 ` Cédric Le Goater [this message]
2025-01-27  9:42 ` [PULL 10/12] aspeed/wdt: Fix coding style Cédric Le Goater
2025-01-27  9:42 ` [PULL 11/12] aspeed/wdt: Support software reset mode for AST2600 Cédric Le Goater
2025-01-27  9:42 ` [PULL 12/12] docs/system/arm/aspeed: Remove tacoma-bmc from the documentation Cédric Le Goater
2025-01-27 19:42 ` [PULL 00/12] aspeed queue Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250127094239.636526-10-clg@redhat.com \
    --to=clg@redhat.com \
    --cc=jamin_lin@aspeedtech.com \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).