[PATCH 1/2] ARM: i.MX6ul: TQMa6ul: fix mmc aliases

Sascha Hauer s.hauer at pengutronix.de
Mon Feb 26 06:14:57 PST 2024


The TQMa6ul upstream device trees contain aliases which swap the order
of the mmc nodes, so what used to be mmc0 has now become mmc1 and vice
versa. With this mmc0 now is the eMMC and mmc1 is the SD card.

Introduce a imx6ul.dtsi which adds barebox,bootsource-mmcx aliases so
that bootsource_get_instance() matches our mmc numbering again. Also
register the eMMC BBU handler on /dev/mmc0 and the SD BBU handler on
/dev/mmc1.

Fixes: 5a23f05267 ("ARM: tqma6ul: use upstream device trees")
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/boards/tqma6ulx/board.c        | 8 ++++----
 arch/arm/dts/imx6ul-tqma6ul-common.dtsi | 2 ++
 arch/arm/dts/imx6ul.dtsi                | 6 ++++++
 3 files changed, 12 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/imx6ul.dtsi

diff --git a/arch/arm/boards/tqma6ulx/board.c b/arch/arm/boards/tqma6ulx/board.c
index 312bb9f585..04e35c199e 100644
--- a/arch/arm/boards/tqma6ulx/board.c
+++ b/arch/arm/boards/tqma6ulx/board.c
@@ -80,11 +80,11 @@ static int mba6ulx_probe(struct device *dev)
 		clk_enable(clk);
 
 	/* the bootloader is stored in one of the two boot partitions */
-	flags = bootsource_get_instance() == 0 ? BBU_HANDLER_FLAG_DEFAULT : 0;
-	imx6_bbu_internal_mmc_register_handler("SD", "/dev/mmc0.barebox", flags);
-
 	flags = bootsource_get_instance() == 1 ? BBU_HANDLER_FLAG_DEFAULT : 0;
-	imx6_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc1", flags);
+	imx6_bbu_internal_mmc_register_handler("SD", "/dev/mmc1.barebox", flags);
+
+	flags = bootsource_get_instance() == 0 ? BBU_HANDLER_FLAG_DEFAULT : 0;
+	imx6_bbu_internal_mmc_register_handler("eMMC", "/dev/mmc0", flags);
 
 	if (bootsource_get_instance() == 0)
 		of_device_enable_path("/chosen/environment-sd");
diff --git a/arch/arm/dts/imx6ul-tqma6ul-common.dtsi b/arch/arm/dts/imx6ul-tqma6ul-common.dtsi
index 64f1ee253c..71a447a394 100644
--- a/arch/arm/dts/imx6ul-tqma6ul-common.dtsi
+++ b/arch/arm/dts/imx6ul-tqma6ul-common.dtsi
@@ -4,6 +4,8 @@
  * Author: Rouven Czerwinski
  */
 
+#include "imx6ul.dtsi"
+
 / {
 	chosen {
 		environment-sd {
diff --git a/arch/arm/dts/imx6ul.dtsi b/arch/arm/dts/imx6ul.dtsi
new file mode 100644
index 0000000000..7d600f505b
--- /dev/null
+++ b/arch/arm/dts/imx6ul.dtsi
@@ -0,0 +1,6 @@
+/ {
+	aliases {
+		barebox,bootsource-mmc0 = &usdhc1;
+		barebox,bootsource-mmc1 = &usdhc2;
+	};
+};
-- 
2.39.2




More information about the barebox mailing list