aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/filogic
diff options
context:
space:
mode:
authorChukun Pan <amadeus@jmu.edu.cn>2022-09-18 23:16:18 +0800
committerDaniel Golle <daniel@makrotopia.org>2022-10-30 14:30:22 +0000
commit641e4f2f0479997c71ff6c1f1b63fb9b5c67e687 (patch)
treea855d53853524d3069111f04b68b6e6686451b40 /target/linux/mediatek/filogic
parent9d1e687da3e11785e633c37b30ddcfabb885c657 (diff)
downloadupstream-641e4f2f0479997c71ff6c1f1b63fb9b5c67e687.tar.gz
upstream-641e4f2f0479997c71ff6c1f1b63fb9b5c67e687.tar.bz2
upstream-641e4f2f0479997c71ff6c1f1b63fb9b5c67e687.zip
mediatek: add Xiaomi Redmi Router AX6000 support
Hardware specification: SoC: MediaTek MT7986A 4x A53 Flash: ESMT F50L1G41LB 128 MB RAM: K4A4G165WF-BCWE 512 MB Ethernet: 4x 10/100/1000 Mbps WiFi1: MT7976GN 2.4GHz ax 4x4 WiFi2: MT7976AN 5GHz ax 4x4 Button: Mesh, Reset Flash instructions: 1. Gain ssh and serial port access, see the link below: https://openwrt.org/toh/xiaomi/redmi_ax6000#installation 2. Use ssh or serial port to log in to the router, and execute the following command: nvram set boot_wait=on nvram set flag_boot_rootfs=0 nvram set flag_boot_success=1 nvram set flag_last_success=1 nvram set flag_try_sys1_failed=8 nvram set flag_try_sys2_failed=8 nvram commit 3. Set a static ip on the ethernet interface of your computer (e.g. default: ip 192.168.31.100, gateway 192.168.31.1) 4. Download the initramfs image, rename it to initramfs.bin, and host it with the tftp server. 5. Interrupt U-Boot and run these commands: setenv mtdparts nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),112640k(ubi) saveenv tftpboot initramfs.bin bootm 6. After openwrt boots up, use scp or luci web to upload sysupgrade.bin to upgrade. Revert to stock firmware: Restore mtdparts back to default, then use the vendor's recovery tool (Windows only). Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Diffstat (limited to 'target/linux/mediatek/filogic')
-rw-r--r--target/linux/mediatek/filogic/base-files/etc/board.d/02_network23
1 files changed, 23 insertions, 0 deletions
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
index f7dc7a01e0..0f0a0fc86b 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
@@ -16,15 +16,38 @@ mediatek_setup_interfaces()
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan"
ucidef_set_interface_macaddr "wan" "$(macaddr_add $(cat /sys/class/net/eth0/address) 1)"
;;
+ xiaomi,redmi-router-ax6000)
+ ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" wan
+ ;;
*)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan
;;
esac
}
+mediatek_setup_macs()
+{
+ local board="$1"
+ local lan_mac=""
+ local wan_mac=""
+ local label_mac=""
+
+ case $board in
+ xiaomi,redmi-router-ax6000)
+ 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
board=$(board_name)
mediatek_setup_interfaces $board
+mediatek_setup_macs $board
board_config_flush
exit 0