aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/mt7622
diff options
context:
space:
mode:
authorRichard Huynh <voxlympha@gmail.com>2021-12-01 12:27:39 +1100
committerDaniel Golle <daniel@makrotopia.org>2022-03-21 13:11:56 +0000
commit9470160c350d15f765c33d6c1db15d6c4709a64c (patch)
treeae873db7b8cf9bd12f005e922a8c2dfc03ec6477 /target/linux/mediatek/mt7622
parent4b51fa0d808fef51bbb1550f9d971b1faeea0643 (diff)
downloadupstream-9470160c350d15f765c33d6c1db15d6c4709a64c.tar.gz
upstream-9470160c350d15f765c33d6c1db15d6c4709a64c.tar.bz2
upstream-9470160c350d15f765c33d6c1db15d6c4709a64c.zip
mediatek: Add support for Xiaomi Redmi Router AX6S
Also known as the "Xiaomi Router AX3200" in western markets, but only the AX6S is widely installation-capable at this time. SoC: MediaTek MT7622B RAM: DDR3 256 MiB (ESMT M15T2G16128A) Flash: SPI-NAND 128 MiB (ESMT F50L1G41LB or Gigadevice GD5F1GQ5xExxG) WLAN: 2.4/5 GHz 4T4R 2.4 GHz: MediaTek MT7622B 5 GHz: MediaTek MT7915E Ethernet: 4x 10/100/1000 Mbps Switch: MediaTek MT7531B LEDs/Keys: 2/2 (Internet + System LED, Mesh button + Reset pin) UART: Marked J1 on board VCC RX GND TX, beginning from "1". 3.3v, 115200n8 Power: 12 VDC, 1.5 A Notes: U-Boot passes through the ethaddr from uboot-env partition, but also has been known to reset it to a generic mac address hardcoded in the bootloader. However, bdata is also populated with the ethernet mac addresses, but is also typically never written to. Thus this is used instead. Installation: 1. Flash stock Xiaomi "closed beta" image labelled 'miwifi_rb03_firmware_stable_1.2.7_closedbeta.bin'. (MD5: 5eedf1632ac97bb5a6bb072c08603ed7) 2. Calculate telnet password from serial number and login 3. Execute commands to prepare device nvram set ssh_en=1 nvram set uart_en=1 nvram set boot_wait=on nvram set flag_boot_success=1 nvram set flag_try_sys1_failed=0 nvram set flag_try_sys2_failed=0 nvram commit 4. Download and flash image On computer: python -m http.server On router: cd /tmp wget http://<IP>:8000/factory.bin mtd -r write factory.bin firmware Device should reboot at this point. Reverting to stock: Stock Xiaomi recovery tftp that accepts their signed images, with default ips of 192.168.31.1 + 192.168.31.100. Stock image should be renamed to tftp server ip in hex (Eg. C0A81F64.img) Triggered by holding reset pin on powerup. A simple implementation of this would be via dnsmasq's dhcp-boot option or using the vendor's (Windows only) recovery tool available on their website. Signed-off-by: Richard Huynh <voxlympha@gmail.com> (cherry picked from commit 9f9477b2751231d57cdd8c227149b88c93491d93)
Diffstat (limited to 'target/linux/mediatek/mt7622')
-rw-r--r--target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds3
-rw-r--r--target/linux/mediatek/mt7622/base-files/etc/board.d/02_network11
-rwxr-xr-xtarget/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh6
3 files changed, 18 insertions, 2 deletions
diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds b/target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds
index 65a81df8da..5c32918d35 100644
--- a/target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds
@@ -10,6 +10,9 @@ linksys,e8450|\
linksys,e8450-ubi)
ucidef_set_led_netdev "wan" "WAN" "inet:blue" "wan"
;;
+xiaomi,redmi-router-ax6s)
+ ucidef_set_led_netdev "wan" "WAN" "blue:net" "wan"
+ ;;
esac
board_config_flush
diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
index 4649d0dc57..c55fcbee2e 100644
--- a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
@@ -24,6 +24,9 @@ mediatek_setup_interfaces()
ubnt,unifi-6-lr-ubootmod)
ucidef_set_interface_lan "eth0"
;;
+ xiaomi,redmi-router-ax6s)
+ ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan
+ ;;
*)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6u@eth0" "5u@eth1"
@@ -35,14 +38,22 @@ mediatek_setup_macs()
{
local board="$1"
local lan_mac=""
+ local wan_mac=""
+ local label_mac=""
case $board in
ruijie,rg-ew3200gx-pro)
lan_mac=$(macaddr_add $(get_mac_label) 1)
;;
+ xiaomi,redmi-router-ax6s)
+ wan_mac=$(mtd_get_mac_ascii bdata ethaddr_wan)
+ label_mac=$wan_mac
+ ;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
+ [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
+ [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
}
board_config_update
diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
index fbca6ef0f7..f54665dfa1 100755
--- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
@@ -45,7 +45,8 @@ platform_do_upgrade() {
default_do_upgrade "$1"
;;
mediatek,mt7622-rfb1-ubi|\
- totolink,a8000ru)
+ totolink,a8000ru|\
+ xiaomi,redmi-router-ax6s)
nand_do_upgrade "$1"
;;
*)
@@ -67,7 +68,8 @@ platform_check_image() {
buffalo_check_image "$board" "$magic" "$1" || return 1
;;
mediatek,mt7622-rfb1-ubi|\
- totolink,a8000ru)
+ totolink,a8000ru|\
+ xiaomi,redmi-router-ax6s)
nand_do_platform_check "$board" "$1"
;;
*)