* [PATCH v2] mmc: sunxi: support DM MMC in SPL
@ 2026-07-17 21:01 James Hilliard
2026-07-20 20:45 ` Tom Rini via U-Boot
0 siblings, 1 reply; 2+ messages in thread
From: James Hilliard @ 2026-07-17 21:01 UTC (permalink / raw)
To: u-boot
Cc: James Hilliard, Tom Rini, Ilias Apalodimas, Peng Fan,
Jaehoon Chung, Bastien Curutchet, Anshul Dalal, Johan Jonker
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 <james.hilliard1@gmail.com>
---
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.
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] mmc: sunxi: support DM MMC in SPL
2026-07-17 21:01 [PATCH v2] mmc: sunxi: support DM MMC in SPL James Hilliard
@ 2026-07-20 20:45 ` Tom Rini via U-Boot
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini via U-Boot @ 2026-07-20 20:45 UTC (permalink / raw)
To: James Hilliard
Cc: u-boot, Ilias Apalodimas, Peng Fan, Jaehoon Chung,
Bastien Curutchet, Anshul Dalal, Johan Jonker
[-- Attachment #1: Type: text/plain, Size: 2732 bytes --]
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 <james.hilliard1@gmail.com>
> ---
> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-20 20:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17 21:01 [PATCH v2] mmc: sunxi: support DM MMC in SPL James Hilliard
2026-07-20 20:45 ` Tom Rini via U-Boot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox