mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: zii-imx8mq-dev: add barebox and environment partition
@ 2019-05-31  9:47 Lucas Stach
  2019-05-31  9:47 ` [PATCH 2/3] ARM: zii-imx8mq-dev: add defaultenv with simple boot configuration Lucas Stach
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lucas Stach @ 2019-05-31  9:47 UTC (permalink / raw)
  To: barebox

While barebox itself should be on the eMMC boot partitions eventually
it's nice to have this set up, so one can dd a prebuilt SD card image
to the eMMC and have something working. A working Barebox env is also
very convinient to have around during development.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boards/zii-imx8mq-dev/board.c |  6 +++++
 arch/arm/dts/imx8mq-zii-ultra.dtsi     | 37 ++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c
index 94e71f58ceb7..4dbe23f58ce2 100644
--- a/arch/arm/boards/zii-imx8mq-dev/board.c
+++ b/arch/arm/boards/zii-imx8mq-dev/board.c
@@ -4,6 +4,7 @@
  * Author: Andrey Smirnov <andrew.smirnov@gmail.com>
  */
 
+#include <bootsource.h>
 #include <common.h>
 #include <init.h>
 #include <asm/memory.h>
@@ -19,6 +20,11 @@ static int zii_imx8mq_dev_init(void)
 
 	imx8mq_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc0", 0);
 
+	if (bootsource_get_instance() == 0)
+		of_device_enable_path("/chosen/environment-emmc");
+	else
+		of_device_enable_path("/chosen/environment-sd");
+
 	return 0;
 }
 device_initcall(zii_imx8mq_dev_init);
diff --git a/arch/arm/dts/imx8mq-zii-ultra.dtsi b/arch/arm/dts/imx8mq-zii-ultra.dtsi
index ccf80d3de838..53679b0d3c40 100644
--- a/arch/arm/dts/imx8mq-zii-ultra.dtsi
+++ b/arch/arm/dts/imx8mq-zii-ultra.dtsi
@@ -10,6 +10,17 @@
 / {
 	chosen {
 		stdout-path = &uart1;
+
+		environment-emmc {
+			compatible = "barebox,environment";
+			device-path = &usdhc1, "partname:barebox-environment";
+			status = "disabled";
+		};
+		environment-sd {
+			compatible = "barebox,environment";
+			device-path = &usdhc2, "partname:barebox-environment";
+			status = "disabled";
+		};
 	};
 
 	mdio0: bitbang-mdio {
@@ -348,6 +359,19 @@
 	no-sd;
 	no-sdio;
 	status = "okay";
+
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	partition@0 {
+		label = "barebox";
+		reg = <0x0 0xe0000>;
+	};
+
+	partition@e0000 {
+		label = "barebox-environment";
+		reg = <0xe0000 0x20000>;
+	};
 };
 
 &usdhc2 {
@@ -358,6 +382,19 @@
 	cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
 	vmmc-supply = <&reg_usdhc2_vmmc>;
 	status = "okay";
+
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	partition@0 {
+		label = "barebox";
+		reg = <0x0 0xe0000>;
+	};
+
+	partition@e0000 {
+		label = "barebox-environment";
+		reg = <0xe0000 0x20000>;
+	};
 };
 
 &iomuxc {
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2019-06-04  7:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31  9:47 [PATCH 1/3] ARM: zii-imx8mq-dev: add barebox and environment partition Lucas Stach
2019-05-31  9:47 ` [PATCH 2/3] ARM: zii-imx8mq-dev: add defaultenv with simple boot configuration Lucas Stach
2019-05-31  9:47 ` [PATCH 3/3] ARM: rdu3: disable i210 network interface Lucas Stach
2019-05-31 15:08   ` Vivien Didelot
2019-06-04  7:55 ` [PATCH 1/3] ARM: zii-imx8mq-dev: add barebox and environment partition Sascha Hauer

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