Skip to contentSkip to conversation

arm: boards: phytec-som-am335x: Add bootchooser support

PATCH Applied Teresa Remmet 2 participants 6 messages Jan 7, 2019 – Jan 8, 2019 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover arm: boards: phytec-som-am335x: Add bootchooser support

Hello,

this patchstack from Daniel adds bootchooser support to phytec am335x boards. I updated the patchstack to a more recent barebox version and added some small fixes.

Teresa

Daniel Schultz (4):
ARM: configs: omap_defconfig: Add bootchooser
ARM: dts: am335x-phytec-state: Reduce partition size
ARM: dts: am335x-phytec-state: Add state partition for bootchooser
arm: boards: phytec-som-am335x: Add bootchooser to bootsource

 .../defaultenv-physom-am335x/init/bootsource       |  8 +--
 arch/arm/configs/omap_defconfig                    |  2 +
 arch/arm/dts/am335x-phytec-state.dtsi              | 59 ++++++++++++++++++++--
 3 files changed, 62 insertions(+), 7 deletions(-)
Signature · 7 lines
2.7.4


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

PATCH 1/4 ARM: configs: omap_defconfig: Add bootchooser

From: Daniel Schultz <[email protected]>

---
 arch/arm/configs/omap_defconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/configs/omap_defconfig +2 -0
index e41757b9190b..128027a6406b 100644
@@ -32,6 +32,7 @@ CONFIG_BLSPEC=y
 CONFIG_CONSOLE_ACTIVATE_NONE=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
 CONFIG_STATE=y
+CONFIG_BOOTCHOOSER=y
 CONFIG_RESET_SOURCE=y
 CONFIG_DEBUG_INFO=y
 CONFIG_LONGHELP=y
@@ -92,6 +93,7 @@ CONFIG_CMD_OF_FIXUP_STATUS=y
 CONFIG_CMD_OFTREE=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_STATE=y
+CONFIG_CMD_BOOTCHOOSER=y
 CONFIG_NET=y
 CONFIG_NET_NFS=y
 CONFIG_NET_NETCONSOLE=y
Signature · 7 lines
2.7.4


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

PATCH 2/4 ARM: dts: am335x-phytec-state: Reduce partition size

In reply to Teresa Remmet

From: Daniel Schultz <[email protected]>

Partition size was not calculated correct. Set the correct size.

---
 arch/arm/dts/am335x-phytec-state.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/am335x-phytec-state.dtsi +1 -1
index 6bca59715901..d332abe4b9b7 100644
@@ -46,7 +46,7 @@
 		#size-cells = <1>;
 		#address-cells = <1>;
 		backend_state_eeprom: state@0 {
-			reg = <0x000 0x120>;
+			reg = <0x000 0x100>;
 			label = "state-eeprom";
 		};
 	};
Signature · 7 lines
2.7.4


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

PATCH 3/4 ARM: dts: am335x-phytec-state: Add state partition for bootchooser

In reply to Teresa Remmet

From: Daniel Schultz <[email protected]>

---
 arch/arm/dts/am335x-phytec-state.dtsi | 57 +++++++++++++++++++++++++++++++++--
 1 file changed, 55 insertions(+), 2 deletions(-)
arch/arm/dts/am335x-phytec-state.dtsi +55 -2
index d332abe4b9b7..1f61cf5a2e6c 100644
@@ -15,13 +15,14 @@
 / {
 	aliases {
 		am335x_phytec_mac_state = &am335x_phytec_mac_state;
+		state = &am335x_phytec_boot_state;
 	};
 
 	am335x_phytec_mac_state: am335x_phytec_mac_state {
 		magic = <0x3f45620e>;
 		compatible = "barebox,state";
 		backend-type = "raw";
-		backend = <&backend_state_eeprom>;
+		backend = <&backend_state_mac_eeprom>;
 		backend-stridesize = <40>;
 		keep-previous-content;
 
@@ -37,6 +38,54 @@
 		};
 
 	};
+
+	am335x_phytec_boot_state: am335x_phytec_boot_state {
+		magic = <0x883b86a6>;
+		compatible = "barebox,state";
+		backend-type = "raw";
+		backend = <&backend_state_update_eeprom>;
+		backend-stridesize = <54>;
+		keep-previous-content;
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+		bootstate {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			last_chosen {
+				reg = <0x0 0x4>;
+				type = "uint32";
+			};
+			system0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				remaining_attempts {
+					reg = <0x4 0x4>;
+					type = "uint32";
+					default = <3>;
+				};
+				priority {
+					reg = <0x8 0x4>;
+					type = "uint32";
+					default = <21>;
+				};
+			};
+			system1 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				remaining_attempts {
+					reg = <0x10 0x4>;
+					type = "uint32";
+					default = <3>;
+				};
+				priority {
+					reg = <0x14 0x4>;
+					type = "uint32";
+					default = <20>;
+				};
+			};
+		};
+	};
 };
 
 &eeprom {
@@ -45,9 +94,13 @@
 		compatible = "fixed-partitions";
 		#size-cells = <1>;
 		#address-cells = <1>;
-		backend_state_eeprom: state@0 {
+		backend_state_mac_eeprom: state@0 {
 			reg = <0x000 0x100>;
 			label = "state-eeprom";
 		};
+		backend_state_update_eeprom: state@100 {
+			reg = <0x100 0x150>;
+			label = "update-eeprom";
+		};
 	};
 };
Signature · 7 lines
2.7.4


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

PATCH 4/4 arm: boards: phytec-som-am335x: Add bootchooser to bootsource

In reply to Teresa Remmet

From: Daniel Schultz <[email protected]>

Add bootchooser as primary boot source for NAND and eMMC.

---
 .../phytec-som-am335x/defaultenv-physom-am335x/init/bootsource    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/init/bootsource +4 -4
index 61a0879bfb7f..75b5619218c5 100644
@@ -11,13 +11,13 @@ else
 fi
 
 if [ $bootsource = mmc -a $bootsource_instance = 1 ]; then
-	global.boot.default="emmc mmc spi net"
+	global.boot.default="bootchooser emmc mmc spi net"
 elif [ $bootsource = mmc -a $bootsource_instance = 0 ]; then
 	global.boot.default="mmc $nvmem spi net"
 elif [ $bootsource = nand ]; then
-	global.boot.default="nand spi mmc net"
+	global.boot.default="bootchooser nand spi mmc net"
 elif [ $bootsource = spi ]; then
-	global.boot.default="spi $nvmem mmc net"
+	global.boot.default="spi bootchooser $nvmem mmc net"
 elif [ $bootsource = net ]; then
-	global.boot.default="net $nvmem spi mmc"
+	global.boot.default="net bootchooser $nvmem spi mmc"
 fi
Signature · 7 lines
2.7.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#5 lore raw
In reply to Teresa Remmet
Quoted 5 lines · Teresa Remmet

Hello,

this patchstack from Daniel adds bootchooser support to phytec am335x boards. I updated the patchstack to a more recent barebox version and added some small fixes.

Quoted 7 lines

Teresa

Daniel Schultz (4):
ARM: configs: omap_defconfig: Add bootchooser
ARM: dts: am335x-phytec-state: Reduce partition size
ARM: dts: am335x-phytec-state: Add state partition for bootchooser
arm: boards: phytec-som-am335x: Add bootchooser to bootsource

Applied, 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