I want to connect a SD card to the first SD controller of an i.MX6 SoC (the one with base address 0x2190000). However QEMU defaults to adding it to the third controller (tested with version 4.2 and 5.1).
QEMU arguments:
qemu-system-arm -m 2G -M sabrelite -kernel zImage \
-drive file=img.sdcard,format=raw,id=mysdcard \
-device sd-card,drive=mysdcard \
-append "console=ttymxc0, rootfstype=ext4 root=/dev/mmcblk0p2 rw rootwait" \
-dtb mydtb.dtb -serial stdio
Output of "info qtree":
dev: imx-usdhc, id ""
gpio-out "sysbus-irq" 1
sd-spec-version = 3 (0x3)
uhs = 0 (0x0)
capareg = 91763892 (0x57834b4)
maxcurr = 0 (0x0)
pending-insert-quirk = false
dma = ""
mmio 000000000219c000/0000000000000100
bus: sd-bus
type sdhci-bus
dev: sd-card, id "" <-- I do not want the SD card to appear here
spec_version = 2 (0x2)
drive = "mysdcard"
spi = false
dev: imx-usdhc, id ""
[...]
dev: imx-usdhc, id ""
[...]
dev: imx-usdhc, id ""
gpio-out "sysbus-irq" 1
sd-spec-version = 3 (0x3)
uhs = 0 (0x0)
capareg = 91763892 (0x57834b4)
maxcurr = 0 (0x0)
pending-insert-quirk = false
dma = ""
mmio 0000000002190000/0000000000000100
bus: sd-bus
type sdhci-bus <-- This is where the card needs to be
I wanted to specify the id of the controller, but all imx-usdhc have an empty string as id.
So how can I specify which controller to use (or at least tell QEMU to default to the first one)?