mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: i.MX6ul: TQMa6ul: fix mmc aliases
@ 2024-02-26 14:14 Sascha Hauer
  2024-02-26 14:14 ` [PATCH 2/2] ARM: i.MX6ul: TQMa6ul: install barebox on eMMC boot partitions Sascha Hauer
  2024-02-27  7:15 ` [PATCH 1/2] ARM: i.MX6ul: TQMa6ul: fix mmc aliases Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2024-02-26 14:14 UTC (permalink / raw)
  To: Barebox List

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@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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-27  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-26 14:14 [PATCH 1/2] ARM: i.MX6ul: TQMa6ul: fix mmc aliases Sascha Hauer
2024-02-26 14:14 ` [PATCH 2/2] ARM: i.MX6ul: TQMa6ul: install barebox on eMMC boot partitions Sascha Hauer
2024-02-27  7:15 ` [PATCH 1/2] ARM: i.MX6ul: TQMa6ul: fix mmc aliases Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox