Skip to contentSkip to conversation

dts:imx6:pfla02: Add nand partitions

PATCH Applied Christian Hemp 2 participants 11 messages Sep 12, 2014 – Sep 15, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/10 dts:imx6:pfla02: Add nand partitions

---
 arch/arm/dts/imx6qdl-phytec-pfla02.dtsi |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
arch/arm/dts/imx6qdl-phytec-pfla02.dtsi +27 -0
index a981fd4..b8988ed 100644
@@ -36,6 +36,33 @@
 	pinctrl-0 = <&pinctrl_gpmi_nand>;
 	nand-on-flash-bbt;
 	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	partition@0 {
+		label = "barebox";
+		reg = <0x0 0x400000>;
+	};
+
+	partition@1 {
+		label = "barebox-environment";
+		reg = <0x400000 0x20000>;
+	};
+
+	partition@2 {
+		label = "oftree";
+		reg = <0x420000 0x20000>;
+	};
+
+	partition@3 {
+		label = "kernel";
+		reg = <0x440000 0x800000>;
+	};
+
+	partition@4 {
+		label = "root";
+		reg = <0xC40000 0x0>;
+	};
 };
 
 &iomuxc {
Signature · 7 lines
1.7.0.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/10 dts:imx6q:pcaaxl3: Add oftree partition to nand

Add oftree partiton to nand.

---
 arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi +8 -3
index 45f3669..78c3334 100644
@@ -144,13 +144,18 @@
 	};
 
 	partition@2 {
-		label = "kernel";
-		reg = <0x420000 0x800000>;
+		label = "oftree";
+		reg = <0x420000 0x20000>;
 	};
 
 	partition@3 {
+		label = "kernel";
+		reg = <0x440000 0x800000>;
+	};
+
+	partition@4 {
 		label = "root";
-		reg = <0xC20000 0x0>;
+		reg = <0xC40000 0x0>;
 	};
 };
 
Signature · 7 lines
1.7.0.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 3/10 ARM:imx6:phycard: Switch env to defaultenv_append_directory

In reply to Christian Hemp
---
 arch/arm/boards/phytec-phycard-imx6/Makefile       |    1 +
 arch/arm/boards/phytec-phycard-imx6/board.c        |    3 +++
 .../defaultenv-phycard-imx6/boot/nand              |    7 +++++++
 .../defaultenv-phycard-imx6/boot/sd-ext3           |    6 ++++++
 .../defaultenv-phycard-imx6/config-board           |    9 +++++++++
 .../defaultenv-phycard-imx6/init/automount         |   14 ++++++++++++++
 arch/arm/boards/phytec-phycard-imx6/env/boot/nand  |    7 -------
 .../boards/phytec-phycard-imx6/env/boot/sd-ext3    |    6 ------
 .../boards/phytec-phycard-imx6/env/config-board    |    7 -------
 9 files changed, 40 insertions(+), 20 deletions(-)
 create mode 100644 arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/boot/nand
 create mode 100644 arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/boot/sd-ext3
 create mode 100644 arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/config-board
 create mode 100644 arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/init/automount
 delete mode 100644 arch/arm/boards/phytec-phycard-imx6/env/boot/nand
 delete mode 100644 arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext3
 delete mode 100644 arch/arm/boards/phytec-phycard-imx6/env/config-board
arch/arm/boards/phytec-phycard-imx6/Makefile +1 -0
index 01c7a25..de67f04 100644
@@ -1,2 +1,3 @@
 obj-y += board.o
 lwl-y += lowlevel.o
+bbenv-y += defaultenv-phycard-imx6
arch/arm/boards/phytec-phycard-imx6/board.c +3 -0
index d425b48..27b84aa 100644
@@ -17,6 +17,7 @@
  *
  */
 
+#include <envfs.h>
 #include <environment.h>
 #include <bootsource.h>
 #include <common.h>
