ARM: dts: aspeed: Add an alt 128M flash layout.
Subsystems (2)
v3 cover ARM: dts: aspeed: Add an alt 128M flash layout.
Add a layout for an alternate 128M flash layout. This is useful for the aspeed ast2500[2] and ast2600[1] SoCs, where it has the ability to boot from one of two spi chips, nominally the primary and backup SPIs. Adding a layout allows userspace to flash the alternate spi by partition and switch over to it, allowing lower downtime for firmware flash, or for updating the primary flash from the golden backup flash. This is already an established scheme for the 32M and 64M layouts, where the layout is the same but each partition has alt prepended to its name. This allows userspace to just prepend alt to the images in the update process to specify which flash chip to update. This series also adds support for the msx4 to use this layout.
References:
[1] https://www.aspeedtech.com/server_ast2600/
[2] https://www.aspeedtech.com/server_ast2500/
---
Changes in v3:
- Reworded commit adding alt flash layout and fixed formatting issues
- Expanded testing section
- Readded the Changes in v2 section, somehow they got lost
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Retargetted series for the bmc tree
- Added a usage of the dtsi in the MSX4 device tree
- Link to v1: https://lore.kernel.org/all/[email protected]/
---
Marc Olberding (2):
ARM: dts: aspeed: add an alt 128M flash layout
ARM: dts: aspeed: Add alt partition support to msx4
.../boot/dts/aspeed/aspeed-bmc-nvidia-msx4-bmc.dts | 1 + .../dts/aspeed/openbmc-flash-layout-128-alt.dtsi | 32 ++++++++++++++++++++++ 2 files changed, 33 insertions(+)
---
base-commit: 459a5aa171c0f13fcd78faa9594dc4aa5a95770b
change-id: 20251218-alt-128-19270d894872
Best regards,
Signature · 1 line
Marc Olberding <[email protected]>
PATCH v3 1/2 ARM: dts: aspeed: add an alt 128M flash layout
Add a 128M layout for the BMC flash chip we didn't boot from. Including this allows the user to write to each partition on the alternate spi chip. This dtsi follows the existing standard of using the same layout as non alt version and prepending alt to each partition's name.
Tested by running on target and catting sysfs nodes
for devdir in /sys/class/mtd/mtd*; do
[[ -d $devdir && -r $devdir/name ]] || continue
name=$(<"$devdir/name")
[[ $name == alt* ]] || continue
size=$(<"$devdir/size")
offset=0
[[ -r $devdir/offset ]] && offset=$(<"$devdir/offset")
dev=$(basename "$devdir")
printf "%s name=%s offset=0x%X size=0x%X\n" "$dev" "$name" \
"$offset" "$size"
done
mtd10 name=alt-rofs offset=0xA00000 size=0x5600000
mtd11 name=alt-rwfs offset=0x6000000 size=0x2000000
mtd7 name=alt-u-boot offset=0x0 size=0xE0000
mtd8 name=alt-u-boot-env offset=0xE0000 size=0x20000
mtd9 name=alt-kernel offset=0x100000 size=0x900000Ran dtbs check, no errors from the msx4 dts
running diff between the main and alt flash layouts shows that the only diff is alt prepended to the partition labels, as expected.
--- .../dts/aspeed/openbmc-flash-layout-128-alt.dtsi | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+)
arch/arm/boot/dts/aspeed/openbmc-flash-layout-128-alt.dtsi new file +32 -0
@@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0+ + +partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + u-boot@0 { + reg = <0x0 0xe0000>; // 896KB + label = "alt-u-boot"; + }; + + u-boot-env@e0000 { + reg = <0xe0000 0x20000>; // 128KB + label = "alt-u-boot-env"; + }; + + kernel@100000 { + reg = <0x100000 0x900000>; // 9MB + label = "alt-kernel"; + }; + + rofs@a00000 { + reg = <0xa00000 0x5600000>; // 86MB + label = "alt-rofs"; + }; + + rwfs@6000000 { + reg = <0x6000000 0x2000000>; // 32MB + label = "alt-rwfs"; + }; +};
Signature · 1 line
2.34.1
Re: [PATCH v3 1/2] ARM: dts: aspeed: add an alt 128M flash layout
Quoted 6 lines · Marc Olberding
Add a 128M layout for the BMC flash chip we didn't boot from. Including this allows the user to write to each partition on the alternate spi chip. This dtsi follows the existing standard of using the same layout as non alt version and prepending
altto each partition's name.Tested by running on target and catting sysfs nodes
You cannot test this patch that way - DTSI is not included by anything. This probably should be squashed with next one because makes little benefit on its own,
Quoted 20 lines
for devdir in /sys/class/mtd/mtd*; do
[[ -d $devdir && -r $devdir/name ]] || continue
name=$(<"$devdir/name")
[[ $name == alt* ]] || continue
size=$(<"$devdir/size")
offset=0
[[ -r $devdir/offset ]] && offset=$(<"$devdir/offset")
dev=$(basename "$devdir")
printf "%s name=%s offset=0x%X size=0x%X\n" "$dev" "$name" \
"$offset" "$size"
done
mtd10 name=alt-rofs offset=0xA00000 size=0x5600000
mtd11 name=alt-rwfs offset=0x6000000 size=0x2000000
mtd7 name=alt-u-boot offset=0x0 size=0xE0000
mtd8 name=alt-u-boot-env offset=0xE0000 size=0x20000
mtd9 name=alt-kernel offset=0x100000 size=0x900000Quoted 1 line
Ran dtbs check, no errors from the msx4 dts
Drop this sentence, it's implied. There is no point to state obvious, e.g. that you build source code, in the commit msg. It serves no purpose in the git history. You also have changelog for such things, if you want to emphasize.
Quoted 3 lines
running diff between the main and alt flash layouts shows that the only diff is alt prepended to the partition labels, as expected.
? Not sure what you want to say, but please do not explain us how DTS works (in case this was about DTS).
Best regards,
Krzysztof
Re: [PATCH v3 1/2] ARM: dts: aspeed: add an alt 128M flash layout
Quoted 4 lines · Krzysztof Kozlowski
On 20/01/2026 20:26, Marc Olberding wrote:
You cannot test this patch that way - DTSI is not included by anything. This probably should be squashed with next one because makes little benefit on its own,
Ack, will do in the next patch series.
Quoted 7 lines
Quoted 2 lines
Ran dtbs check, no errors from the msx4 dts
Drop this sentence, it's implied. There is no point to state obvious, e.g. that you build source code, in the commit msg. It serves no purpose in the git history. You also have changelog for such things, if you want to emphasize.
ack, will drop.
Quoted 6 lines
Quoted 3 lines
running diff between the main and alt flash layouts shows that the only diff is alt prepended to the partition labels, as expected.
? Not sure what you want to say, but please do not explain us how DTS works (in case this was about DTS).
I'll drop this piece. This was a recommended piece of testing by Andrew, the maintainer, just to show that the alt partition and main partition files are only different by the label names. That said, its redundant with the testing on target shown above.
Thanks for your feedback
Marc
PATCH v3 2/2 ARM: dts: aspeed: Add alt partition support to msx4
In reply to Marc OlberdingAdd support for the alt 128M partition table to the msx4. This allows it program the flash it didn't boot from by partition.
--- arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-msx4-bmc.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-msx4-bmc.dts +1 -0
@@ -67,6 +67,7 @@ flash@1 { spi-tx-bus-width = <1>; spi-rx-bus-width = <1>; status = "okay"; + #include "openbmc-flash-layout-128-alt.dtsi" }; };
Signature · 1 line
2.34.1