Thread (5 messages) 5 messages, 3 authors, 2026-01-14

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

From: Andre Przywara <andre.przywara@arm.com>
Date: 2026-01-14 14:06:59
Also in: linux-devicetree, linux-sunxi, lkml

On Wed, 14 Jan 2026 11:50:04 +0100
Giulio Benetti [off-list ref] 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
quoted hunk ↗ jump to hunk
Signed-off-by: Giulio Benetti <giulio.benetti@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;
 	};
 
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help