DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: distrokit@pengutronix.de
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
	Roland Hieber <rhi@pengutronix.de>
Subject: [DistroKit] [PATCH 2/2] v7a: vexpress: harmonize barebox partition layout
Date: Mon, 30 Jun 2025 13:11:32 +0200	[thread overview]
Message-ID: <20250630111132.1640822-2-rhi@pengutronix.de> (raw)
In-Reply-To: <20250630111132.1640822-1-rhi@pengutronix.de>

Since commit 5c519849029d ("v7a: vexpress: switch to upstream barebox
recipe"), we switched to the upstream barebox recipe for the vexpress
platform, which increased the size of the barebox binary to 940KiB.
However, due to the fixed partition layout in the vexpress device trees,
barebox still thinks that the environment partition starts at offset
512K, so executing a "saveenv" will overwrite the barebox image in NOR
flash, and Qemu will fail to boot on the next run.

Pick a patch from the mailing list that increases the fixed barebox
and the environment partitions in the device tree 2M each, and harmonize
our genimage setup too.

Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---

Note: this applies on top of
"[PATCH v3] ptxdist: version bump 2025.05.0 -> 2025.06.0"
https://lore.distrokit.org/distrokit/20250627123252.1985354-1-rhi@pengutronix.de

 .../config/images/vexpress-nor.config         |  4 +-
 ...ress-increase-barebox-partition-size.patch | 74 +++++++++++++++++++
 patches/barebox-2025.06.1/series              |  4 +
 3 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 patches/barebox-2025.06.1/0001-ARM-vexpress-increase-barebox-partition-size.patch
 create mode 100644 patches/barebox-2025.06.1/series

diff --git a/configs/platform-v7a/config/images/vexpress-nor.config b/configs/platform-v7a/config/images/vexpress-nor.config
index 6dc983325ee5..5b6c6ebf6424 100644
--- a/configs/platform-v7a/config/images/vexpress-nor.config
+++ b/configs/platform-v7a/config/images/vexpress-nor.config
@@ -5,6 +5,8 @@ image @IMAGE@ {
 		partition-table-type = none
 		fill = true
 	}
+	/* Keep these partitions in sync with the fixed partition layout in
+	   barebox/arch/arm/dts/vexpress-v2p-ca*.dts! */
 	partition barebox {
 		image = barebox-vexpress-ca9.img
 		offset = 0
@@ -18,7 +20,7 @@ image @IMAGE@ {
 	}
 	partition barebox-state {
 		image = /dev/null
-		offset = 3M
+		offset = 4M
 		in-partition-table = false
 		size = 1M
 	}
diff --git a/patches/barebox-2025.06.1/0001-ARM-vexpress-increase-barebox-partition-size.patch b/patches/barebox-2025.06.1/0001-ARM-vexpress-increase-barebox-partition-size.patch
new file mode 100644
index 000000000000..db5d40032ee9
--- /dev/null
+++ b/patches/barebox-2025.06.1/0001-ARM-vexpress-increase-barebox-partition-size.patch
@@ -0,0 +1,74 @@
+From: Ahmad Fatoum <a.fatoum@pengutronix.de>
+Date: Tue, 24 Jun 2025 20:39:30 +0200
+Subject: [PATCH] ARM: vexpress: increase barebox partition size
+
+Commit 3630fa400be5 ("ARM: remove vexpress_defconfig") made
+multi_v7_defconfig the go-to defconfig for vexpress.
+
+The multi defconfig enables a lot of drivers and functionality though
+increasing the image size from 300K to 1.2M, which causes barebox to
+extend beyond the previously configured 512K barebox partition.
+
+Fix this by giving each of barebox and its environment 2M of space,
+which should be enough for many years to come.
+
+Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
+[rhi: picked from https://lore.barebox.org/barebox/20250624183930.2733353-1-a.fatoum@pengutronix.de/ ]
+Signed-off-by: Roland Hieber <rhi@pengutronix.de>
+---
+ arch/arm/dts/vexpress-v2p-ca15.dts | 11 ++++++++---
+ arch/arm/dts/vexpress-v2p-ca9.dts  | 10 +++++-----
+ 2 files changed, 13 insertions(+), 8 deletions(-)
+
+diff --git a/arch/arm/dts/vexpress-v2p-ca15.dts b/arch/arm/dts/vexpress-v2p-ca15.dts
+index acf4e023d5cd..891e6dbbe4b4 100644
+--- a/arch/arm/dts/vexpress-v2p-ca15.dts
++++ b/arch/arm/dts/vexpress-v2p-ca15.dts
+@@ -19,12 +19,17 @@ partitions {
+ 
+ 		partition@0 {
+ 			label = "barebox";
+-			reg = <0x0 0x80000>;
++			reg = <0x0 0x200000>;
+ 		};
+ 
+-		barebox_env: partition@80000 {
++		barebox_env: partition@200000 {
+ 			label = "barebox-environment";
+-			reg = <0x80000 0x80000>;
++			reg = <0x200000 0x200000>;
++		};
++
++		state_storage: partition@400000 {
++			label = "barebox-state";
++			reg = <0x400000 0x100000>;
+ 		};
+ 	};
+ };
+diff --git a/arch/arm/dts/vexpress-v2p-ca9.dts b/arch/arm/dts/vexpress-v2p-ca9.dts
+index d1484ff4b0a9..c320f67c2371 100644
+--- a/arch/arm/dts/vexpress-v2p-ca9.dts
++++ b/arch/arm/dts/vexpress-v2p-ca9.dts
+@@ -77,17 +77,17 @@ partitions {
+ 
+ 		partition@0 {
+ 			label = "barebox";
+-			reg = <0x0 0x80000>;
++			reg = <0x0 0x200000>;
+ 		};
+ 
+-		barebox_env: partition@80000 {
++		barebox_env: partition@200000 {
+ 			label = "barebox-environment";
+-			reg = <0x80000 0x80000>;
++			reg = <0x200000 0x200000>;
+ 		};
+ 
+-		state_storage: partition@100000 {
++		state_storage: partition@400000 {
+ 			label = "barebox-state";
+-			reg = <0x100000 0x100000>;
++			reg = <0x400000 0x100000>;
+ 		};
+ 	};
+ };
diff --git a/patches/barebox-2025.06.1/series b/patches/barebox-2025.06.1/series
new file mode 100644
index 000000000000..e04bbe55d2d4
--- /dev/null
+++ b/patches/barebox-2025.06.1/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-ARM-vexpress-increase-barebox-partition-size.patch
+# 292dd68941cabc5983505876cd411f46  - git-ptx-patches magic
-- 
2.39.5




      reply	other threads:[~2025-06-30 11:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30 11:11 [DistroKit] [PATCH 1/2] v7a: barebox: version bump 2025.06.0 -> 2025.06.1 Roland Hieber
2025-06-30 11:11 ` Roland Hieber [this message]

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=20250630111132.1640822-2-rhi@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=distrokit@pengutronix.de \
    /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