[DEBUG] rk3399-nanopi-neo4: SPL SD init may report -5 due to SD power-on timing
Quentin Schulz
quentin.schulz at cherry.de
Mon Nov 3 10:58:02 CET 2025
Hi Sune,
On 10/31/25 5:10 AM, Sune Brian wrote:
> Hello U-Boot maintainers,
>
> While testing mainline U-Boot (v2026.01-rc1-00070-ge34d01d23e45) on the
> FriendlyARM NanoPi NEO4 (RK3399), I observed that SPL sometimes fails to
> initialize the SD card with the following message:
>
> spl: mmc init failed with error: -5
> SPL: failed to boot from all boot devices
>
> After investigation, the root cause appears to be related to the **SD card
> power rail (`vcc3v0_sd`) timing during SPL startup**. On the NanoPi NEO4,
> the SD slot is powered via GPIO0_A1 to a fixed 3.0 V supply. SPL may attempt
> MMC initialization **before this supply has fully stabilized**, resulting in
> a generic I/O error (`-5`). The SD card itself and the controller are
> functioning correctly once the supply is stable.
>
> **Workarounds / fixes observed:**
> - Add a small delay after enabling `vcc3v0_sd` before SPL starts MMC init.
> - Ensure the regulator is fully powered and stable at SPL start.
>
> This appears to be a **hardware/platform-specific power-on timing issue**
> rather than a device tree or software bug, but documenting it would help
> users encountering similar errors on the NanoPi NEO4.
>
> **Hardware:** FriendlyARM NanoPi NEO4
> **SoC:** Rockchip RK3399
> **U-Boot version:** v2026.01-rc1-00070-ge34d01d23e45
> **Reproducibility:** 100% with SD boot
>
Can you try to apply
https://lore.kernel.org/u-boot/20251031145951.535376-1-c.stoidner@phytec.de/
and see if it helps? It seems like the implem in U-Boot doesn't exactly
follow the MMC spec and this supposedly fixes it. My RK3399 board has
the vmmc-supply always on (not configurable by software) so I cannot be
impacted by any change.
If this isn't enough, you need to specify in the regulator node how long
it takes for the regulator to be stable. We don't want an average, we
want the worst case scenario so that all boards work, if you only have
one NanoPi NEO4, then so be it use the delay necessary for yours, people
can increase the delay later on so it unbreaks their unit as well. This
is what Jonas recommended already.
Cheers,
Quentin
More information about the U-Boot
mailing list