[RFT][PATCH 2/3] ARM: i.MX: TQMa6x: migrate flash partitions to device tree

Roland Hieber rhi at pengutronix.de
Thu May 11 01:58:02 PDT 2023


This way the partitions are easier to adapt, and the board code becomes
more generic.

Signed-off-by: Roland Hieber <rhi at pengutronix.de>
---
 arch/arm/boards/tqma6x/board.c |  2 --
 arch/arm/dts/imx6dl-mba6x.dts  | 13 +++++++++++++
 arch/arm/dts/imx6q-mba6x.dts   | 13 +++++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/tqma6x/board.c b/arch/arm/boards/tqma6x/board.c
index 5f59a259e620..ae339887568a 100644
--- a/arch/arm/boards/tqma6x/board.c
+++ b/arch/arm/boards/tqma6x/board.c
@@ -84,8 +84,6 @@ static int tqma6x_env_init(void)
 	if (!of_machine_is_compatible("tq,mba6x"))
 		return 0;
 
-	devfs_add_partition("m25p0", 0, SZ_512K, DEVFS_PARTITION_FIXED, "m25p0.barebox");
-
 	imx6_bbu_internal_spi_i2c_register_handler("spiflash", "/dev/m25p0.barebox",
 		BBU_HANDLER_FLAG_DEFAULT);
 	imx6_bbu_internal_mmcboot_register_handler("emmc", "mmc2", 0);
diff --git a/arch/arm/dts/imx6dl-mba6x.dts b/arch/arm/dts/imx6dl-mba6x.dts
index dddc3d384ccc..612acba3239b 100644
--- a/arch/arm/dts/imx6dl-mba6x.dts
+++ b/arch/arm/dts/imx6dl-mba6x.dts
@@ -27,6 +27,19 @@
 	};
 };
 
+&flash {
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "barebox";
+			reg = <0x0 0x80000>;
+		};
+	};
+};
+
 &iomuxc {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_hog>;
diff --git a/arch/arm/dts/imx6q-mba6x.dts b/arch/arm/dts/imx6q-mba6x.dts
index 64635b958213..5154580fae73 100644
--- a/arch/arm/dts/imx6q-mba6x.dts
+++ b/arch/arm/dts/imx6q-mba6x.dts
@@ -27,6 +27,19 @@
 	};
 };
 
+&flash {
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "barebox";
+			reg = <0x0 0x80000>;
+		};
+	};
+};
+
 &iomuxc {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_hog>;
-- 
2.39.2




More information about the barebox mailing list