On Mon, 2025-10-27 at 13:23 +0100, Philippe Mathieu-Daudé wrote:
> On 27/10/25 12:55, Daniel P. Berrangé wrote:
> > On Fri, Oct 17, 2025 at 02:03:54PM +0200, Jan Kiszka wrote:
> > > From: Jan Kiszka <[email protected]>
> > > 
> > > Enable user-instantiation so that PCI-attached eMMCs can be created for
> > > virt machines, for QA purposes for the eMMC model itself and for complex
> > > firmware/OS integrations using the upcoming RPMB partition support.
> > 
> > IIUC, the 'emmc' device wants an 'sd-bus' but this commit talks about
> > it being PCI-attached ?
> 
> Sigh, it should not, but it got introduced this way and we didn't
> have time / energy / good reason to rework the code, which currently
> just works.
> 
> SD / MMC cards -> plugged over external SD bus
> 
> embedded MMC cards -> no SD bus, directly mmio-mapped.

Hmm. This is not how I'd describe it and I've not seen directly MMIO mapped MMC
cards.

Both eMMCs and SD cards are separate/physical devices connected via an SD/MMC
bus to a host controller. As both protocols are closely related, host controller
usually implement both protocols and can detect which one to use at runtime.

The host controller is connected to the CPU via a different bus, usually PCI(e)
(e.g. in a notebook) or just MMIO mapped (e.g. in an ARM SoC). SDHCI is the most
common interface spec for SD/MMC controlers. So, you need to create two device
(eMMC + SDHCI) for this to work with a generic x86_64 VM:
 -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 \

If you emulate a machine/SoC which already has an integrated SD/MMC host
controler, you'd leave out the sdhci-pci device.

Regards,
Jan
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Reply via email to