From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 30 Jun 2025 13:11:40 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uWCQG-00CbGe-0w for lore@lore.pengutronix.de; Mon, 30 Jun 2025 13:11:40 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1uWCQF-0007OM-UF; Mon, 30 Jun 2025 13:11:39 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1uWCQC-0007HK-1J; Mon, 30 Jun 2025 13:11:36 +0200 Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uWCQB-0065mz-2l; Mon, 30 Jun 2025 13:11:35 +0200 Received: from rhi by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1uWCQB-006sxs-2c; Mon, 30 Jun 2025 13:11:35 +0200 From: Roland Hieber To: distrokit@pengutronix.de Date: Mon, 30 Jun 2025 13:11:32 +0200 Message-Id: <20250630111132.1640822-2-rhi@pengutronix.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250630111132.1640822-1-rhi@pengutronix.de> References: <20250630111132.1640822-1-rhi@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [PATCH 2/2] v7a: vexpress: harmonize barebox partition layout X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ahmad Fatoum , Roland Hieber Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false 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 Signed-off-by: Roland Hieber --- 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 +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 +[rhi: picked from https://lore.barebox.org/barebox/20250624183930.2733353-1-a.fatoum@pengutronix.de/ ] +Signed-off-by: Roland Hieber +--- + 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