mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2024-06-16 12:14:01 +02:00
![Felix Matouschek](/assets/img/avatar_default.png)
This patch adds support for the Teltonika RUTX10. This device is an industrial DIN-rail router with 4 ethernet ports, 2.4G/5G dualband WiFi, Bluetooth, a USB 2.0 port and two GPIOs. The RUTX series devices are very similiar so common parts of the DTS are kept in a DTSI file. They are based on the QCA AP-DK01.1-C1 dev board. See https://teltonika-networks.com/product/rutx10 for more info. Hardware: SoC: Qualcomm IPQ4018 RAM: 256MB DDR3 SPI Flash 1: XTX XT25F128B (16MB, NOR) SPI Flash 2: XTX XT26G02AWS (256MB, NAND) Ethernet: Built-in IPQ4018 (SoC, QCA8075), 4x 10/100/1000 ports WiFi 1: Qualcomm QCA4019 IEEE 802.11b/g/n Wifi 2: Qualcomm QCA4019 IEEE 802.11a/n/ac USB Hub: Genesys Logic GL852GT Bluetooth: Qualcomm CSR8510 (A10U) LED/GPIO controller: STM32F030 with custom firmware Buttons: Reset button Leds: Power (green, cannot be controlled) WiFi 2.4G activity (green) WiFi 5G activity (green) MACs Details verified with the stock firmware: eth0: Partition 0:CONFIG Offset: 0x0 eth1: = eth0 + 1 radio0 (2.4 GHz): = eth0 + 2 radio1 (5.0 GHz): = eth0 + 3 Label MAC address is from eth0. The LED/GPIO controller needs a separate kernel driver to function. The driver was extracted from the Teltonika GPL sources and can be found at following feed: https://github.com/0xFelix/teltonika-rutx-openwrt USB detection of the bluetooth interface is sometimes a bit flaky. When not detected power cycle the device. When the bluetooth interface was detected properly it can be used with bluez / bluetoothctl. Flash instructions via stock web interface (sysupgrade based): 1. Set PC to fixed ip address 192.168.1.100 2. Push reset button and power on the device 3. Open u-boot HTTP recovery at http://192.168.1.1 4. Upload latest stock firmware and wait until the device is rebooted 5. Open stock web interface at http://192.168.1.1 6. Set some password so the web interface is happy 7. Go to firmware upgrade settings 8. Choose openwrt-ipq40xx-generic-teltonika_rutx10-squashfs-nand-factory.ubi 9. Set 'Keep settings' to off 10. Click update, when warned that it is not a signed image proceed Return to stock firmware: 1. Set PC to fixed ip address 192.168.1.100 2. Push reset button and power on the device 3. Open u-boot HTTP recovery at http://192.168.1.1 4. Upload latest stock firmware and wait until the device is rebooted Note: The DTS expects OpenWrt to be running from the second rootfs partition. u-boot on these devices hot-patches the DTS so running from the first rootfs partition should also be possible. If you want to be save follow the instructions above. u-boot HTTP recovery restores the device so that when flashing OpenWrt from stock firmware it is flashed to the second rootfs partition and the DTS matches. Signed-off-by: Felix Matouschek <felix@matouschek.org>
211 lines
4.9 KiB
Plaintext
211 lines
4.9 KiB
Plaintext
#
|
|
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
|
|
# Copyright (c) 2011-2015 OpenWrt.org
|
|
#
|
|
|
|
. /lib/functions/uci-defaults.sh
|
|
. /lib/functions/system.sh
|
|
|
|
ipq40xx_setup_interfaces()
|
|
{
|
|
local board="$1"
|
|
|
|
case "$board" in
|
|
8dev,habanero-dvk|\
|
|
8dev,jalapeno|\
|
|
alfa-network,ap120c-ac|\
|
|
engenius,emr3500|\
|
|
engenius,ens620ext|\
|
|
luma,wrtq-329acn|\
|
|
netgear,wac510|\
|
|
plasmacloud,pa1200|\
|
|
plasmacloud,pa2200)
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
;;
|
|
aruba,ap-303|\
|
|
aruba,ap-365|\
|
|
avm,fritzrepeater-1200|\
|
|
dlink,dap-2610 |\
|
|
engenius,eap1300|\
|
|
engenius,emd1|\
|
|
meraki,mr33|\
|
|
mikrotik,sxtsq-5-ac|\
|
|
netgear,ex6100v2|\
|
|
netgear,ex6150v2|\
|
|
zyxel,wre6606)
|
|
ucidef_set_interface_lan "eth0"
|
|
;;
|
|
aruba,ap-303h|\
|
|
teltonika,rutx10)
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "0u@eth1" "5:wan"
|
|
;;
|
|
asus,map-ac2200|\
|
|
cilab,meshpoint-one|\
|
|
edgecore,ecw5211|\
|
|
edgecore,oap100|\
|
|
openmesh,a42|\
|
|
openmesh,a62)
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
|
;;
|
|
asus,rt-ac58u|\
|
|
mikrotik,hap-ac2|\
|
|
mikrotik,hap-ac3|\
|
|
p2w,r619ac-64m|\
|
|
p2w,r619ac-128m|\
|
|
zyxel,nbg6617)
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
|
;;
|
|
avm,fritzbox-4040|\
|
|
linksys,ea6350v3|\
|
|
linksys,ea8300|\
|
|
linksys,mr8300)
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
|
|
;;
|
|
avm,fritzbox-7530)
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
|
;;
|
|
avm,fritzrepeater-3000)
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "4:lan:1" "5:lan:2"
|
|
;;
|
|
compex,wpj419|\
|
|
compex,wpj428|\
|
|
engenius,eap2200)
|
|
ucidef_set_interface_lan "eth0 eth1"
|
|
;;
|
|
buffalo,wtr-m2133hp)
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
|
|
;;
|
|
cellc,rtl30vw)
|
|
ucidef_set_interface_lan "eth0"
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "3:lan" "4:lan"
|
|
;;
|
|
devolo,magic-2-wifi-next)
|
|
ucidef_set_interface_lan "eth0 eth1 eth2"
|
|
;;
|
|
ezviz,cs-w3-wd1200g-eup)
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "0u@eth1" "5:wan"
|
|
;;
|
|
glinet,gl-ap1300 |\
|
|
glinet,gl-b1300 |\
|
|
glinet,gl-s1300)
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "3:lan" "4:lan"
|
|
;;
|
|
mobipromo,cm520-79f)
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "3:lan:2" "4:lan:1"
|
|
ucidef_set_interface_wan "eth1"
|
|
;;
|
|
netgear,rbr50|\
|
|
netgear,rbs50|\
|
|
netgear,srr60|\
|
|
netgear,srs60)
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "2:lan" "3:lan" "4:lan"
|
|
ucidef_set_interface_wan "eth1"
|
|
;;
|
|
qxwlan,e2600ac-c1 |\
|
|
qxwlan,e2600ac-c2)
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "3:lan" "4:lan" "0u@eth1" "5:wan"
|
|
;;
|
|
unielec,u4019-32m)
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan"
|
|
;;
|
|
*)
|
|
echo "Unsupported hardware. Network interfaces not initialized"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
ipq40xx_setup_macs()
|
|
{
|
|
local board="$1"
|
|
local lan_mac=""
|
|
local wan_mac=""
|
|
local label_mac=""
|
|
|
|
case "$board" in
|
|
8dev,habanero-dvk)
|
|
label_mac=$(mtd_get_mac_binary "ART" 0x1006)
|
|
;;
|
|
asus,rt-ac58u)
|
|
CI_UBIPART=UBI_DEV
|
|
wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
|
|
lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006)
|
|
label_mac=$wan_mac
|
|
;;
|
|
cilab,meshpoint-one)
|
|
label_mac=$(mtd_get_mac_binary "ART" 0x1006)
|
|
;;
|
|
devolo,magic-2-wifi-next)
|
|
lan_mac=$(mtd_get_mac_ascii APPSBLENV MacAddress0)
|
|
label_mac=$lan_mac
|
|
;;
|
|
dlink,dap-2610)
|
|
lan_mac=$(mtd_get_mac_ascii bdcfg lanmac)
|
|
label_mac=$lan_mac
|
|
;;
|
|
engenius,eap2200|\
|
|
engenius,emd1)
|
|
lan_mac=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
|
|
label_mac=$lan_mac
|
|
;;
|
|
engenius,emr3500)
|
|
wan_mac=$(mtd_get_mac_ascii 0:APPSBLENV wanaddr)
|
|
lan_mac=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
|
|
label_mac=$wan_mac
|
|
;;
|
|
engenius,ens620ext)
|
|
wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
|
lan_mac=$(macaddr_add "$wan_mac" 1)
|
|
;;
|
|
ezviz,cs-w3-wd1200g-eup)
|
|
label_mac=$(mtd_get_mac_binary "ART" 0x6)
|
|
;;
|
|
linksys,ea6350v3)
|
|
wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
|
|
lan_mac=$(macaddr_add "$wan_mac" 1)
|
|
;;
|
|
mikrotik,hap-ac2|\
|
|
mikrotik,hap-ac3)
|
|
wan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
|
|
lan_mac=$(macaddr_add $wan_mac 1)
|
|
label_mac="$wan_mac"
|
|
;;
|
|
mikrotik,sxtsq-5-ac)
|
|
lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
|
|
label_mac="$lan_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)
|
|
ipq40xx_setup_interfaces $board
|
|
ipq40xx_setup_macs $board
|
|
board_config_flush
|
|
|
|
exit 0
|