openwrt/target/linux/mediatek
Chuanhong Guo a6991fc7d2 mediatek: mt7622: add a second u-boot for redmi-ax6s
The vendor u-boot knows nothing about UBI, and we used to have a
fixed-size kernel partition for vendor u-boot and UBI for rootfs.
However, that fixed partition becomes too small eventually, and
expanding it requires complicated procedure.

This commit changed the flash layout and added a second u-boot
where the kernel supposed to be.
Now the vendor u-boot chainloads our mainline u-boot, and our
u-boot reads kernel+rootfs from UBI, verifies it, and boot
into OpenWrt.

There are two possible ways to convert from the old fw:
Flash the factory image using mtd (provided by @rany2):

mount -o remount,ro /
mount -o remount,ro /overlay
cd /tmp
dd if=factory.bin bs=1M count=4 | mtd write - kernel
dd if=factory.bin bs=1M skip=4 | mtd -r write - ubi

Or, flash the 2nd u-boot via mtd and upload the firmware
to the 2nd u-boot using tftp:

1. prepare a tftp server at 192.168.1.254 to serve the
   sysupgrade image:
   openwrt-mediatek-mt7622-xiaomi_redmi-router-ax6s-squashfs-sysupgrade.itb
2. upload the ubi-loader.itb to OpenWrt /tmp, and flash it to
   the old kernel partition:
   mtd -r write openwrt-mediatek-mt7622-xiaomi_redmi-router-ax6s-ubi-loader.itb
3. The router should reboot and flash the sysupgrade image via TFTP.

Procedure for flashing from vendor firmware shouldn't change.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2024-03-21 16:55:13 +08:00
..
base-files mediatek: filogic: fix failsafe mode on devices with no lan1 2024-03-02 14:08:08 +01:00
dts mediatek: mt7622: add a second u-boot for redmi-ax6s 2024-03-21 16:55:13 +08:00
files mediatek: leds-smartrg-system: fix build on Linux 6.6 2024-03-11 21:22:12 +00:00
files-6.1 mediatek: mt7988: add missing clock for PCIe ports 2024-03-15 14:09:11 +00:00
files-6.6 mediatek: mt7988: add missing clock for PCIe ports 2024-03-15 14:09:11 +00:00
filogic mediatek: Add support for GL.iNet X3000 (Spitz AX) and XE3000 (Puli AX) 2024-03-13 20:47:23 +00:00
image mediatek: mt7622: add a second u-boot for redmi-ax6s 2024-03-21 16:55:13 +08:00
mt7622 mediatek: mt7622: add a second u-boot for redmi-ax6s 2024-03-21 16:55:13 +08:00
mt7623 mediatek: add kernel configs for Linux 6.6 2024-03-11 21:22:12 +00:00
mt7629 mediatek: add kernel configs for Linux 6.6 2024-03-11 21:22:12 +00:00
patches-6.1 mediatek: mt7981: pinctrl: add additional emmc groups 2024-03-13 20:47:23 +00:00
patches-6.6 mediatek: mt7981: pinctrl: add additional emmc groups 2024-03-13 20:47:23 +00:00
Makefile mediatek: add Linux 6.6 as testing kernel 2024-03-11 21:22:12 +00:00
modules.mk mediatek: mt7623: build mt6577_auxadc driver into kernel 2022-12-05 23:14:36 +00:00