arch/arm/boot/dts/allwinner/sun7i-a20.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
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.
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;
};
--
2.47.3
On Wed, 14 Jan 2026 11:50:04 +0100
Giulio Benetti <giulio.benetti@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@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;
> };
>
On 1/14/26 15:06, Andre Przywara wrote:
> On Wed, 14 Jan 2026 11:50:04 +0100
> Giulio Benetti <giulio.benetti@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.
I see,
> 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.
Thanks for pointing, let's see if Buildroot Maintainers accept this
patch as is, otherwise I'll probably go with UUID.
Thank you for taking care and explaining.
Best regards
Giulio
> Cheers,
> Andre
>
>> 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;
>> };
>>
>
On Wed, Jan 14, 2026 at 6:50 PM Giulio Benetti
<giulio.benetti@benettiengineering.com> wrote:
>
> 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.
Years ago we (sunxi maintainers) decided against this.
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
> arch/arm/boot/dts/allwinner/sun7i-a20.dtsi | 4 ++++
And aliases are per board, so this definitely doesn't belong here.
ChenYu
> 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;
> };
>
> --
> 2.47.3
>
>
On 1/14/26 15:07, Chen-Yu Tsai wrote:
> On Wed, Jan 14, 2026 at 6:50 PM Giulio Benetti
> <giulio.benetti@benettiengineering.com> wrote:
>>
>> 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.
>
> Years ago we (sunxi maintainers) decided against this.
>
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>> arch/arm/boot/dts/allwinner/sun7i-a20.dtsi | 4 ++++
>
> And aliases are per board, so this definitely doesn't belong here.
I see, thank you for taking care.
Best regards
Giulio
>
> ChenYu
>
>> 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;
>> };
>>
>> --
>> 2.47.3
>>
>>
© 2016 - 2026 Red Hat, Inc.