[DEBUG] rk3399-nanopi-neo4: SPL SD init may report -5 due to SD power-on timing

Jonas Karlman jonas at kwiboo.se
Fri Oct 31 20:48:17 CET 2025


Hi Brian,

On 10/31/2025 8:17 PM, Tom Rini wrote:
> On Fri, Oct 31, 2025 at 12:10:36PM +0800, 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.

U-Boot v2025.07-rc4 changed how sd-card regulators are handled for the
nanopi4 family of boards.

Is your issue specific to a reboot or cold boot?

Try adding something like following to rk3399-nanopi-neo4-u-boot.dtsi
to add a 2ms delay to ensure the voltage for the vcc3v0_sd regulator is
stabilized when it is enabled. Or any other timing that is required.

&vcc3v0_sd {
	startup-delay-us = <2000>;
};

I only have a NanoPi M4B from the nanopi4 family to run tests on.

Regards,
Jonas

>>
>> **Hardware:** FriendlyARM NanoPi NEO4
>> **SoC:** Rockchip RK3399
>> **U-Boot version:** v2026.01-rc1-00070-ge34d01d23e45
>> **Reproducibility:** 100% with SD boot
> 
> Adding the board maintainer and come other active rockchip people.
> 



More information about the U-Boot mailing list