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

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

Install barebox on the eMMC boot partitions which offer enough space
for bigger barebox images and which also provides a failsafe update.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/tqma6ulx/board.c        | 2 +-
 arch/arm/dts/imx6ul-tqma6ul-common.dtsi | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/arm/boards/tqma6ulx/board.c b/arch/arm/boards/tqma6ulx/board.c
index 04e35c199e..c559568880 100644
--- a/arch/arm/boards/tqma6ulx/board.c
+++ b/arch/arm/boards/tqma6ulx/board.c
@@ -84,7 +84,7 @@ static int mba6ulx_probe(struct device *dev)
 	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);
+	imx6_bbu_internal_mmcboot_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 71a447a394..5ff318fcfc 100644
--- a/arch/arm/dts/imx6ul-tqma6ul-common.dtsi
+++ b/arch/arm/dts/imx6ul-tqma6ul-common.dtsi
@@ -27,11 +27,6 @@ partitions {
 		#address-cells = <1>;
 		#size-cells = <1>;
 
-		partition@0 {
-			label = "barebox";
-			reg = <0x0 0xe0000>;
-		};
-
 		environment_emmc: partition@e0000 {
 			label = "barebox-environment";
 			reg = <0xe0000 0x20000>;
-- 
2.39.2




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

* Re: [PATCH 1/2] ARM: i.MX6ul: TQMa6ul: fix mmc aliases
  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 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2024-02-27  7:15 UTC (permalink / raw)
  To: Barebox List, Sascha Hauer


On Mon, 26 Feb 2024 15:14:57 +0100, Sascha Hauer wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/2] ARM: i.MX6ul: TQMa6ul: fix mmc aliases
      https://git.pengutronix.de/cgit/barebox/commit/?id=c2f751908896 (link may not be stable)
[2/2] ARM: i.MX6ul: TQMa6ul: install barebox on eMMC boot partitions
      https://git.pengutronix.de/cgit/barebox/commit/?id=c654a59bd233 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ 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