@@ -44,6 +45,8 @@ static int phytec_pcaaxl3_init(void)
 
 	imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT);
 
+	defaultenv_append_directory(defaultenv_phycard_imx6);
+
 	return 0;
 }
 device_initcall(phytec_pcaaxl3_init);
arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/boot/nand new file +7 -0
new file mode 100644
index 0000000..3f3a9aa
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+global.bootm.image="/dev/nand0.kernel.bb"
+global.bootm.oftree="/dev/nand0.oftree.bb"
+bootargs-ip
+global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=root rootfstype=ubifs rw"
+
arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/boot/sd-ext3 new file +6 -0
new file mode 100644
index 0000000..fd35fe0
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image="/mnt/mmc/linuximage"
+global.bootm.oftree="/mnt/mmc/oftree"
+bootargs-ip
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rootwait rw"
arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/config-board new file +9 -0
new file mode 100644
index 0000000..4d7b37c
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.boot.default=nand
+
+global.hostname=phyCARD-i.MX6
+global.linux.bootargs.base="console=ttymxc2,115200"
arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/init/automount new file +14 -0
new file mode 100644
index 0000000..49d99bd
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	init-menu-add-entry "$0" "Automountpoints"
+	exit
+fi
+
+# automount tftp server based on $eth0.serverip
+
+mkdir -p /mnt/tftp
+automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp'
+
+mkdir -p /mnt/mmc
+automount -d /mnt/mmc 'mmc2.probe=1 && [ -e /dev/mmc2.0 ] && mount /dev/mmc2.0 /mnt/mmc'
arch/arm/boards/phytec-phycard-imx6/env/boot/nand deleted +0 -7
deleted file mode 100644
index cf3b25c..0000000
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-global.bootm.image="/dev/nand0.kernel.bb"
-#global.bootm.oftree="/env/oftree"
-bootargs-ip
-global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
-
arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext3 deleted +0 -6
deleted file mode 100644
index 4435633..0000000
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-global.bootm.image="/mnt/kernel/linuximage"
-#global.bootm.oftree="/boot/oftree"
-bootargs-ip
-global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rootwait"
arch/arm/boards/phytec-phycard-imx6/env/config-board deleted +0 -7
deleted file mode 100644
index 44008aa..0000000
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-# board defaults, do not change in running system. Change /env/config
-# instead
-
-global.hostname=phyCARD-i.MX6
-global.linux.bootargs.base="console=ttymxc2,115200"
Signature · 7 lines
1.7.0.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 4/10 ARM:imx6:phyflex: Add defaultenv

In reply to Christian Hemp

Add defaultenv_append_directory to phyFLEX-i.MX6.

---
 arch/arm/boards/phytec-phyflex-imx6/Makefile       |    1 +
 arch/arm/boards/phytec-phyflex-imx6/board.c        |    3 +++
 .../defaultenv-phyflex-imx6/boot/nand              |    6 ++++++
 .../defaultenv-phyflex-imx6/boot/sd-ext3           |    6 ++++++
 .../defaultenv-phyflex-imx6/config-board           |    9 +++++++++
 .../defaultenv-phyflex-imx6/init/automount         |   14 ++++++++++++++
 6 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/nand
 create mode 100644 arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/sd-ext3
 create mode 100644 arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/config-board
 create mode 100644 arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/init/automount
arch/arm/boards/phytec-phyflex-imx6/Makefile +1 -0
index 01c7a25..11e1c7d 100644
@@ -1,2 +1,3 @@
 obj-y += board.o
 lwl-y += lowlevel.o
+bbenv-y += defaultenv-phyflex-imx6
arch/arm/boards/phytec-phyflex-imx6/board.c +3 -0
index 94e3f6f..843edac 100644
@@ -17,6 +17,7 @@
  *
  */
 
+#include <envfs.h>
 #include <common.h>
 #include <gpio.h>
 #include <init.h>
@@ -102,6 +103,8 @@ static int phytec_pfla02_init(void)
 
 	imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT);
 
