From aa94e34c1d7ce40684ec01b8ddc056548ecd34f0 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 2 Feb 2021 16:29:58 +0100 Subject: mediatek: add Linksys E8450 support The Linksys E8450, also known as Belkin RT3200, is a dual-band IEEE 802.11bgn/ac/ax router based on MediaTek MT7622BV and MediaTek MT7915AN chips. FCC: K7S-03571 and K7S-03572 Hardware highlights: - CPU: MediaTek MT7622BV (2x ARM Cortex-A53 @ 1350 MHz max.) - RAM: 512MB DDR3 - Flash: 128MB SPI-NAND (2k+64) - Ethernet: MT7531BE switch with 5 1000Base-T ports CPU port connected with 2500Base-X - WiFi 2.4 GHz: 802.11bgn 4T4R built-in antennas MT7622VB built-in - WiFi 5 GHz: 802.11ac/ax 4T4R built-in antennas MT7915AN chip on-board via PCIe MT7975AN front-end - Buttons: Reset and WPS - LEDS: 3 user controllable LEDs, 4 wired to switch - USB: USB2.0, single port - no Bluetooth (supported by SoC, not wired on board) - Serial: JST PH 2.0MM 6 Pin connector inside device ----_____________---- [ GND RX - TX - - ] --------------------- - JTAG: unpopulated ARM JTAG 20-pin connector (works) This commit adds support for the device in a way that is compatible with the vendor firmware's bootloader and dual-boot flash layout, the resulting image can directly be flashed using the vendor firmware. Signed-off-by: Daniel Golle Signed-off-by: John Crispin Signed-off-by: Felix Fietkau --- .../mediatek/mt7622/base-files/etc/board.d/01_leds | 18 ++++++++++++++++++ .../mediatek/mt7622/base-files/etc/board.d/02_network | 13 ++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100755 target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds (limited to 'target/linux/mediatek/mt7622/base-files/etc/board.d') 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 new file mode 100755 index 0000000000..e74944a65f --- /dev/null +++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds @@ -0,0 +1,18 @@ +#!/bin/sh + +. /lib/functions/leds.sh +. /lib/functions/uci-defaults.sh + +board=$(board_name) + +board_config_update + +case $board in +linksys,e8450) + ucidef_set_led_netdev "wan" "WAN" "inet:blue" "wan" + ;; +esac + +board_config_flush + +exit 0 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 3a409c8ec9..3d2b9ffe49 100755 --- a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network @@ -10,9 +10,8 @@ mediatek_setup_interfaces() case $board in bananapi,bpi-r64-rootdisk|\ - bananapi,bpi-r64) - ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" wan - ;; + bananapi,bpi-r64|\ + linksys,e8450|\ mediatek,mt7622-rfb1) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan ;; @@ -31,7 +30,15 @@ mediatek_setup_macs() local board="$1" case $board in + linksys,e8450) + wan_mac=$(mtd_get_mac_ascii devinfo wan_mac_addr) + lan_mac=$(mtd_get_mac_ascii devinfo lan_mac_addr) + 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 -- cgit v1.2.3