Skip to contentSkip to conversation

ARM: dts: imx6qdl-sabresd: Fix barebox-environment location

PATCH In review Fabio Estevam 2 participants 4 messages Apr 23, 2016 – Apr 26, 2016

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH v2 1/1 ARM: dts: imx6qdl-sabresd: Fix barebox-environment location

After doing a 'saveenv' command, it is no longer possible to boot.

The reason for this behaviour is that the 'barebox' partition has currently a size of 0x80000 (512 kB), which is not sufficient to store the barebox binary. This causes the 'barebox' and 'barebox-environment' partitions to overlap.

Fix this problem by increasing the size of the 'barebox' partition and by placing the 'barebox-environment' right after it.

---
Changes since v1:
- Also adjust the partition size for 'barebox'.

 arch/arm/dts/imx6qdl-sabresd.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/dts/imx6qdl-sabresd.dtsi +3 -3
index 32318cf..690cd41 100644
@@ -31,11 +31,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xc0000>;
 	};
 
-	environment_usdhc3: partition@1 {
+	environment_usdhc3: partition@c0000 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xc0000 0x80000>;
 	};
 };
Signature · 7 lines
1.9.1


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

Hi Fabio,

Quoted 7 lines · Fabio Estevam

After doing a 'saveenv' command, it is no longer possible to boot.

The reason for this behaviour is that the 'barebox' partition has currently a size of 0x80000 (512 kB), which is not sufficient to store the barebox binary. This causes the 'barebox' and 'barebox-environment' partitions to overlap.

Quoted 7 lines

Fix this problem by increasing the size of the 'barebox' partition and by placing the 'barebox-environment' right after it.

---
Changes since v1:
- Also adjust the partition size for 'barebox'.

Since we have this problem on many i.MX boards I prefer fixing this for all affected boards, see below.

This should solve the problem for the next few years, but next time we must find a more clever solution.

Sascha

----------------------------8<-------------------------------------

From 54bddad853f07effbe55065c4864a3921c4b2e1e Mon Sep 17 00:00:00 2001
From: Sascha Hauer <[email protected]>
Date: Mon, 25 Apr 2016 08:05:29 +0200
Subject: [PATCH] ARM: i.MX: increase barebox partition sizes

After doing a 'saveenv' command, it is no longer possible to boot.

The reason for this behaviour is that the 'barebox' partition has currently
a size of 0x80000 (512 kB), which is not sufficient to store the barebox binary. This causes the 'barebox' and 'barebox-environment' partitions to overlap.

Fix this problem by increasing the size of the 'barebox' partition and by placing the 'barebox-environment' right after it.

This patch increases the barebox partition for all i.MX boards to 0xe0000

---
 arch/arm/dts/imx25-karo-tx25.dts                |  4 ++--
 arch/arm/dts/imx27-phytec-phycard-s-rdk-bb.dts  |  4 ++--
 arch/arm/dts/imx51-babbage.dts                  |  2 +-
 arch/arm/dts/imx51-genesi-efika-sb.dts          |  4 ++--
 arch/arm/dts/imx53-ccxmx53.dtsi                 |  4 ++--
 arch/arm/dts/imx53-guf-vincell-lt.dts           |  4 ++--
 arch/arm/dts/imx53-mba53.dts                    |  2 +-
 arch/arm/dts/imx53-qsb-common.dtsi              |  2 +-
 arch/arm/dts/imx53-voipac-dmm-668.dtsi          |  4 ++--
 arch/arm/dts/imx6dl-eltec-hipercam.dts          |  4 ++--
 arch/arm/dts/imx6dl-hummingboard.dts            |  4 ++--
 arch/arm/dts/imx6dl-phytec-phycore-som-nand.dts |  4 ++--
 arch/arm/dts/imx6dl-wandboard.dts               |  6 +++---
 arch/arm/dts/imx6q-dmo-edmqmx6.dts              | 12 ++++++------
 arch/arm/dts/imx6q-embedsky-e9.dts              |  8 ++++----
 arch/arm/dts/imx6q-guf-santaro.dts              |  2 +-
 arch/arm/dts/imx6q-hummingboard.dts             |  4 ++--
 arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi          |  4 ++--
 arch/arm/dts/imx6q-phytec-phycore-som-nand.dts  |  4 ++--
 arch/arm/dts/imx6q-wandboard.dts                |  6 +++---
 arch/arm/dts/imx6qdl-nitrogen6x.dtsi            |  4 ++--
 arch/arm/dts/imx6qdl-phytec-pfla02.dtsi         |  4 ++--
 arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi    |  4 ++--
 arch/arm/dts/imx6qdl-sabrelite.dtsi             |  4 ++--
 arch/arm/dts/imx6qdl-sabresd.dtsi               |  4 ++--
 arch/arm/dts/imx6s-riotboard.dts                |  2 +-
 arch/arm/dts/imx6sx-sdb.dts                     |  2 +-
 27 files changed, 56 insertions(+), 56 deletions(-)
