mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: state-example: fix use with Phytec phyFLEX i.MX6
@ 2023-06-08  6:58 Ahmad Fatoum
  2023-06-09  6:44 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-06-08  6:58 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The state-example.dtsi was added 5 years ago and while the binding is
still applicable, the imx6q-phytec-pbab01.dts device tree that it
extends when USE_STATE_EXAMPLE is defined has changed in a way that
breaks use of the state nodes.

Do the necessary to restore the examples to working order:

  - Reference the NOR partition inside of the fixed-partition container
    it's inside now

  - Resize the NAND, so the last 1M of the barebox 16M partition can
    be used for state. Also use the fixed-partition container that
    has been added in the meantime.

  - Use phandles or label-relative paths, so we get build errors
    if the path changes again in future

There's still a WARNING: state_nor: Failed to initialize desired amount
of buckets, only 2 of 3 succeeded, but that can be fixed separately.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
I don't know how to fix the warning. Setting backend-stridesize = <64>
didn't help. I've CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
---
 arch/arm/dts/state-example.dtsi | 41 +++++++++++++++++----------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/arch/arm/dts/state-example.dtsi b/arch/arm/dts/state-example.dtsi
index 490ee7840b24..4572168336ae 100644
--- a/arch/arm/dts/state-example.dtsi
+++ b/arch/arm/dts/state-example.dtsi
@@ -89,28 +89,29 @@ state_eeprom: state_eeprom {
 
 };
 
-&ecspi3 {
-	flash@0 {
-		backend_state_nor: partition@120000 {
-		};
+backend_state_nor: &{ecspi3/flash@0/partitions/partition@120000} {
+};
+
+/* Reduce barebox partition size from 16M to 15M */
+&{gpmi/partitions/partition@0} {
+	reg = <0x0 0xf00000>;
+};
+
+&{gpmi/partitions} {
+	backend_state_nand: partition@f00000 {
+		label = "barebox-state";
+		reg = <0xf00000 0x100000>;
 	};
 };
 
-&gpmi {
-	backend_state_nand: partition@500000 {
-	};
-};
-
-&i2c1 {
-	eeprom@50 {
-		partitions {
-			compatible = "fixed-partitions";
-			#size-cells = <1>;
-			#address-cells = <1>;
-			backend_state_eeprom: state@400 {
-				reg = <0x400 0x400>;
-				label = "state-eeprom";
-			};
+&som_eeprom { /* On I2C1 */
+	partitions {
+		compatible = "fixed-partitions";
+		#size-cells = <1>;
+		#address-cells = <1>;
+		backend_state_eeprom: state@400 {
+			reg = <0x400 0x400>;
+			label = "state-eeprom";
 		};
 	};
 };
@@ -125,4 +126,4 @@ backend_state_usdhc: state@0x80000 {
 			label = "state-sd";
 		};
 	};
-};
\ No newline at end of file
+};
-- 
2.39.2




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

end of thread, other threads:[~2023-06-09  6:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-08  6:58 [PATCH] ARM: dts: state-example: fix use with Phytec phyFLEX i.MX6 Ahmad Fatoum
2023-06-09  6:44 ` Sascha Hauer

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