On Fri, Jul 17, 2026 at 03:01:41PM -0600, James Hilliard wrote:

> sunxi SPL normally uses the legacy MMC interface while U-Boot proper
> uses the driver-model path. When SPL_DM_MMC is enabled, the existing
> DM probe depends on the devicetree, clock and pinctrl providers being
> available in SPL.
> 
> Select the required SPL clock, OF control, pinctrl and pin configuration
> support from MMC_SUNXI. Retain the main CCU and PIO nodes when their SPL
> frameworks are enabled, and retain the MMC0 controller and pin
> configuration when SPL_DM_MMC is enabled.
> 
> This reuses the existing DM path unchanged and leaves the legacy SPL path
> untouched when SPL_DM_MMC is disabled.
> 
> Signed-off-by: James Hilliard <[email protected]>
> ---
> Changes v1 -> v2:
>   - select the required SPL dependencies in Kconfig  (suggested by Tom)
>   - retain the common CCU, PIO, MMC0 and pin configuration nodes in the
>     SPL devicetree
>   - drop the new preprocessor fallback paths  (suggested by Andre)
>   - reuse the existing DM MMC probe unchanged
>   - drop the no-devicetree platform-data path and controller reinit hook
>   - reduce the driver change to four Kconfig selections
>   - validate an H616 SD boot through SPL FIT verification and U-Boot proper
> ---
>  arch/arm/dts/sunxi-u-boot.dtsi | 22 ++++++++++++++++++++++
>  drivers/mmc/Kconfig            |  4 ++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi
> index e1a9a7f5d4c..fdd8c78c8bf 100644
> --- a/arch/arm/dts/sunxi-u-boot.dtsi
> +++ b/arch/arm/dts/sunxi-u-boot.dtsi
> @@ -19,6 +19,28 @@
>       };
>  };
>  
> +#ifdef CONFIG_SPL_CLK
> +&ccu {
> +     bootph-pre-ram;
> +};
> +#endif
> +
> +#ifdef CONFIG_SPL_PINCTRL
> +&pio {
> +     bootph-pre-ram;
> +};
> +#endif
> +
> +#ifdef CONFIG_SPL_DM_MMC
> +&mmc0_pins {
> +     bootph-pre-ram;
> +};
> +
> +&mmc0 {
> +     bootph-pre-ram;
> +};
> +#endif
> +
>  /* Let U-Boot be the firmware layer that controls the watchdog. */
>  #ifdef CONFIG_MACH_SUN8I_R528
>  &wdt {
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index 6c513328de2..40b6e6882aa 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -806,6 +806,10 @@ config MMC_SUNXI
>       bool "Allwinner sunxi SD/MMC Host Controller support"
>       depends on ARCH_SUNXI
>       default y
> +     select SPL_CLK if SPL_DM_MMC
> +     select SPL_OF_CONTROL if SPL_DM_MMC
> +     select SPL_PINCONF if SPL_DM_MMC
> +     select SPL_PINCTRL if SPL_DM_MMC
>       help
>         This selects support for the SD/MMC Host Controller on
>         Allwinner sunxi SoCs.

This seems like a much more reasonable path, thank you.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to