arch/arm/dts/imx25-karo-tx25.dts +2 -2
index d661463..6e28ac9 100644
@@ -123,12 +123,12 @@
 
 	partition@0 {
 		label = "boot";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 
 	partition@2 {
arch/arm/dts/imx27-phytec-phycard-s-rdk-bb.dts +2 -2
index 3ea1b5b..daa1e0f 100644
@@ -18,12 +18,12 @@
 &nfc {
 	partition@0 {
 		label = "boot";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 
 	partition@2 {
arch/arm/dts/imx51-babbage.dts +1 -1
index f8402ca..c7eeb45 100644
@@ -29,7 +29,7 @@
 
 	environment_esdhc1: partition@0 {
 		label = "barebox-environment";
-		reg = <0x80000 0x20000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
arch/arm/dts/imx51-genesi-efika-sb.dts +2 -2
index 78cb1b7..8b237b3 100644
@@ -417,7 +417,7 @@
 
 	partition@0 {
 		label = "barebox-environment";
-		reg = <0xc0000 0x40000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
@@ -535,7 +535,7 @@
 
 		partition@0 {
 			label = "barebox-environment";
-			reg = <0x80000 0x80000>;
+			reg = <0xe0000 0x20000>;
 		};
 	};
 };
arch/arm/dts/imx53-ccxmx53.dtsi +2 -2
index 5553c68..da10757 100644
@@ -232,12 +232,12 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 
 	partition@2 {
arch/arm/dts/imx53-guf-vincell-lt.dts +2 -2
index a577ab2..d004f9f 100644
@@ -361,12 +361,12 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	bareboxenv: partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 
 	partition@2 {
arch/arm/dts/imx53-mba53.dts +1 -1
index c908c61..cca1383 100644
@@ -30,7 +30,7 @@
 
 	partition@0 {
 		label = "environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
arch/arm/dts/imx53-qsb-common.dtsi +1 -1
index 85e1b8b..5dd1e4e 100644
@@ -45,7 +45,7 @@
 
 	bareboxenv: partition@0 {
 		label = "barebox-environment";
-		reg = <0x80000 0x20000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
arch/arm/dts/imx53-voipac-dmm-668.dtsi +2 -2
index 6f76d28..f7eed8d 100644
@@ -15,12 +15,12 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 
 	partition@2 {
arch/arm/dts/imx6dl-eltec-hipercam.dts +2 -2
index f272e78..7f7746c 100644
@@ -37,12 +37,12 @@
 
 		partition@0 {
 			label = "barebox";
-			reg = <0x0 0xc0000>;
+			reg = <0x0 0xe0000>;
 		};
 
 		environment_nor0: partition@1 {
 			label = "bareboxenv";
-			reg = <0xc0000 0x8000>;
+			reg = <0xe0000 0x20000>;
 		};
 
 		partition@2 {
arch/arm/dts/imx6dl-hummingboard.dts +2 -2
index 2314965..0152d6f 100644
@@ -29,11 +29,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6dl-phytec-phycore-som-nand.dts +2 -2
index 2324f3a..2fce915 100644
@@ -53,11 +53,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6dl-wandboard.dts +3 -3
index a867400..873e9d6 100644
@@ -27,11 +27,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0xc0000>;
+		reg = <0x0 0xe0000>;
 	};
 
-	environment_usdhc3: partition@c0000 {
+	environment_usdhc3: partition@e0000 {
 		label = "barebox-environment";
-		reg = <0xc0000 0x40000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6q-dmo-edmqmx6.dts +6 -6
index 071f5f5..d0362f5 100644
@@ -53,12 +53,12 @@
 
 		partition@0 {
 			label = "barebox";
-			reg = <0x0 0x80000>;
+			reg = <0x0 0xe0000>;
 		};
 
 		partition@1 {
 			label = "barebox-environment";
-			reg = <0x80000 0x20000>;
+			reg = <0xe0000 0x20000>;
 		};
 	};
 };
@@ -97,11 +97,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 	partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
@@ -111,10 +111,10 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 	partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6q-embedsky-e9.dts +4 -4
index 726d620..c4a9e41 100644
@@ -41,11 +41,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 	environment_mmc1: partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
@@ -55,10 +55,10 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 	environment_mmc3: partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6q-guf-santaro.dts +1 -1
index 27f538a..74731d4 100644
@@ -589,7 +589,7 @@
 
 	partition@0 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
arch/arm/dts/imx6q-hummingboard.dts +2 -2
index e1d2fa8..0a83e80 100644
@@ -29,11 +29,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6q-phytec-pcaaxl3.dtsi +2 -2
index 0522465..107100e 100644
@@ -181,10 +181,10 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 	environment_usdhc3: partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6q-phytec-phycore-som-nand.dts +2 -2
index 06f2f71..b4564c2 100644
@@ -62,11 +62,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6q-wandboard.dts +3 -3
index 26d8a00..0606727 100644
@@ -27,11 +27,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0xc0000>;
+		reg = <0x0 0xe0000>;
 	};
 
-	environment_usdhc3: partition@c0000 {
+	environment_usdhc3: partition@e0000 {
 		label = "barebox-environment";
-		reg = <0xc0000 0x40000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6qdl-nitrogen6x.dtsi +2 -2
index 8fcd4e4..4a6b724 100644
@@ -31,12 +31,12 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
arch/arm/dts/imx6qdl-phytec-pfla02.dtsi +2 -2
index b79ce2c..c3a0aa8 100644
@@ -180,11 +180,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi +2 -2
index 2a975d1..12f6766 100644
@@ -256,11 +256,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6qdl-sabrelite.dtsi +2 -2
index d5a6ff4..4de3aea 100644
@@ -31,12 +31,12 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
arch/arm/dts/imx6qdl-sabresd.dtsi +2 -2
index 32318cf..f8746fa 100644
@@ -31,11 +31,11 @@
 
 	partition@0 {
 		label = "barebox";
-		reg = <0x0 0x80000>;
+		reg = <0x0 0xe0000>;
 	};
 
 	environment_usdhc3: partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
arch/arm/dts/imx6s-riotboard.dts +1 -1
index 3d0a930..322dab0 100644
@@ -235,7 +235,7 @@
 
 	environment_usdhc4: partition@1 {
 		label = "barebox-environment";
-		reg = <0x80000 0x80000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
arch/arm/dts/imx6sx-sdb.dts +1 -1
index fbf098b..3cd1401 100644
@@ -54,7 +54,7 @@
 
 	partition@0 {
 		label = "barebox-environment";
-		reg = <0x80000 0x20000>;
+		reg = <0xe0000 0x20000>;
 	};
 };
 
Signature · 12 lines
2.8.0.rc3

-- 
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
author reviewer
#2 lore raw

Hi Sascha,

arch/arm/dts/imx25-karo-tx25.dts line 129

Quoted 13 lines · Sascha Hauer
arch/arm/dts/imx25-karo-tx25.dts +1 -1
index d661463..6e28ac9 100644
@@ -123,12 +123,12 @@
 
        partition@0 {
                label = "boot";
-               reg = <0x0 0x80000>;
+               reg = <0x0 0xe0000>;
        };
 
        partition@1 {

This should be "partition@0xe0000 {" to match the 'reg' property below.

arch/arm/dts/imx25-karo-tx25.dts line 131

Quoted 3 lines
arch/arm/dts/imx25-karo-tx25.dts +1 -1
                label = "environment";
-               reg = <0x80000 0x80000>;
+               reg = <0xe0000 0x20000>;

Same applies to other files.

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

maintainer
#3 lore raw
Quoted 16 lines · Fabio Estevam

Hi Sascha,

Quoted 12 lines · Sascha Hauer
arch/arm/dts/imx25-karo-tx25.dts +1 -1
index d661463..6e28ac9 100644
@@ -123,12 +123,12 @@
 
        partition@0 {
                label = "boot";
-               reg = <0x0 0x80000>;
+               reg = <0x0 0xe0000>;
        };
 
Quoted 3 lines

arch/arm/dts/imx25-karo-tx25.dts line 129

Quoted 1 line
arch/arm/dts/imx25-karo-tx25.dts +0 -0
        partition@1 {

This should be "partition@0xe0000 {" to match the 'reg' property below.

Indeed, that's something I wanted to fix for longer now. I finally did this ;)

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