openwrt/target/linux/mediatek/dts
Chen Minqiang 18bea173a6 mediatek: add alternative stock layout for Xiaomi Redmi Router AX6000
In this implementation, the flash partition layout is adjusted to avoid
modifying the uboot environment of mtdparts. This ensures that the 30M
ubi_kernel partition remains aligned with the stock ubi partition, and
the kernel volume is placed in it. This allows the stock uboot to boot
from it without changing the mtdparts, which is useful for reverting back
to the stock firmware using Xiaomi Firmware Tools. In actual testing,
modifying mtdparts has been found to break Xiaomi Firmware Tools.

1. use ARTIFACTS to generate initramfs-factory.ubi for easy installation.
2. The NAND flash layout is changed to allow for reverting back to the
   stock firmware.
3. Before performing sysupgrade, do some cleanup in platform_pre_upgrade
   to ensure a clean installation of OpenWRT.
4. Setup the uboot env to ensure that the system always boot, which can
   be helpful for users who may forget to do this before sysupgrade in
   the initramfs.

New flash instructions:
1. Gain ssh access. Please refer to:
   https://openwrt.org/toh/xiaomi/redmi_ax6000#installation)

2. Check which system current u-boot is loading from:
   COMMAND: `cat /proc/cmdline`
   sample OUTPUT: `console=ttyS0,115200n1 loglevel=8 firmware=1 uart_en=1`
   if firmware=1, current system is ubi1
   if firmware=0, current system is ubi0

3. Setup nvram and write the firmware:
   If the current system is ubi1, please set it up so that the next time
   it will boot from ubi, and write the firmware to ubi:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=0
nvram set flag_last_success=0
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
ubiformat /dev/mtd8 -y -f /tmp/initramfs-factory.ubi
```
   If the current system is ubi, please set it up so that the next time
   it will boot from ubi1, and write the firmware to ubi1:
```
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=1
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
ubiformat /dev/mtd9 -y -f /tmp/initramfs-factory.ubi
```

4. After rebooting, the system should now boot into the openwrt initramfs.
   Flash the squashfs-sysupgrade.bin via using ssh or luci.
```
sysupgrade -n /tmp/squashfs-sysupgrade.bin
```
Done.

For existing users of the Redmi AX6000 running OpenWrt, here are the steps to
switch to this new layout:

1. Flash initramfs-factory.ubi
```
mtd -r -e ubi write /tmp/initramfs-factory.ubi ubi
```

2. After rebooting, the system will boot into the new openwrt-initramfs.
Log in and perform a sysupgrade to complete the process.
```
sysupgrade -n /tmp/squashfs-sysupgrade.bin
```

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2022-12-17 15:04:16 +08:00
..
mt7622-buffalo-wsr-2533dhp2.dts mediatek: convert mtd-mac-address to nvmem implementation 2021-07-19 14:51:22 +02:00
mt7622-elecom-wrc-2533gent.dts mediatek: add an upstreamed spi-nand driver 2022-04-28 18:06:00 +08:00
mt7622-elecom-wrc-x3200gst3.dts mediatek: mt7622: add support for ELECOM WRC-X3200GST3 2022-05-21 22:27:01 +01:00
mt7622-linksys-e8450-ubi.dts mediatek: convert mtd-mac-address to nvmem implementation 2021-07-19 14:51:22 +02:00
mt7622-linksys-e8450.dts mediatek: convert mtd-mac-address to nvmem implementation 2021-07-19 14:51:22 +02:00
mt7622-linksys-e8450.dtsi mediatek: disable unsupported background radar detection 2022-09-12 00:14:02 +01:00
mt7622-reyee-ax3200-e5.dts mediatek: also move &slot0 from dtsi down to board dts 2022-12-07 01:45:14 +00:00
mt7622-rfb1-ubi.dts mediatek: add an upstreamed spi-nand driver 2022-04-28 18:06:00 +08:00
mt7622-ruijie-rg-ew3200.dtsi mediatek: also move &slot0 from dtsi down to board dts 2022-12-07 01:45:14 +00:00
mt7622-ruijie-rg-ew3200gx-pro.dts mediatek: also move &slot0 from dtsi down to board dts 2022-12-07 01:45:14 +00:00
mt7622-totolink-a8000ru.dts mediatek: mt7622: add missing vbus regulator node to totolink-a8000ru dts 2022-07-07 00:22:23 +01:00
mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts mediatek: mt7622: fix DTS compatible of UniFi 6 LR variants 2022-09-03 02:27:59 +01:00
mt7622-ubnt-unifi-6-lr-v1.dts mediatek: mt7622: fix DTS compatible of UniFi 6 LR variants 2022-09-03 02:27:59 +01:00
mt7622-ubnt-unifi-6-lr-v1.dtsi mediatek: fix ledbar of UniFi 6 LR when running custom U-Boot 2022-09-11 20:26:42 +01:00
mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts mediatek: mt7622: fix DTS compatible of UniFi 6 LR variants 2022-09-03 02:27:59 +01:00
mt7622-ubnt-unifi-6-lr-v2.dts mediatek: add Ubiquiti UniFi 6 LR v2 targets 2022-06-11 19:51:33 +01:00
mt7622-ubnt-unifi-6-lr-v2.dtsi mediatek: mt7622: fix white dome LED of UniFi 6 LR 2022-07-04 19:19:52 +01:00
mt7622-ubnt-unifi-6-lr.dtsi mediatek: UniFi 6 LR: disable RTC 2022-06-18 17:32:07 +01:00
mt7622-xiaomi-redmi-router-ax6s.dts mediatek: disable unsupported background radar detection 2022-09-12 00:14:02 +01:00
mt7623a-unielec-u7623-02-emmc-512m.dts mediatek: u7623-02: enable early console also in legacy image 2022-01-31 00:10:38 +00:00
mt7623a-unielec-u7623-02.dts mediatek: mt7623: rework images for U7623-02 board 2022-01-23 20:20:37 +00:00
mt7623a-unielec-u7623-02.dtsi mediatek: mt7623: rework images for U7623-02 board 2022-01-23 20:20:37 +00:00
mt7629-iptime-a6004mx.dts mediatek: add support for ipTIME A6004MX Add basic support for ipTIME A6004MX. 2022-09-12 01:43:49 +01:00
mt7986a-bananapi-bpi-r3-emmc-nor.dts mediatek: add support for Bananapi BPi-R3 2022-08-30 13:36:28 +01:00
mt7986a-bananapi-bpi-r3-emmc-snand.dts mediatek: add support for Bananapi BPi-R3 2022-08-30 13:36:28 +01:00
mt7986a-bananapi-bpi-r3-nor.dts mediatek: add support for Bananapi BPi-R3 2022-08-30 13:36:28 +01:00
mt7986a-bananapi-bpi-r3-snand.dts mediatek: add support for Bananapi BPi-R3 2022-08-30 13:36:28 +01:00
mt7986a-bananapi-bpi-r3.dts mediatek: filogic: set correct PWM clock and clean thermal zone 2022-10-09 16:41:16 +01:00
mt7986a-xiaomi-redmi-router-ax6000-stock.dts mediatek: add alternative stock layout for Xiaomi Redmi Router AX6000 2022-12-17 15:04:16 +08:00
mt7986a-xiaomi-redmi-router-ax6000.dts mediatek: add alternative stock layout for Xiaomi Redmi Router AX6000 2022-12-17 15:04:16 +08:00
mt7986a-xiaomi-redmi-router-ax6000.dtsi mediatek: add alternative stock layout for Xiaomi Redmi Router AX6000 2022-12-17 15:04:16 +08:00