Commit da954d0e introduces a regression on sifive_unleashed when booting from SD card
Host environment
- Operating system: Ubuntu 2022.04
- OS/kernel version: 6.8.0-57-generic #59-Ubuntu
- Architecture: x86_64
- QEMU flavor: qemu-system-riscv64
- QEMU version: v10.0.0-365-g73d29ea241
- QEMU command line:
./qemu-system-riscv64 -smp 5 -m 8G -nographic -M sifive_u,msel=11 -bios /tmp/sifive_unleashed/spl/u-boot-spl.bin -drive file=/tmp/sifive_unleashed/sdcard.img,format=raw,if=sd
Emulated/Virtualized environment
- Operating system: U-Boot
- OS/kernel version: v2025.04 or top of tree
- Architecture: RISC-V64
Description of problem
In U-Boot CI, we started to update from v8.2.0 to v9.2.3 and found that the sifive_unleashed target was failing to boot from SD card in our tests (we also test via SPI and this is fine). I have bisected the problem down to commit da954d0e ("hw/sd/sdcard: Add spi_cmd_SEND_CSD/CID handlers (CMD9 & CMD10)").
When running QEMU we see the following output in the failure case as the only output:
U-Boot SPL 2025.07-rc1-00033-gad60d9792896 (May 01 2025 - 17:08:34 +0000)
Trying to boot from MMC1
spl: mmc init failed with error: -110
Error: -110
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
Steps to reproduce
- wget -O - https://github.com/pengutronix/genimage/releases/download/v14/genimage-14.tar.xz | tar -C /tmp -xJ ; cd /tmp/genimage-14
- ./configure && make -j$(nproc)
- git clone https://source.denx.de/u-boot/u-boot.git; cd u-boot
- wget -O - https://github.com/riscv-software-src/opensbi/releases/download/v1.3.1/opensbi-1.3.1-rv-bin.tar.xz | tar -C /tmp -xJ
- export OPENSBI=/tmp/opensbi-1.3.1-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin
- make O=/tmp/sifive_unleashed CROSS_COMPILE=riscv64-linux- sifive_unleashed_defconfig
- make O=/tmp/sifive_unleashed CROSS_COMPILE=riscv64-linux- -sj$(nproc)
- mkdir -p root
- cp /tmp/sifive_unleashed/spl/u-boot-spl.bin .
- cp /tmp/sifive_unleashed/u-boot.itb .
- rm -rf tmp
- genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg
- cp images/sdcard.img /tmp/sifive_unleashed/
- qemu-system-riscv64 -smp 5 -m 8G -nographic -M sifive_u,msel=11 -bios /tmp/sifive_unleashed/spl/u-boot-spl.bin -drive file=/tmp/sifive_unleashed/sdcard.img,format=raw,if=sd
Additional information
The genimage tool is required for making the disk images used here. If building everything here is too much, I can provide the U-Boot binaries needed here out of band.