[4/4] arm64: dts: allwinner: h5: orangepi-zero-plus2: Add MMC aliases

Message ID 20261120-orangepi-zero-plus2-fixes-v1-4-ecd792189f27@gmail.com (mailing list archive)
State New
Headers
Series arm64: dts: allwinner: h5: orangepi-zero-plus2: Fix Bluetooth and USB gadget |

Commit Message

Ivan Pfarher via B4 Relay Nov. 20, 2026, 11:40 a.m. UTC
From: Ivan Pfarher <ipfarher@gmail.com>

sunxi-mmc probes asynchronously, so without aliases the microSD card,
the SDIO WiFi and the eMMC get their mmc numbers in probe order. A boot
script using root=/dev/mmcblk0p2 for the microSD card can then end up
on the eMMC instead.

Add aliases so that the microSD card is always mmc0 and the eMMC mmc1,
matching the numbering U-Boot uses on this board, with the SDIO WiFi
as mmc2.

Tested on an Orange Pi Zero Plus2 (H5) running Linux 6.6.160 with this
change applied: the microSD card is mmcblk0 and the eMMC mmcblk1,
booting from either. Build-tested only against current mainline.

This problem was investigated, and the patch drafted, in an interactive
session with an AI coding assistant (Claude by Anthropic). The submitter
reviewed the change and ran the tests described above.

Signed-off-by: Ivan Pfarher <ipfarher@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Chen-Yu Tsai Nov. 20, 2026, 3:34 p.m. UTC | #1
On Fri, Nov 20, 2026 at 7:40 PM Ivan Pfarher via B4 Relay
<devnull+ipfarher.gmail.com@kernel.org> wrote:
>
> From: Ivan Pfarher <ipfarher@gmail.com>
>
> sunxi-mmc probes asynchronously, so without aliases the microSD card,
> the SDIO WiFi and the eMMC get their mmc numbers in probe order. A boot
> script using root=/dev/mmcblk0p2 for the microSD card can then end up
> on the eMMC instead.

For sunxi we do not add MMC aliases. You are encouraged to use UUID or
PARTUUID for specifying root devices.

> Add aliases so that the microSD card is always mmc0 and the eMMC mmc1,
> matching the numbering U-Boot uses on this board, with the SDIO WiFi
> as mmc2.
>
> Tested on an Orange Pi Zero Plus2 (H5) running Linux 6.6.160 with this
> change applied: the microSD card is mmcblk0 and the eMMC mmcblk1,
> booting from either. Build-tested only against current mainline.
>
> This problem was investigated, and the patch drafted, in an interactive
> session with an AI coding assistant (Claude by Anthropic). The submitter
> reviewed the change and ran the tests described above.
>
> Signed-off-by: Ivan Pfarher <ipfarher@gmail.com>
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
> index 892723b46..4a26863e8 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
> @@ -13,6 +13,9 @@
>         compatible = "xunlong,orangepi-zero-plus2", "allwinner,sun50i-h5";
>
>         aliases {
> +               mmc0 = &mmc0;
> +               mmc1 = &mmc2;
> +               mmc2 = &mmc1;
>                 serial0 = &uart0;
>         };
>
>
> --
> 2.43.0
>
>
  

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
index 892723b46..4a26863e8 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
@@ -13,6 +13,9 @@ 
 	compatible = "xunlong,orangepi-zero-plus2", "allwinner,sun50i-h5";
 
 	aliases {
+		mmc0 = &mmc0;
+		mmc1 = &mmc2;
+		mmc2 = &mmc1;
 		serial0 = &uart0;
 	};