Repository navigation
[25.12] airoha: an7581: add uboot chainloader - #22294
Conversation
|
Ping @hauke |
maurerle
left a comment
There was a problem hiding this comment.
I run-tested this with openwrt-25.12 and would like to see this merged.
|
Hi @Ansuel do you mind approving this backport please so W1700K can make it into 25.12? |
|
Will just need to make a quick revision to this to fix the BMT partition size (#23061) and we're good. |
|
@hurrian any update here? |
|
Maybe @robimarko can approve :) |
|
Wait a moment - #23061 was just merged into |
|
Please use git cherry-pick -x for cherry-picking so that we have a proper |
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
9388d91e49"uboot-airoha: rename FIP_COMPRESS to LZMA_COMPRESS" — missing(cherry picked from commit 97035a5e7f5b46407c5677cdfb9c2891e417a70a)trailer.79aa219982"airoha: an7581: add uboot chainloader" — missing(cherry picked from commit 442e67d31f3c8b8c43ecc59d25660faf8e824f31)trailer. Also, the cherry-pick diverges from the upstream commit by enabling&switchinstead of&gdm1in the 999 patch; the commit body should explain why (it depends on the new 307 ethernet-node patch, which is backport-only).4b5a6535e2"uboot-airoha: add ethernet node for an7581 dtsi" — no upstream commit onmain; this is a backport-only addition needed because 25.12 uses U-Boot 2025.10. The commit body should say so explicitly so it is not mistaken for a missed cherry-pick.445afae2d6"uboot-airoha: add a label to the spi node" — missing(cherry picked from commit 133e01b95e83aeec7b34893de35c2dd15ad0f705)trailer.4f6f8abcba"airoha: an7581: enable fitblk driver" — missing(cherry picked from commit 0a64ed27a7978389915f16fedcee73ffcabc5258)trailer.61e167cb3c"airoha: an7581: add ubi nvmem driver" — missing(cherry picked from commit e46853426356d905a27665b545fe9048c9e3a001)trailer.
Missing prerequisite cherry-pick: ee771d3dd01c811d2a28eab09a700cefdafd05af ("airoha: increase the size of reserved_bmt partition", #23061) has been on main since 2026-04-22 and updates the partition layout in the 999 patch that this PR introduces. See inline comment on the partition hunk.
Generated by Claude Code
61e167c to
10c5910
Compare
|
Rebased to 25.12 branch and resolved review comments. |
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 7 new commits; no new issues found.
All concerns from the previous review have been addressed: the five cherry-pick commits now carry their (cherry picked from commit <sha>) trailers, the &gdm1 → &switch divergence has been moved into a dedicated commit (2ef9685038) whose body explains it's a backport-only addition required because U-Boot 2025.10 lacks the ethernet/switch nodes, and the prerequisite ee771d3dd0 from #23061 has been cherry-picked as dfb6bd0bac (partial cherry-pick limited to the 999 patch is documented in the commit body — compat_version deferred until the device-support commit lands on 25.12).
Generated by Claude Code
|
@hurrian just confirming my understanding, @andrewjlamarche's PR #22374 is expected to set the W1700K's compat version to 2.0 so that a user who flashes whichever OpenWRT 25.12.x release supports this device can then upgrade to a post-25.12 OpenWRT release without issue, correct? |
That's correct, no point merging support for an unsupported (and broken) configuration. |
It is more accurate to describe the contents of the FIP as compressed, instead of the FIP itself becoming compressed. Update variable naming accordingly. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 97035a5) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Due to issues surrounding the implementation of the vendor BMT/BBT on Airoha, upstream ATF + uboot has switched to UBI flash partitions. However, some devices shipped on this platform are bootloader locked, and thus it is impossible to replace ATF + uboot. During testing for the Gemtek W1700K (openwrt#17869), sysupgrades from Linux (which is unaware of the underlying BMT/BBT) would occasionally write data into blocks which were remapped by the vendor uboot when it was read on the following reboot, causing a soft brick. An acceptable workaround [1],[2] was discussed where an intermediate uboot would be written by the vendor uboot (which is aware of Airoha BMT/BBT). This chainloader would then ignore the regions of flash used by the vendor uboot, and store all relevant data inside of UBI. UBI would then be used to handle bad block management. As the vendor ATF + uboot do not read or interact with the UBI region, we would avoid unwanted remaps from BMT/BBT. This commit introduces support for building such a chainloader, by packaging u-boot and DTS into a FIT image; to be flashed like a kernel. Configuration for the Gemtek W1700K is provided as an example of how the chainloader is used. [1] openwrt#17869 (comment) [2] openwrt#17869 (comment) Signed-off-by: Kenneth Kasilag <[email protected]> [ move FIP_COMPRESS to Build/Compile, wrap some long lines ] Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 442e67d) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
The vendor firmware checks for a bmt header in the last 528 erase blocks of flash. The OpenWrt partition table did not respect that requirement, and therefore the vendor and openwrt chainloader fight over those blocks on every boot, potentially corrupting data stored in UBI blocks there. This commit increases the size of the reserved_bmt partition to avoid that fight. Although the vendor bootloader only seems to touch the final 250 erase blocks[1], the original vendor firmware system partition ended at 0x1be00000[2], so to be conservative, the consensus is to use that as the end of mtd2 (ubi) partition and leave the last 528 blocks for mtd3 (reserved_bmt). From https://openwrt.org/toh/gemtek/mxf-w1700k: [1] OEM bootlog: [ 5.324337] bmt pool size: 250 [2] OEM bootlog: [ 5.478927] 0x000008600000-0x00001be00000 : "system" For the backport to OpenWrt 25.12, the device support has not yet been committed, so revising the compat_version in this commit is not needed; and instead will be handled by revising the pending device support commit. Reported-by: Loïc Yhuel <[email protected]> Signed-off-by: Russell Senior <[email protected]> Link: openwrt#23061 (cherry picked from commit ee771d3) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
For the backport to U-boot 2025.10, the ethernet driver (airoha_eth) supports an7581 however it is not declared in the dtsi. Add the ethernet node for the built in airoha ethernet controller. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Add a label to the spi node to allow device trees to reference it (i.e. to mark status = "okay"). Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 133e01b) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 0a64ed2) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Add ubi nvmem driver, required to load nvmem entries from ubi volumes Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit e468534) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
10c5910 to
e4c15eb
Compare
|
Thanks! Rebased on top of openwrt-25.12 and merged! |
It is more accurate to describe the contents of the FIP as compressed, instead of the FIP itself becoming compressed. Update variable naming accordingly. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt/openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 97035a5) Link: openwrt/openwrt#22294 Signed-off-by: Robert Marko <[email protected]> (cherry picked from commit 8e751e953d13f06796f0faa4f02e0b88de5e6f4e)
Due to issues surrounding the implementation of the vendor BMT/BBT on Airoha, upstream ATF + uboot has switched to UBI flash partitions. However, some devices shipped on this platform are bootloader locked, and thus it is impossible to replace ATF + uboot. During testing for the Gemtek W1700K (#17869), sysupgrades from Linux (which is unaware of the underlying BMT/BBT) would occasionally write data into blocks which were remapped by the vendor uboot when it was read on the following reboot, causing a soft brick. An acceptable workaround [1],[2] was discussed where an intermediate uboot would be written by the vendor uboot (which is aware of Airoha BMT/BBT). This chainloader would then ignore the regions of flash used by the vendor uboot, and store all relevant data inside of UBI. UBI would then be used to handle bad block management. As the vendor ATF + uboot do not read or interact with the UBI region, we would avoid unwanted remaps from BMT/BBT. This commit introduces support for building such a chainloader, by packaging u-boot and DTS into a FIT image; to be flashed like a kernel. Configuration for the Gemtek W1700K is provided as an example of how the chainloader is used. [1] openwrt/openwrt#17869 (comment) [2] openwrt/openwrt#17869 (comment) Signed-off-by: Kenneth Kasilag <[email protected]> [ move FIP_COMPRESS to Build/Compile, wrap some long lines ] Link: openwrt/openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 442e67d) Link: openwrt/openwrt#22294 Signed-off-by: Robert Marko <[email protected]> (cherry picked from commit 887f21e21ab2f598f24d1793b6b0f38543b6aa35)
The vendor firmware checks for a bmt header in the last 528 erase blocks of flash. The OpenWrt partition table did not respect that requirement, and therefore the vendor and openwrt chainloader fight over those blocks on every boot, potentially corrupting data stored in UBI blocks there. This commit increases the size of the reserved_bmt partition to avoid that fight. Although the vendor bootloader only seems to touch the final 250 erase blocks[1], the original vendor firmware system partition ended at 0x1be00000[2], so to be conservative, the consensus is to use that as the end of mtd2 (ubi) partition and leave the last 528 blocks for mtd3 (reserved_bmt). From https://openwrt.org/toh/gemtek/mxf-w1700k: [1] OEM bootlog: [ 5.324337] bmt pool size: 250 [2] OEM bootlog: [ 5.478927] 0x000008600000-0x00001be00000 : "system" For the backport to OpenWrt 25.12, the device support has not yet been committed, so revising the compat_version in this commit is not needed; and instead will be handled by revising the pending device support commit. Reported-by: Loïc Yhuel <[email protected]> Signed-off-by: Russell Senior <[email protected]> Link: openwrt/openwrt#23061 (cherry picked from commit ee771d3dd01c811d2a28eab09a700cefdafd05af) Link: openwrt/openwrt#22294 Signed-off-by: Robert Marko <[email protected]> (cherry picked from commit 4729793b915e585800a3334f8d22639e2e6a3512)
For the backport to U-boot 2025.10, the ethernet driver (airoha_eth) supports an7581 however it is not declared in the dtsi. Add the ethernet node for the built in airoha ethernet controller. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt/openwrt#22294 Signed-off-by: Robert Marko <[email protected]> (cherry picked from commit aa3a9d8fa2b634e6dd3906c21c7ae508eb9aa271)
Add a label to the spi node to allow device trees to reference it (i.e. to mark status = "okay"). Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt/openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 133e01b) Link: openwrt/openwrt#22294 Signed-off-by: Robert Marko <[email protected]> (cherry picked from commit fac5a815ea128a6d36d8c4fe69f4692cb3c7466c)
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt/openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 0a64ed2) Link: openwrt/openwrt#22294 Signed-off-by: Robert Marko <[email protected]> (cherry picked from commit feda35516cf65c770282ca56cee6bef2d7421e9a)
Add ubi nvmem driver, required to load nvmem entries from ubi volumes Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt/openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit e468534) Link: openwrt/openwrt#22294 Signed-off-by: Robert Marko <[email protected]> (cherry picked from commit e4c15eb1a0b408f33c42ab06f71045f4ff3e5db4)
It is more accurate to describe the contents of the FIP as compressed, instead of the FIP itself becoming compressed. Update variable naming accordingly. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 97035a5) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Due to issues surrounding the implementation of the vendor BMT/BBT on Airoha, upstream ATF + uboot has switched to UBI flash partitions. However, some devices shipped on this platform are bootloader locked, and thus it is impossible to replace ATF + uboot. During testing for the Gemtek W1700K (openwrt#17869), sysupgrades from Linux (which is unaware of the underlying BMT/BBT) would occasionally write data into blocks which were remapped by the vendor uboot when it was read on the following reboot, causing a soft brick. An acceptable workaround [1],[2] was discussed where an intermediate uboot would be written by the vendor uboot (which is aware of Airoha BMT/BBT). This chainloader would then ignore the regions of flash used by the vendor uboot, and store all relevant data inside of UBI. UBI would then be used to handle bad block management. As the vendor ATF + uboot do not read or interact with the UBI region, we would avoid unwanted remaps from BMT/BBT. This commit introduces support for building such a chainloader, by packaging u-boot and DTS into a FIT image; to be flashed like a kernel. Configuration for the Gemtek W1700K is provided as an example of how the chainloader is used. [1] openwrt#17869 (comment) [2] openwrt#17869 (comment) Signed-off-by: Kenneth Kasilag <[email protected]> [ move FIP_COMPRESS to Build/Compile, wrap some long lines ] Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 442e67d) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
The vendor firmware checks for a bmt header in the last 528 erase blocks of flash. The OpenWrt partition table did not respect that requirement, and therefore the vendor and openwrt chainloader fight over those blocks on every boot, potentially corrupting data stored in UBI blocks there. This commit increases the size of the reserved_bmt partition to avoid that fight. Although the vendor bootloader only seems to touch the final 250 erase blocks[1], the original vendor firmware system partition ended at 0x1be00000[2], so to be conservative, the consensus is to use that as the end of mtd2 (ubi) partition and leave the last 528 blocks for mtd3 (reserved_bmt). From https://openwrt.org/toh/gemtek/mxf-w1700k: [1] OEM bootlog: [ 5.324337] bmt pool size: 250 [2] OEM bootlog: [ 5.478927] 0x000008600000-0x00001be00000 : "system" For the backport to OpenWrt 25.12, the device support has not yet been committed, so revising the compat_version in this commit is not needed; and instead will be handled by revising the pending device support commit. Reported-by: Loïc Yhuel <[email protected]> Signed-off-by: Russell Senior <[email protected]> Link: openwrt#23061 (cherry picked from commit ee771d3) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
For the backport to U-boot 2025.10, the ethernet driver (airoha_eth) supports an7581 however it is not declared in the dtsi. Add the ethernet node for the built in airoha ethernet controller. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Add a label to the spi node to allow device trees to reference it (i.e. to mark status = "okay"). Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 133e01b) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 0a64ed2) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Add ubi nvmem driver, required to load nvmem entries from ubi volumes Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit e468534) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
It is more accurate to describe the contents of the FIP as compressed, instead of the FIP itself becoming compressed. Update variable naming accordingly. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 97035a5) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Due to issues surrounding the implementation of the vendor BMT/BBT on Airoha, upstream ATF + uboot has switched to UBI flash partitions. However, some devices shipped on this platform are bootloader locked, and thus it is impossible to replace ATF + uboot. During testing for the Gemtek W1700K (openwrt#17869), sysupgrades from Linux (which is unaware of the underlying BMT/BBT) would occasionally write data into blocks which were remapped by the vendor uboot when it was read on the following reboot, causing a soft brick. An acceptable workaround [1],[2] was discussed where an intermediate uboot would be written by the vendor uboot (which is aware of Airoha BMT/BBT). This chainloader would then ignore the regions of flash used by the vendor uboot, and store all relevant data inside of UBI. UBI would then be used to handle bad block management. As the vendor ATF + uboot do not read or interact with the UBI region, we would avoid unwanted remaps from BMT/BBT. This commit introduces support for building such a chainloader, by packaging u-boot and DTS into a FIT image; to be flashed like a kernel. Configuration for the Gemtek W1700K is provided as an example of how the chainloader is used. [1] openwrt#17869 (comment) [2] openwrt#17869 (comment) Signed-off-by: Kenneth Kasilag <[email protected]> [ move FIP_COMPRESS to Build/Compile, wrap some long lines ] Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 442e67d) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
The vendor firmware checks for a bmt header in the last 528 erase blocks of flash. The OpenWrt partition table did not respect that requirement, and therefore the vendor and openwrt chainloader fight over those blocks on every boot, potentially corrupting data stored in UBI blocks there. This commit increases the size of the reserved_bmt partition to avoid that fight. Although the vendor bootloader only seems to touch the final 250 erase blocks[1], the original vendor firmware system partition ended at 0x1be00000[2], so to be conservative, the consensus is to use that as the end of mtd2 (ubi) partition and leave the last 528 blocks for mtd3 (reserved_bmt). From https://openwrt.org/toh/gemtek/mxf-w1700k: [1] OEM bootlog: [ 5.324337] bmt pool size: 250 [2] OEM bootlog: [ 5.478927] 0x000008600000-0x00001be00000 : "system" For the backport to OpenWrt 25.12, the device support has not yet been committed, so revising the compat_version in this commit is not needed; and instead will be handled by revising the pending device support commit. Reported-by: Loïc Yhuel <[email protected]> Signed-off-by: Russell Senior <[email protected]> Link: openwrt#23061 (cherry picked from commit ee771d3) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
For the backport to U-boot 2025.10, the ethernet driver (airoha_eth) supports an7581 however it is not declared in the dtsi. Add the ethernet node for the built in airoha ethernet controller. Signed-off-by: Kenneth Kasilag <[email protected]> Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Add a label to the spi node to allow device trees to reference it (i.e. to mark status = "okay"). Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 133e01b) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit 0a64ed2) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Add ubi nvmem driver, required to load nvmem entries from ubi volumes Signed-off-by: Dirk Buchwalder <[email protected]> Link: openwrt#22151 Signed-off-by: Christian Marangi <[email protected]> (cherry picked from commit e468534) Link: openwrt#22294 Signed-off-by: Robert Marko <[email protected]>
Backport the U-Boot chainloader (#22151 ) in anticipation of support for the Gemtek W1700K on 25.12.
Signed-off-by: Kenneth Kasilag [email protected]