[PATCH] ARM: dts: sun7i: a20: fix MMC index enumeration

Andre Przywara andre.przywara at arm.com
Wed Jan 14 06:06:53 PST 2026


On Wed, 14 Jan 2026 11:50:04 +0100
Giulio Benetti <giulio.benetti at benettiengineering.com> wrote:

Hi Giulio,

> Currently, the OLinuXino-A20-Micro experiences non-deterministic MMC
> enumeration during boot. When both an SDIO WiFi module (MMC1) and
> an SD card (MMC0) are present, the kernel may swap their indices.
> 
> Explicitly define mmc* aliases to ensure consistent device naming
> and prevent mapping conflicts.

So this comes up every now and then, but for sunxi it was decided to not
support this. The enumeration of devices in the kernel is never guaranteed
to follow some order, and this is widely accepted for SCSI (/dev/sda) and
NVMe. Distros are coping with this forever since, using more sustainable
designations like UUIDs or labels.

If you don't want to change the way you communicate the root device to the
kernel, you can actually use U-Boot's DTs, which adds the indicies for its
own purposes, and can pass this on to the kernel. Just don't load a DT
from storage (which you shouldn't be doing anyways), and just use
$fdtcontroladdr as the DT address when booting the kernel.

Cheers,
Andre

> Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
> ---
>  arch/arm/boot/dts/allwinner/sun7i-a20.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/allwinner/sun7i-a20.dtsi b/arch/arm/boot/dts/allwinner/sun7i-a20.dtsi
> index 5f44f09c5545..a958400bcd7c 100644
> --- a/arch/arm/boot/dts/allwinner/sun7i-a20.dtsi
> +++ b/arch/arm/boot/dts/allwinner/sun7i-a20.dtsi
> @@ -55,6 +55,10 @@ / {
>  	#size-cells = <1>;
>  
>  	aliases {
> +		mmc0 = &mmc0;
> +		mmc1 = &mmc1;
> +		mmc2 = &mmc2;
> +		mmc3 = &mmc3;
>  		ethernet0 = &gmac;
>  	};
>  




More information about the linux-arm-kernel mailing list