+	defaultenv_append_directory(defaultenv_phyflex_imx6);
+
 	return 0;
 }
 device_initcall(phytec_pfla02_init);
arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/nand new file +6 -0
new file mode 100644
index 0000000..79dc03c
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image="/dev/nand0.kernel.bb"
+global.bootm.oftree="/dev/nand0.oftree.bb"
+bootargs-ip
+global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=root rootfstype=ubifs rw"
arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/boot/sd-ext3 new file +6 -0
new file mode 100644
index 0000000..fd35fe0
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image="/mnt/mmc/linuximage"
+global.bootm.oftree="/mnt/mmc/oftree"
+bootargs-ip
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rootwait rw"
arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/config-board new file +9 -0
new file mode 100644
index 0000000..b40a4de
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.boot.default=nand
+
+global.hostname=phyFLEX-i.MX6
+global.linux.bootargs.base="console=ttymxc3,115200"
arch/arm/boards/phytec-phyflex-imx6/defaultenv-phyflex-imx6/init/automount new file +14 -0
new file mode 100644
index 0000000..49d99bd
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	init-menu-add-entry "$0" "Automountpoints"
+	exit
+fi
+
+# automount tftp server based on $eth0.serverip
+
+mkdir -p /mnt/tftp
+automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp'
+
+mkdir -p /mnt/mmc
+automount -d /mnt/mmc 'mmc2.probe=1 && [ -e /dev/mmc2.0 ] && mount /dev/mmc2.0 /mnt/mmc'
Signature · 7 lines
1.7.0.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 5/10 ARM:imx6:pfla02: Remove redundant code

In reply to Christian Hemp

Move redundant code to a common function.

---
 arch/arm/boards/phytec-phyflex-imx6/lowlevel.c |   46 ++++++++++--------------
 1 files changed, 19 insertions(+), 27 deletions(-)
