mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] ARM: dts: state-example: fix use with Phytec phyFLEX i.MX6
Date: Thu,  8 Jun 2023 08:58:05 +0200	[thread overview]
Message-ID: <20230608065805.3095109-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2023-06-08  6:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08  6:58 Ahmad Fatoum [this message]
2023-06-09  6:44 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230608065805.3095109-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox