qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Luebbe <jlu@pengutronix.de>
To: qemu-devel@nongnu.org
Cc: "Jan Luebbe" <jlu@pengutronix.de>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Bin Meng" <bmeng.cn@gmail.com>,
	qemu-block@nongnu.org
Subject: [PATCH] hw/sd/sdcard: Allow user creation of eMMCs
Date: Tue, 15 Oct 2024 15:56:49 +0200	[thread overview]
Message-ID: <20241015135649.4189256-1-jlu@pengutronix.de> (raw)

For testing eMMC-specific functionality (such as handling boot
partitions), it would be very useful to attach them to generic VMs such
as x86_64 via the sdhci-pci device:
 ...
 -drive if=none,id=emmc-drive,file=emmc.img,format=raw \
 -device sdhci-pci \
 -device emmc,id=emmc0,drive=emmc-drive,boot-partition-size=1048576 \
 ...

While most eMMCs are soldered to boards, they can also be connected to
SD controllers with just a passive adapter, such as:
 https://docs.radxa.com/en/accessories/emmc-to-usd
 https://github.com/voltlog/emmc-wfbga153-microsd

The only change necessary to make the options above work is to avoid
disabling user_creatable, so do that. The SDHCI-PCI driver in the Linux
kernel already supports this just fine.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
 hw/sd/sd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index a5d2d929a8af..2d3467c3d956 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -2865,8 +2865,6 @@ static void emmc_class_init(ObjectClass *klass, void *data)
     dc->desc = "eMMC";
     dc->realize = emmc_realize;
     device_class_set_props(dc, emmc_properties);
-    /* Reason: Soldered on board */
-    dc->user_creatable = false;
 
     sc->proto = &sd_proto_emmc;
 
-- 
2.39.5



             reply	other threads:[~2024-10-15 13:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15 13:56 Jan Luebbe [this message]
2024-10-15 15:00 ` [PATCH] hw/sd/sdcard: Allow user creation of eMMCs Philippe Mathieu-Daudé
2024-10-15 15:17   ` Cédric Le Goater
2024-10-15 15:20     ` Daniel P. Berrangé
2024-10-15 15:42       ` Cédric Le Goater
2024-10-18 15:42 ` Peter Maydell
2024-10-19 15:31   ` Philippe Mathieu-Daudé
2024-10-29 15:06   ` Peter Maydell
2024-11-08  9:29     ` Jan Lübbe
2024-11-08 10:47       ` Cédric Le Goater

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=20241015135649.4189256-1-jlu@pengutronix.de \
    --to=jlu@pengutronix.de \
    --cc=bmeng.cn@gmail.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@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).