arch/arm/boards/phytec-phyflex-imx6/lowlevel.c +19 -27
index 1d08f05..84014d7 100644
@@ -63,7 +63,7 @@ BAREBOX_IMD_TAG_STRING(phyflex_mx6_memsize_1G, IMD_TYPE_PARAMETER, "memsize=1024
 BAREBOX_IMD_TAG_STRING(phyflex_mx6_memsize_2G, IMD_TYPE_PARAMETER, "memsize=2048", 0);
 BAREBOX_IMD_TAG_STRING(phyflex_mx6_memsize_4G, IMD_TYPE_PARAMETER, "memsize=4096", 0);
 
-ENTRY_FUNCTION(start_phytec_pbab01_1gib, r0, r1, r2)
+static void __noreturn start_imx6q_phytec_pbab01_common(uint32_t size)
 {
 	void *fdt;
 
@@ -71,17 +71,16 @@ ENTRY_FUNCTION(start_phytec_pbab01_1gib, r0, r1, r2)
 
 	arm_setup_stack(0x00920000 - 8);
 
-	IMD_USED(phyflex_mx6_memsize_1G);
-
 	if (IS_ENABLED(CONFIG_DEBUG_LL))
 		setup_uart();
 
 	fdt = __dtb_imx6q_phytec_pbab01_start - get_runtime_offset();
 
-	barebox_arm_entry(0x10000000, SZ_1G, fdt);
+	barebox_arm_entry(0x10000000, size, fdt);
 }
 
-ENTRY_FUNCTION(start_phytec_pbab01_2gib, r0, r1, r2)
+
+static void __noreturn start_imx6dl_phytec_pbab01_common(uint32_t size)
 {
 	void *fdt;
 
@@ -89,44 +88,37 @@ ENTRY_FUNCTION(start_phytec_pbab01_2gib, r0, r1, r2)
 
 	arm_setup_stack(0x00920000 - 8);
 
-	IMD_USED(phyflex_mx6_memsize_2G);
+	fdt = __dtb_imx6dl_phytec_pbab01_start - get_runtime_offset();
 
-	if (IS_ENABLED(CONFIG_DEBUG_LL))
-		setup_uart();
+	barebox_arm_entry(0x10000000, size, fdt);
+}
 
-	fdt = __dtb_imx6q_phytec_pbab01_start - get_runtime_offset();
+ENTRY_FUNCTION(start_phytec_pbab01_1gib, r0, r1, r2)
+{
+	IMD_USED(phyflex_mx6_memsize_1G);
 
-	barebox_arm_entry(0x10000000, SZ_2G, fdt);
+	start_imx6q_phytec_pbab01_common(SZ_1G);
 }
 
-ENTRY_FUNCTION(start_phytec_pbab01_4gib, r0, r1, r2)
+ENTRY_FUNCTION(start_phytec_pbab01_2gib, r0, r1, r2)
 {
-	void *fdt;
-
-	imx6_cpu_lowlevel_init();
+	IMD_USED(phyflex_mx6_memsize_2G);
 
-	arm_setup_stack(0x00920000 - 8);
+	start_imx6q_phytec_pbab01_common(SZ_2G);
+}
 
+ENTRY_FUNCTION(start_phytec_pbab01_4gib, r0, r1, r2)
+{
 	IMD_USED(phyflex_mx6_memsize_4G);
 
-	fdt = __dtb_imx6q_phytec_pbab01_start - get_runtime_offset();
-
-	barebox_arm_entry(0x10000000, 0xEFFFFFF8, fdt);
+	start_imx6q_phytec_pbab01_common(0xEFFFFFF8);
 }
 
 ENTRY_FUNCTION(start_phytec_pbab01dl_1gib, r0, r1, r2)
 {
-	void *fdt;
-
-	imx6_cpu_lowlevel_init();
-
-	arm_setup_stack(0x00920000 - 8);
-
 	IMD_USED(phyflex_mx6_memsize_1G);
 
-	fdt = __dtb_imx6dl_phytec_pbab01_start - get_runtime_offset();
-
-	barebox_arm_entry(0x10000000, SZ_1G, fdt);
+	start_imx6dl_phytec_pbab01_common(SZ_1G);
 }
 
 ENTRY_FUNCTION(start_phytec_pbab01s_512mb, r0, r1, r2)
Signature · 7 lines
1.7.0.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH 6/10 dts:imx6:pfla02: Remove memory node

In reply to Christian Hemp
---
 arch/arm/dts/imx6dl-phytec-pfla02.dtsi |    4 ----
 arch/arm/dts/imx6q-phytec-pfla02.dtsi  |    4 ----
 arch/arm/dts/imx6s-phytec-pfla02.dtsi  |    4 ----
 3 files changed, 0 insertions(+), 12 deletions(-)
arch/arm/dts/imx6dl-phytec-pfla02.dtsi +0 -4
index fa3a49a..ae78afd 100644
@@ -15,10 +15,6 @@
 / {
 	model = "Phytec phyFLEX-i.MX6 Dual Lite";
 	compatible = "phytec,imx6dl-pfla02", "fsl,imx6dl";
-
-	memory {
-		reg = <0x10000000 0x40000000>;
-	};
 };
 
 &ecspi3 {
arch/arm/dts/imx6q-phytec-pfla02.dtsi +0 -4
index 781a90a..f30f84c 100644
@@ -15,10 +15,6 @@
 / {
 	model = "Phytec phyFLEX-i.MX6 Quad";
 	compatible = "phytec,imx6q-pfla02", "fsl,imx6q";
-
-	memory {
-		reg = <0x10000000 0x40000000>;
-	};
 };
 
 &ecspi3 {
arch/arm/dts/imx6s-phytec-pfla02.dtsi +0 -4
index 8322426..d84fa4f 100644
@@ -15,8 +15,4 @@
 / {
 	model = "Phytec phyFLEX-i.MX6 Single";
 	compatible = "phytec,imx6s-pfla02", "fsl,imx6dl";
-
-	memory {
-		reg = <0x10000000 0x20000000>;
-	};
 };
Signature · 7 lines
1.7.0.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

PATCH 7/10 dts:imx6:pfla02: move mac read to module

In reply to Christian Hemp

Move mac read to module.

---
 arch/arm/dts/imx6qdl-phytec-pbab01.dtsi |    4 ----
 arch/arm/dts/imx6qdl-phytec-pfla02.dtsi |    4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/imx6qdl-phytec-pbab01.dtsi +0 -4
index 8f5dea7..7d31123 100644
@@ -22,10 +22,6 @@
 	status = "okay";
 };
 
-&ocotp {
-	barebox,provide-mac-address = <&fec 0x620>;
-};
-
 &uart1 {
 	status = "okay";
 };
arch/arm/dts/imx6qdl-phytec-pfla02.dtsi +4 -0
index b8988ed..4a99103 100644
@@ -176,6 +176,10 @@
 	};
 };
 
