mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/2] ARM: i.MX6ul: TQMa6ul: fix mmc aliases
Date: Mon, 26 Feb 2024 15:14:57 +0100	[thread overview]
Message-ID: <20240226141458.620463-1-s.hauer@pengutronix.de> (raw)

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




             reply	other threads:[~2024-02-26 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 14:14 Sascha Hauer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240226141458.620463-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox