openwrt/target/linux/airoha
Kenneth Kasilag 442e67d31f
airoha: an7581: add uboot chainloader
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] https://github.com/openwrt/openwrt/pull/17869#discussion_r2836066746
[2] https://github.com/openwrt/openwrt/pull/17869#discussion_r2838395671

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
[ move FIP_COMPRESS to Build/Compile, wrap some long lines ]
Link: https://github.com/openwrt/openwrt/pull/22151
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-03-05 11:17:46 +01:00
..
an7581 airoha: an7581: enable USB support 2026-01-28 23:44:38 +01:00
an7583 kernel: reorder configuration options 2026-01-26 23:57:25 +01:00
base-files/lib/preinit airoha: support openwrt,netdev-name for renaming interfaces 2025-10-29 22:01:23 +01:00
dts airoha: fix EN7581 PCIe initialization and add x2 link support 2026-02-13 12:08:56 +01:00
en7523 kernel: reorder configuration options 2026-01-26 23:57:25 +01:00
image airoha: an7581: add uboot chainloader 2026-03-05 11:17:46 +01:00
patches-6.12 airoha: an7583: fix wrong clock for SPI and SLIC 2026-02-20 00:57:35 +01:00
Makefile airoha: Introduce support for Airoha AN7583 SoC 2025-09-26 05:00:07 +02:00
modules.mk airoha: rename subtarget from en7581 to an7581 2024-10-23 12:32:03 +02:00