+&ocotp {
+	barebox,provide-mac-address = <&fec 0x620>;
+};
+
 &uart4 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart4>;
Signature · 7 lines
1.7.0.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

PATCH 8/10 dts:imx6:pfla02:Move spi partitions imx6qdl-phytec-pfla02

In reply to Christian Hemp

Move the spi partition definition to imx6qdl-phytec-pfla02.dtsi

---
 arch/arm/dts/imx6dl-phytec-pfla02.dtsi  |   15 ---------------
 arch/arm/dts/imx6q-phytec-pfla02.dtsi   |   15 ---------------
 arch/arm/dts/imx6qdl-phytec-pfla02.dtsi |   14 ++++++++++++++
 3 files changed, 14 insertions(+), 30 deletions(-)
arch/arm/dts/imx6dl-phytec-pfla02.dtsi +0 -15
index ae78afd..0f801ae 100644
@@ -20,18 +20,3 @@
 &ecspi3 {
 	status = "okay";
 };
-
-&flash {
-        #address-cells = <1>;
-        #size-cells = <1>;
-
-        partition@0 {
-                label = "barebox";
-                reg = <0x0 0x80000>;
-        };
-
-        partition@1 {
-                label = "barebox-environment";
-                reg = <0x80000 0x10000>;
-        };
-};
arch/arm/dts/imx6q-phytec-pfla02.dtsi +0 -15
index f30f84c..0aec5d0 100644
@@ -20,18 +20,3 @@
 &ecspi3 {
 	status = "okay";
 };
-
-&flash {
-	#address-cells = <1>;
-	#size-cells = <1>;
-
-	partition@0 {
-		label = "barebox";
-		reg = <0x0 0x80000>;
-	};
-
-	partition@1 {
-		label = "barebox-environment";
-		reg = <0x80000 0x10000>;
-	};
-};
arch/arm/dts/imx6qdl-phytec-pfla02.dtsi +14 -0
index 4a99103..4b8e256 100644
@@ -20,6 +20,20 @@
 		compatible = "m25p80";
 		spi-max-frequency = <20000000>;
 		reg = <0>;
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition@0 {
+			label = "barebox";
+			reg = <0x0 0x80000>;
+		};
+
+		partition@1 {
+			label = "barebox-environment";
+			reg = <0x80000 0x10000>;
+		};
+
 	};
 };
 
Signature · 7 lines
1.7.0.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

PATCH 9/10 dts:imx6:pfla02: Add env node for SPI-NOR and NAND

In reply to Christian Hemp

Add environment node for NAND and SPI-NOR

Move the environment property to the module file.

---
 arch/arm/dts/imx6dl-phytec-pbab01.dts   |    5 ----
 arch/arm/dts/imx6q-phytec-pbab01.dts    |    5 ----
 arch/arm/dts/imx6qdl-phytec-pbab01.dtsi |    9 --------
 arch/arm/dts/imx6qdl-phytec-pfla02.dtsi |   34 +++++++++++++++++++++++++++++++
 4 files changed, 34 insertions(+), 19 deletions(-)
