openwrt/package/boot/uboot-mediatek/patches
Dim Fish 7dbcc1215a mediatek: filogic: add support for Xiaomi AX3000T
**SoC**: MediaTek MT7981B 2x A53
  **Flash**: ESMT F50L1G41LB 128MB
  **RAM**: NT52B128M16JR-FL 256MB
  **Ethernet**: 4x 10/100/1000 Mbps
  **Switch**: MediaTek MT7531AE
  **WiFi**: MediaTek MT7976C
  **Buttons**: Reset, Mesh
  **Power**: DC 12V 1A

1. Get ssh access. Supported stock firmware **1.0.47**
   ```
   curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0Anvram%20set%20ssh_en%3D1%0A"
   curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0Anvram%20commit%0A"
   curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0Ased%20-i%20's%2Fchannel%3D.*%2Fchannel%3D%22debug%22%2Fg'%20%2Fetc%2Finit.d%2Fdropbear%0A"
   curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0A%2Fetc%2Finit.d%2Fdropbear%20start%0A"
   curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=********/api/misystem/arn_switch" -d "open=1&model=1&level=%0Apasswd%20-d%20root%0A
   ```

2. Backup stock partitions
   ```
   nanddump -f /tmp/BL2.bin /dev/mtd1
   nanddump -f /tmp/Nvram.bin /dev/mtd2
   nanddump -f /tmp/Bdata.bin /dev/mtd3
   nanddump -f /tmp/Factory.bin /dev/mtd4
   nanddump -f /tmp/FIP.bin /dev/mtd5
   nanddump -f /tmp/ubi.bin /dev/mtd8
   nanddump -f /tmp/KF.bin /dev/mtd12
   ```
   Then transfer them to your computer in a safe place.

3. Get firmware information `cat /proc/cmdline`

4. Copy openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi to **/tmp** and flash
   If **firmware=0**
   ```
   ubiformat /dev/mtd9 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi
   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
   reboot
   ```
   If **firmware=1**
   ```
   ubiformat /dev/mtd8 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.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
   reboot
   ```

   Then reboot your router, it should boot to the OpenWrt initramfs system now.

5. Flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin
   `sysupgrade -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin`

1. Flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
   `ubiformat /dev/mtd8 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb`

   `reboot`

2. Install kmod-mtd-rw
   `opkg update && opkg install kmod-mtd-rw`

   `insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`

3. Format ubi and create new ubootenv volume
   ```
   ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
   ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
   ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
   ```

4. *(Optional **-10Mb** free space) Add recovery boot feature.*
   ```
   ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB
   ubiupdatevol /dev/ubi0_2 /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
   ```

5. Flash Openwrt U-Boot
   ```
   mtd write /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-preloader.bin BL2
   mtd write /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-bl31-uboot.fip FIP
   ```

6. Flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-squashfs-sysupgrade.itb
   `sysupgrade -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-squashfs-sysupgrade.itb`

1. Force flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
   `sysupgrade -F -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb`

2. Format ubi and Nvram
   ```
   ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
   mtd erase Nvram
   ```

3. Install kmod-mtd-rw
   `opkg update && opkg install kmod-mtd-rw`

   `insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`

4. Flash stock images from backup
   ```
   mtd write /tmp/BL2.bin BL2
   mtd write /tmp/FIP.bin FIP
   mtd write /tmp/ubi.bin ubi
   ```
   Then reboot your router, waiting it finished rollback in minutes.

   `ubiformat /dev/mtd7 -y -f /tmp/ubi.bin`
   Then reboot your router, waiting it finished rollback in minutes.

Signed-off-by: Dim Fish <dimfish@gmail.com>
2024-01-06 17:51:11 +01:00
..
000-mtk-20-configs-mt7622-enable-environment-for-mt7622_rfb.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
050-mt7622-enable-pstore.patch uboot-mediatek: remove '0x' prefix from pstore node 2022-04-19 17:07:38 +01:00
051-mt7986-enable-pstore.patch uboot-mediatek: update to U-Boot 2023.01 2023-01-13 14:49:52 +00:00
052-mt7981-enable-pstore.patch mediatek: mt7981: add reserved memory to support pstore 2023-05-27 11:01:36 +01:00
100-00-clk-remove-log_ret-from-clk_get_rate.patch uboot-mediatek: update to v2023.04 2023-04-12 22:02:27 +01:00
100-02-drivers-mtd-add-support-for-MediaTek-SPI-NAND-flash-.patch uboot-mediatek: sync mtk-snand driver with SDK 2023-09-10 23:46:06 +01:00
100-03-mtd-mtk-snand-add-support-for-SPL.patch uboot-mediatek: update to U-Boot 2023.01 2023-01-13 14:49:52 +00:00
100-04-env-add-support-for-generic-MTD-device.patch uboot-mediatek: update to v2023.04 2023-04-12 22:02:27 +01:00
100-05-mtd-add-a-new-mtd-device-type-for-NMBM.patch uboot-mediatek: update to v2023.04 2023-04-12 22:02:27 +01:00
100-06-mtd-add-core-facility-code-of-NMBM.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
100-07-mtd-nmbm-add-support-for-mtd.patch uboot-mediatek: update to U-Boot 2023.01 2023-01-13 14:49:52 +00:00
100-08-common-board_r-add-support-to-initialize-NMBM-after-.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
100-09-cmd-add-nmbm-command.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
100-10-cmd-mtd-add-markbad-subcommand-for-NMBM-testing.patch uboot-mediatek: update to U-Boot 2023.01 2023-01-13 14:49:52 +00:00
100-11-env-add-support-for-NMBM-upper-MTD-layer.patch uboot-mediatek: update to v2023.04 2023-04-12 22:02:27 +01:00
100-12-mtd-mtk-snand-add-NMBM-support-for-SPL.patch uboot-mediatek: additions from MTK SDK 2022-08-28 20:33:15 +01:00
100-13-cmd-add-a-new-command-for-NAND-flash-debugging.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
100-14-mtd-spi-nor-add-support-to-read-flash-unique-ID.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
100-15-cmd-sf-add-support-to-read-flash-unique-ID.patch uboot-mediatek: update to v2023.04 2023-04-12 22:02:27 +01:00
100-16-cmd-bootmenu-add-ability-to-select-item-by-shortkey.patch uboot-mediatek: build fully-featured U-Boot for MT7988 RFB 2023-08-28 16:35:22 +01:00
100-17-common-spl-spl_nand-enable-CONFIG_SYS_NAND_U_BOOT_OF.patch uboot-mediatek: additions from MTK SDK 2022-08-28 20:33:15 +01:00
100-18-board-mt7629-add-support-for-booting-from-SPI-NAND.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
100-19-board-mt7622-use-new-spi-nand-driver.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
100-20-board-mt7981-add-reference-board-using-new-spi-nand-.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
100-21-mtd-spi-nor-add-more-flash-ids.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
100-22-mtd-spi-nand-backport-from-upstream-kernel.patch uboot-mediatek: sync spi-nand driver with SDK 2023-09-29 00:07:50 +01:00
100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch uboot-mediatek: update to v2023.04 2023-04-12 22:02:27 +01:00
100-25-cmd-ubi-allow-creating-volume-with-all-free-spaces.patch uboot-mediatek: update to U-Boot 2023.01 2023-01-13 14:49:52 +00:00
100-26-env-ubi-add-support-to-create-environment-volume-if-.patch uboot-mediatek: update to v2023.04 2023-04-12 22:02:27 +01:00
100-27-mtd-ubi-add-support-for-UBI-end-of-filesystem-marker.patch uboot-mediatek: additions from MTK SDK 2022-08-28 20:33:15 +01:00
100-29-board-mediatek-wire-up-NMBM-support.patch uboot-mediatek: update to v2023.04 2023-04-12 22:02:27 +01:00
101-01-arm-mediatek-retrieve-ram_base-from-dts-node-for-arm.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-02-board-mediatek-update-config-headers.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-03-spi-mtk_spim-get-spi-clk-rate-only-once.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-04-spi-mtk_spim-clear-IRQ-enable-bits.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-05-serial-mtk-initial-priv-data-before-using.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-06-reset-mediatek-check-malloc-return-valaue-before-use.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-07-i2c-mediatek-fix-I2C-usability-for-MT7981.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-08-arm-dts-enable-i2c-support-for-MediaTek-MT7981.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-09-pwm-mtk-add-support-for-MediaTek-MT7988-SoC.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-10-clk-mediatek-add-clock-driver-support-for-MediaTek-M.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-11-reset-mediatek-add-reset-definition-for-MediaTek-MT7.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-12-pinctrl-mediatek-convert-most-definitions-to-const.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-13-pinctrl-mediatek-fix-the-return-value-in-driving-con.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-14-pinctrl-mediatek-add-pinmux_set-ops-support.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-15-pinctrl-mediatek-add-pinctrl-driver-for-MT7988-SoC.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-16-net-mediatek-connect-switch-to-PSE-only-when-startin.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-17-net-mediatek-optimize-the-switch-reset-delay-wait-ti.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-18-net-mediatek-fix-direct-MDIO-clause-45-access-via-So.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-19-net-mediatek-add-missing-static-qualifier.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-20-net-mediatek-add-support-for-SGMII-1Gbps-auto-negoti.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-21-arm-dts-medaitek-convert-gmac-link-mode-to-2500base-.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-22-net-mediatek-add-support-for-GMAC-USB3-PHY-mux-mode-.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-23-arm-dts-mediatek-add-infracfg-registers-to-support-G.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-24-net-mediatek-add-USXGMII-support.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-25-net-mediatek-add-support-for-NETSYS-v3.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-26-net-mediatek-add-support-for-MediaTek-MT7988-SoC.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-27-tools-mtk_image-use-uint32_t-for-ghf-header-magic-an.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-28-arm-mediatek-add-support-for-MediaTek-MT7988-SoC.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
101-29-board-mediatek-add-MT7988-reference-boards.patch uboot-mediatek: build fully-featured U-Boot for MT7988 RFB 2023-08-28 16:35:22 +01:00
102-ram-mediatek-include-linux-sizes.h-for-SZ_-macros.patch uboot-mediatek: fix build for MT7629 2023-07-31 19:49:34 +01:00
103-mt7988-enable-pstore.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
104-configs-set-CONFIG_LMB_MAX_REGIONS-64-for-MT7988-boards.patch uboot-mediatek: increase max. memory regions on mt7988-rfb 2023-08-24 18:49:49 +01:00
105-configs-add-usefull-stuff-to-mt7988-rfb.patch uboot-mediatek: build fully-featured U-Boot for MT7988 RFB 2023-08-28 16:35:22 +01:00
106-configs-sync-mt7981-rfb-storage.patch uboot-mediatek: add build for mt7981 rfb 2023-09-21 10:15:08 +01:00
107-configs-add-useful-options-to-mt7981-rfb.patch uboot-mediatek: add build for mt7981 rfb 2023-09-21 10:15:08 +01:00
108-dts-arm64-mt7981-rfb-add-mtd-partitions.patch uboot-mediatek: add build for mt7981 rfb 2023-09-21 10:15:08 +01:00
110-no-kwbimage.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
120-use-xz-instead-of-lzma.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
130-fix-mkimage-host-build.patch uboot-mediatek: update to U-Boot 2023.01 2023-01-13 14:49:52 +00:00
131-spi-mtk_spim-prevent-global-pll-clock-override.patch uboot-mediatek: fix global pll clock override on mtk_spim 2023-10-22 18:14:03 +02:00
200-cmd-add-imsz-and-imszb.patch uboot-mediatek: fix determine the size of an uImage.FIT using 'imsz' or 'imszb'. 2023-10-31 22:12:30 +00:00
211-cmd-bootmenu-custom-title.patch uboot-mediatek: update to v2023.04 2023-04-12 22:02:27 +01:00
220-cmd-env-readmem.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
230-cmd-add-pstore-check.patch uboot-mediatek: update to 2022.07 release 2022-07-11 17:13:22 +01:00
280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
301-mt7622-generic-reset-button-ignore-env.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
302-mt7623-generic-reset-button-ignore-env.patch uboot-mediatek: fix factory/reset button 2023-04-20 11:40:24 +01:00
303-mt7986-generic-reset-button-ignore-env.patch uboot-mediatek: fix factory/reset button 2023-04-20 11:40:24 +01:00
304-mt7981-generic-reset-button-ignore-env.patch uboot-mediatek: add Qihoo 360T7 support 2023-05-27 11:17:08 +01:00
305-mt7988-generic-reset-button-ignore-env.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
400-update-bpir2-defconfig.patch uboot-mediatek: fix factory/reset button 2023-04-20 11:40:24 +01:00
401-update-u7623-defconfig.patch uboot-mediatek: fix factory/reset button 2023-04-20 11:40:24 +01:00
402-update-bananapi-bpi-r64-device-tree.patch uboot-mediatek: fix factory/reset button 2023-04-20 11:40:24 +01:00
403-add-bananapi_bpi-r64-snand.patch uboot-mediatek: update to version 2023.07.02 2023-07-29 15:07:11 +01:00
404-add-bananapi_bpi-r64_defconfigs.patch uboot-mediatek: adapt BPi-R3 and BPi-R64 to new device tree overlay 2023-06-05 11:36:32 +01:00
405-dts-mt7623n-bpi-r2-fix-leds.patch uboot-mediatek: fix factory/reset button 2023-04-20 11:40:24 +01:00
406-dts-mt7623n-bpi-r2-uart0-force-highspeed.patch uboot-mediatek: fix factory/reset button 2023-04-20 11:40:24 +01:00
410-add-linksys-e8450.patch uboot-mediatek: add patches for MT7988 and builds for RFB 2023-07-29 15:07:11 +01:00
412-add-ubnt-unifi-6-lr.patch uboot-mediatek: add builds for UniFi 6 LR v2 and v3 2023-08-28 16:35:22 +01:00
420-add-support-for-RAVPower-RP-WD009.patch uboot-mediatek: fix build for RAVPower RP-WD009 2023-04-14 17:54:54 +01:00
430-add-bpi-r3.patch uboot-mediatek: Fix ubi command in uboot commands 2023-11-19 22:08:23 +00:00
431-add-xiaomi_redmi-ax6000.patch uboot-mediatek: Sync phy-mode for Xiaomi Redmi Router AX6000 2023-10-28 23:25:31 +02:00
432-add-tplink-xdr608x.patch uboot-mediatek: add missing 'memory' nodes to downstream boards 2023-07-31 17:54:31 +01:00
433-add-qihoo_360t7.patch uboot-mediatek: add missing 'memory' nodes to downstream boards 2023-07-31 17:54:31 +01:00
434-add-xiaomi_mi-router-wr30u.patch uboot-mediatek: add missing 'memory' nodes to downstream boards 2023-07-31 17:54:31 +01:00
435-add-h3c_magic-nx30-pro.patch uboot-mediatek: add missing 'memory' nodes to downstream boards 2023-07-31 17:54:31 +01:00
436-add-glinet-mt6000.patch uboot-mediatek: fix typo in bootmenu for GL-MT6000 2023-10-20 18:13:57 +02:00
437-add-cmcc_rax3000m.patch uboot-mediatek: add support for CMCC RAX3000M 2023-10-28 19:05:07 +02:00
438-add-jcg_q30-pro.patch uboot-mediatek: add JCG Q30 PRO support 2023-11-19 16:52:16 +01:00
439-add-zyxel_ex5601-t0.patch uboot-mediatek: add initial Zyxel EX5601-T0 support 2023-11-25 14:51:21 +01:00
440-add-xiaomi_mi-router-ax3000t.patch mediatek: filogic: add support for Xiaomi AX3000T 2024-01-06 17:51:11 +01:00
500-board-mt7623-fix-mmc-detect.patch uboot-mediatek: update build for the U7623-02 board 2022-01-23 19:48:42 +00:00