diff options
author | Chuanhong Guo <gch981213@gmail.com> | 2024-03-02 21:12:54 +0800 |
---|---|---|
committer | Chuanhong Guo <gch981213@gmail.com> | 2024-03-21 16:55:13 +0800 |
commit | a6991fc7d251f7ab65a588546e22abfd4f8ce472 (patch) | |
tree | 96ecdb4163486c172994ee05888a3433efa8c89a /target/linux/mediatek/dts | |
parent | ec8c3dc701cfd53e1ddc9817041e710fb4bbb0f3 (diff) | |
download | openwrt-a6991fc7d251f7ab65a588546e22abfd4f8ce472.tar.gz openwrt-a6991fc7d251f7ab65a588546e22abfd4f8ce472.tar.bz2 openwrt-a6991fc7d251f7ab65a588546e22abfd4f8ce472.zip |
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>
Diffstat (limited to 'target/linux/mediatek/dts')
-rw-r--r-- | target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts b/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts index 01365a278d..c0db31fd3a 100644 --- a/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts +++ b/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts @@ -22,7 +22,8 @@ chosen { stdout-path = "serial0:115200n8"; - bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512"; + rootdisk = <&ubi_rootfs>; + bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512 ubi.block=0,fit root=/dev/fit0"; }; memory { @@ -230,7 +231,7 @@ mediatek,bmt-v2; mediatek,bmt-table-size = <0x1000>; - mediatek,bmt-remap-range = <0x0 0x6c0000>; + mediatek,bmt-remap-range = <0x0 0x340000>; partitions { compatible = "fixed-partitions"; @@ -295,12 +296,9 @@ read-only; }; - /* Shrunk and renamed from "firmware" - * as to not break luci size checks - */ partition@2c0000 { - label = "kernel"; - reg = <0x2c0000 0x400000>; + label = "ubi-loader"; + reg = <0x2c0000 0x80000>; }; /* ubi partition is the result of squashing @@ -310,9 +308,16 @@ * - overlay * - obr */ - partition@6c0000 { + partition@340000 { label = "ubi"; - reg = <0x6C0000 0x6f00000>; + reg = <0x340000 0x7280000>; + compatible = "linux,ubi"; + + volumes { + ubi_rootfs: ubi-volume-fit { + volname = "fit"; + }; + }; }; }; }; |