arch/arm/dts/imx6dl-phytec-pbab01.dts +0 -5
index 0e90c47..4b77838 100644
@@ -20,10 +20,5 @@
 
 	chosen {
 		linux,stdout-path = &uart4;
-
-		environment@0 {
-			compatible = "barebox,environment";
-			device-path = &flash, "partname:barebox-environment";
-		};
 	};
 };
arch/arm/dts/imx6q-phytec-pbab01.dts +0 -5
index 26046e0..580338d 100644
@@ -19,10 +19,5 @@
 
 	chosen {
 		linux,stdout-path = &uart4;
-
-		environment@0 {
-			compatible = "barebox,environment";
-			device-path = &flash, "partname:barebox-environment";
-		};
 	};
 };
arch/arm/dts/imx6qdl-phytec-pbab01.dtsi +0 -9
index 7d31123..157e130 100644
@@ -9,15 +9,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-/ {
-	chosen {
-		environment@0 {
-			compatible = "barebox,environment";
-			device-path = &flash, "partname:barebox-environment";
-		};
-	};
-};
-
 &fec {
 	status = "okay";
 };
arch/arm/dts/imx6qdl-phytec-pfla02.dtsi +34 -0
index 4b8e256..5c7bcee 100644
@@ -9,6 +9,28 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
+/ {
+	chosen {
+		environment-nand {
+			compatible = "barebox,environment";
+			device-path = &gpmi, "partname:barebox-environment";
+			status = "disabled";
+		};
+
+		environment-spinor {
+			compatible = "barebox,environment";
+			device-path = &flash, "partname:barebox-environment";
+			status = "disabled";
+		};
+
+		environment-sd {
+			compatible = "barebox,environment";
+			device-path = &usdhc3, "partname:barebox-environment";
+			status = "disabled";
+		};
+	};
+};
+
 &ecspi3 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_ecspi3>;
@@ -214,4 +236,16 @@
         cd-gpios = <&gpio1 27 0>;
         wp-gpios = <&gpio1 29 0>;
         status = "disabled";
+
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	partition@0 {
+		label = "barebox";
+		reg = <0x0 0x80000>;
+	};
+	partition@1 {
+		label = "barebox-environment";
+		reg = <0x80000 0x80000>;
+	};
 };
Signature · 7 lines
1.7.0.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#9 lore raw

PATCH 10/10 ARM:phyFLEX-iMX6: Add bootsource detection

In reply to Christian Hemp
---
 arch/arm/boards/phytec-phyflex-imx6/board.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
arch/arm/boards/phytec-phyflex-imx6/board.c +15 -0
index 843edac..fe3d1b2 100644
@@ -18,6 +18,8 @@
  */
 
 #include <envfs.h>
+#include <environment.h>
+#include <bootsource.h>
 #include <common.h>
 #include <gpio.h>
 #include <init.h>
@@ -103,6 +105,19 @@ static int phytec_pfla02_init(void)
 
 	imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT);
 
+	switch (bootsource_get()) {
+	case BOOTSOURCE_MMC:
+		of_device_enable_path("/chosen/environment-sd");
+		break;
+	case BOOTSOURCE_NAND:
+		of_device_enable_path("/chosen/environment-nand");
+		break;
+	default:
+	case BOOTSOURCE_SPI:
+		of_device_enable_path("/chosen/environment-spinor");
+		break;
+	}
+
 	defaultenv_append_directory(defaultenv_phyflex_imx6);
 
 	return 0;
Signature · 7 lines
1.7.0.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer Applied
#10 lore raw
In reply to Christian Hemp

Hi Christian,

Quoted 4 lines · Christian Hemp
---
 arch/arm/dts/imx6qdl-phytec-pfla02.dtsi |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

Applied all, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox