Shiji Yang
3d8d807373
uboot-mediatek: move custom uart config symbol to board defconfigs
...
This helps to solve the issue of waiting for "SERIAL_RX_BUFFER_SIZE"
input when enabling verbose log output option (V=s).
Fixes: https://github.com/openwrt/openwrt/issues/18036
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/18043
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-03-15 12:50:57 +01:00
Shiji Yang
4be1bab9ed
uboot-mediatek: move default env files to a dedicated directory
...
Putting all files in the root folder is too messy.
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2025-02-09 22:01:21 +00:00
Shiji Yang
b85c5f6817
uboot-mediatek: enable auto switch chip detect for Xiaomi AX3000T
...
The Xiaomi AX3000T has two hardware revisions. One uses MT7531
switch, and the other uses AN8855 switch. Set "mediatek,switch"
property to "auto" to be compatible with different switches.
Tested-by: Mikhail Zhilkin <csharper2005@gmail.com>
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2025-02-09 21:50:58 +00:00
Shiji Yang
10b16d9328
uboot-mediatek: update to v2025.01
...
Remove upstreamed patches:
010-menu-fix-the-logic-checking-whether-ESC-key-is-press.patch [1]
011-menu-add-support-to-check-if-menu-needs-to-be-reprin.patch [2]
012-bootmenu-add-reprint-check.patch [3]
Remove outdated patches:
455-arm-provide-noncached_set_region-prototype-to-fix-build.patch
Some patches have been manually rebased to match the upstream
changes. This patch also fixes the dtc warning for reserved-memory
dts node. If #address-cells and #size-cells are not same as the
root node definitions, the dtc will complain about it.
All defconfigs are refreshed by `make "$board"_defconfig` and
`make savedefconfig`.
[1] ddac69885e
[2] ccdd7948e2
[3] 599652cff1
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2025-02-09 21:50:58 +00:00
Daniel Golle
3a85467427
uboot-mediatek: remove hard-coded UBI volume numbers
...
There is no point in hard-coding the UBI volume numbers as we are
dynamically looking up the volume by volume name in all cases by now.
Remove this relict as it causes problems without being useful for
anything.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-07-14 16:29:49 +01:00
Shiji Yang
a40e0c7529
uboot-mediatek: refresh device defconfig files
...
It seems that most of them are manually modified. However, we can
use `make savedefconfig` to generate a clean defconfig file.
Refreshed by:
```
Boards=(
mt7623n_bpir2_defconfig \
mt7623a_unielec_u7623_02_defconfig \
mt7622_bananapi_bpi-r64-sdmmc_defconfig \
mt7622_bananapi_bpi-r64-emmc_defconfig \
mt7622_bananapi_bpi-r64-snand_defconfig \
mt7622_linksys_e8450_defconfig \
mt7622_ubnt_unifi-6-lr-v1_defconfig \
mt7622_ubnt_unifi-6-lr-v2_defconfig \
mt7622_ubnt_unifi-6-lr-v3_defconfig \
ravpower-rp-wd009-ram_defconfig \
mt7621_zbtlink_zbt-wg3526-16m_defconfig \
mt7986_netcore_n60_defconfig \
mt7986a_bpi-r3-emmc_defconfig \
mt7986a_bpi-r3-nor_defconfig \
mt7986a_bpi-r3-sd_defconfig \
mt7986a_bpi-r3-snand_defconfig \
mt7986_xiaomi_redmi-ax6000_defconfig \
mt7986_tplink_tl-xdr4288_defconfig \
mt7986_tplink_tl-xdr6086_defconfig \
mt7986_tplink_tl-xdr6088_defconfig \
mt7981_qihoo-360t7_defconfig \
mt7981_xiaomi_mi-router-wr30u_defconfig \
mt7981_h3c_magic-nx30-pro_defconfig \
mt7986a_glinet_gl-mt6000_defconfig \
mt7981_cmcc_rax3000m-emmc_defconfig \
mt7981_cmcc_rax3000m-nand_defconfig \
mt7981_jcg_q30-pro_defconfig \
mt7986_zyxel_ex5601-t0_defconfig \
mt7981_xiaomi_mi-router-ax3000t_defconfig \
mt7986a_jdcloud_re-cp-03_defconfig \
mt7986a_bpi-r3-mini-emmc_defconfig \
mt7986a_bpi-r3-mini-snand_defconfig \
mt7981_nokia_ea0326gmp_defconfig \
mt7988a_bananapi_bpi-r4-emmc_defconfig \
mt7988a_bananapi_bpi-r4-sdmmc_defconfig \
mt7988a_bananapi_bpi-r4-snand_defconfig \
mt7988a_bananapi_bpi-r4-poe-emmc_defconfig \
mt7988a_bananapi_bpi-r4-poe-sdmmc_defconfig \
mt7988a_bananapi_bpi-r4-poe-snand_defconfig \
mt7622_xiaomi_redmi-router-ax6s-ubi-loader_defconfig \
mt7981_openwrt-one-nor_defconfig \
mt7981_openwrt-one-spi-nand_defconfig \
)
for Board in ${Boards[@]}
do
echo "Refresh board ${Board}"
make ${Board}
make savedefconfig
cat ./defconfig > ./configs/${Board}
done
```
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2024-07-14 16:29:49 +01:00
Shiji Yang
6951526792
uboot-mediatek: update to U-Boot release v2024.07
...
1. Rename function _do_env_set() to env_do_env_set().
2. Replace kwbimage hack with UBOOT_CUSTOMIZE_CONFIG:
"--disable TOOLS_KWBIMAGE" and "--disable TOOLS_LIBCRYPTO".
3. Disable CONFIG_CMD_BOOTEFI_BOOTMGR for all supported devices
because the newly added UEFI bootmenu entries doesn't work.
4. Enable CONFIG_VERSION_VARIABLE for the OpenWrt One.
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Co-authored-by: Daniel Golle <daniel@makrotopia.org>
2024-07-14 16:29:49 +01:00
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