Hi Quentin, On 7/15/2025 11:07 AM, Quentin Schulz wrote: > Hi Jonas, > > On 7/12/25 11:12 PM, Jonas Karlman wrote: >> Boot devices are being probed when SPL boot order is determined. This >> may delay boot slightly and can prevent booting from SPI Flash on boards >> that use same pins for SPI Flash and eMMC due to pinctrl being applied >> prior to booting. >> > > How would that be possible? One cannot have the same pins used for SPI > flash and eMMC at the same time? So that would be an issue in the DT or > a misconfigured DT for the board?
Correct, basically there are SoCs, RK3576 and RK3588S comes to mind, that share/mux pins for FSPI and EMMC. And some devices with those SoCs have options to mount a SPI flash or eMMC module using same connector. E.g. Radxa has a SPI flash module for ROCK 5A/5C that can be mounted on the eMMC connector. And ROCK 4D has a shared eMMC/UFS connector with a SPI flash mounted onboard (in some configurations). When I tried to boot from SPI flash on my ROCK 4D and was trying to describe the eMMC module, SPL would instead first probe the SPI flash module and apply the pinctrl for FSPI func, and then when it tries to lookup more boot options, it instead probed the sdhci controller and applied pinctrl for emmc so loading FIT from SPI flash then failed. With probe and thus apply of pinctrl happening later when images are loaded we should be able to create a single boot image that dynamically can apply correct FDT/DTBO depending if it was booted from SPI flash or eMMC. Or for the ROCK 4D case (can only boot from FSPI->UFS->USB) being able to boot from SPI flash and then switch to use eMMC for storage. Something to investigate more in a follow up series. > > On paper otherwise, it makes sense to me not to probe the device until > it's used. > > Is it guaranteed the devices are actually probed before being used from > the SPL loader code? (common/spl/*) I guess if it's not it would be an > issue in the SPL loader code making assumptions it shouldn't. Yes, from what I could test all SPL loaders initialized a proper probe of the device at the later stage, prior to reading the FIT/image. Regards, Jonas > > Cheers, > Quentin

