Skip to content

Commit

Permalink
add support for tiny kernel for ar71xx (Tplink 4M or DW33D etc)
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Jan 14, 2018
1 parent 8e41d20 commit 66dbc4d
Show file tree
Hide file tree
Showing 83 changed files with 3,104 additions and 4,315 deletions.
2 changes: 1 addition & 1 deletion config/Config-kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ config KERNEL_PROFILING

config KERNEL_KALLSYMS
bool "Compile the kernel with symbol table information"
default y if !SMALL_FLASH
default n
help
This will give you more information in stack traces from kernel oopses.

Expand Down
4 changes: 2 additions & 2 deletions target/linux/ar71xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ BOARD:=ar71xx
BOARDNAME:=Atheros AR7xxx/AR9xxx
FEATURES:=usbgadget
CPU_TYPE:=24kc
SUBTARGETS:=generic nand mikrotik
SUBTARGETS:=generic tiny nand mikrotik

KERNEL_PATCHVER:=4.9
KERNEL_PATCHVER:=4.4

include $(INCLUDE_DIR)/target.mk

Expand Down
82 changes: 35 additions & 47 deletions target/linux/ar71xx/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ bsb)
ucidef_set_led_default "sys" "SYS" "$board:red:sys" "1"
;;
bullet-m|\
loco-m-xw|\
nanostation-m|\
rocket-m|\
rocket-m-xw|\
nanostation-m-xw|\
loco-m-xw)
rocket-m|\
rocket-m-xw)
ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100" "0" "13"
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100" "-25" "13"
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100" "-50" "13"
Expand Down Expand Up @@ -302,8 +302,8 @@ rb-962uigs-5hact2hnt)
rb-2011il|\
rb-2011l|\
rb-2011uas|\
rb-2011uias|\
rb-2011uas-2hnd|\
rb-2011uias|\
rb-2011uias-2hnd)
ucidef_set_led_switch "eth6" "ETH6" "rb:green:eth6" "switch1" "0x20"
ucidef_set_led_switch "eth7" "ETH7" "rb:green:eth7" "switch1" "0x10"
Expand All @@ -320,11 +320,21 @@ rb-lhg-5nd)
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "rb:green:rssi3" "wlan0" "60" "100" "-59" "13"
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "rb:green:rssi4" "wlan0" "80" "100" "-79" "13"
;;
rb-map-2nd)
ucidef_set_led_switch "eth1" "WAN" "rb:green:eth1" "switch0" "0x02"
ucidef_set_led_switch "eth2" "LAN" "rb:green:eth2" "switch0" "0x04"
ucidef_set_led_gpio "poe" "POE" "rb:red:poe_out" "14" "0"
ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
;;
rb-mapl-2nd)
ucidef_set_led_default "power" "POWER" "rb:green:power" "1"
ucidef_set_led_netdev "lan" "LAN" "rb:green:eth" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
;;
rb-wap-2nd)
ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
;;
dap-2695-a1)
ucidef_set_led_default "power" "POWER" "d-link:green:power" "1"
ucidef_set_led_default "diag" "DIAG" "d-link:red:power" "0"
Expand Down Expand Up @@ -387,7 +397,11 @@ gl-mifi)
ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
ucidef_set_led_netdev "3gnet" "3GNET" "$board:green:net" "3g-wan"
;;
gl-ar150|\
gl-ar150)
ucidef_set_led_wlan "wlan" "WLAN" "$board:orange:wlan" "phy0tpt"
ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
;;
gl-ar300)
ucidef_set_led_wlan "wlan" "WLAN" "$board:wlan" "phy0tpt"
;;
Expand Down Expand Up @@ -420,14 +434,6 @@ hornet-ub-x2)
ucidef_set_led_wlan "wlan" "WLAN" "alfa:blue:wlan" "phy0tpt"
ucidef_set_led_usbdev "usb" "USB" "alfa:blue:usb" "1-1"
;;
maselink-ap2600i)
ucidef_set_led_netdev "wan" "WAN" "ap2600i:green:run" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "ap2600i:green:wlan" "phy0tpt"
;;
maselink-ap2600ifm)
ucidef_set_led_wlan "wlan1" "WLAN1" "ap2600ifm:green:rf1" "phy0tpt"
ucidef_set_led_wlan "wlan2" "WLAN2" "ap2600ifm:green:rf2" "phy1tpt"
;;
mc-mac1200r)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "mercury:green:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "mercury:green:wlan5g" "phy0tpt"
Expand Down Expand Up @@ -471,13 +477,6 @@ mr900v2)
ucidef_set_led_default "status-red" "Status (red)" "mr900:red:wifi" "0"
ucidef_set_led_default "status-green" "Status (green)" "mr900:green:wifi" "0"
;;
mw316r-v1)
ucidef_set_led_netdev "wan" "WAN" "mercury:green:wan" "eth0"
ucidef_set_led_switch "lan1" "LAN1" "mercury:green:lan1" "switch0" "0x02"
ucidef_set_led_switch "lan2" "LAN2" "mercury:green:lan2" "switch0" "0x04"
ucidef_set_led_switch "lan3" "LAN3" "mercury:green:lan3" "switch0" "0x08"
ucidef_set_led_switch "lan4" "LAN4" "mercury:green:lan4" "switch0" "0x10"
;;
mynet-n600)
ucidef_set_led_netdev "wan" "WAN" "wd:blue:internet" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "wd:green:lan1" "switch0" "0x02"
Expand Down Expand Up @@ -516,13 +515,13 @@ nbg6716)
ucidef_set_led_usbdev "usb2" "USB2" "$board:white:usb2" "2-1"
;;
om2p|\
om2pv2|\
om2pv4|\
om2p-hs|\
om2p-hsv2|\
om2p-hsv3|\
om2p-hsv4|\
om2p-lc)
om2p-lc|\
om2pv2|\
om2pv4)
ucidef_set_led_netdev "port1" "port1" "om2p:blue:wan" "eth0"
ucidef_set_led_netdev "port2" "port2" "om2p:blue:lan" "eth1"
ucidef_set_led_default "wlan-red" "WLAN (red)" "om2p:red:wifi" "0"
Expand Down Expand Up @@ -580,13 +579,6 @@ re450)
ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan5g" "phy0tpt"
;;
sgr-w500-ebi-fit-v3)
ucidef_set_led_netdev "wan" "WAN" "grentech:green:wan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "grentech:green:wlan" "phy0tpt"
;;
sgr-w500-n85b-v2)
ucidef_set_led_wlan "wlan" "WLAN" "grentech:green:wlan2g" "phy0tpt"
;;
smart-300)
ucidef_set_led_netdev "wan" "WAN" "nc-link:green:wan" "eth0"
ucidef_set_led_switch "lan1" "LAN1" "nc-link:green:lan1" "switch0" "0x04"
Expand Down Expand Up @@ -662,8 +654,8 @@ tl-wr941nd-v5)
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"

case "$board" in
tl-wr842n-v2|\
tl-mr3420-v2)
tl-mr3420-v2|\
tl-wr842n-v2)
ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1"
;;
esac
Expand Down Expand Up @@ -708,11 +700,12 @@ tl-wa850re-v2)
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:blue:signal5" "wlan0" "80" "100" "-79" "13"
;;
tl-wa701nd-v2|\
tl-wa860re|\
tl-wa830re-v2|\
tl-wa801nd-v2|\
tl-wa830re-v2|\
tl-wa860re|\
tl-wa901nd-v3|\
tl-wa901nd-v4)
tl-wa901nd-v4|\
tl-wa901nd-v5)
ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
;;
Expand All @@ -721,7 +714,6 @@ tl-wa901nd)
;;
tl-wa901nd-v2|\
tl-wr941nd|\
tl-wr941n-v7|\
tl-wr1041n-v2)
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
;;
Expand All @@ -744,7 +736,6 @@ tl-wdr4900-v2)
ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy1tpt"
;;
tl-wdr6500-v2|\
tl-wdr6500-v6|\
tl-wr741nd)
ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02"
Expand All @@ -767,7 +758,6 @@ tl-wpa8630)
tl-wr740n-v6|\
tl-wr841n-v9|\
tl-wr841n-v11|\
tl-wr842n-v9|\
tl-wr842n-v3)
ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
Expand All @@ -777,7 +767,6 @@ tl-wr842n-v3)
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"

case "$board" in
tl-wr842n-v9|\
tl-wr842n-v3)
ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1"
;;
Expand Down Expand Up @@ -824,26 +813,25 @@ tl-wr1043nd-v2)
ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1"
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
;;
tl-wr1043n-v5|\
tl-wr1043nd-v4)
ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1"
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x20"
ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"

case "$board" in
tl-wr1043nd-v4)
ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1"
;;
esac
;;
tl-wr2543n)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:green:wlan2g" "phy0tpt"
ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1"
;;
tl-wr882n-v1)
ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
;;
tube2h)
ucidef_set_led_netdev "lan" "LAN" "alfa:blue:lan" "eth0"
ucidef_set_rssimon "wlan0" "200000" "1"
Expand Down
38 changes: 19 additions & 19 deletions target/linux/ar71xx/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ ar71xx_setup_interfaces()
tl-wr841n-v11|\
tl-wr841n-v9|\
tl-wr842n-v3|\
tl-wr842n-v9|\
tl-wr882n-v1|\
whr-g301n|\
whr-hp-g300n|\
whr-hp-gn|\
Expand All @@ -72,6 +70,7 @@ ar71xx_setup_interfaces()
cap4200ag|\
cf-e380ac-v1|\
cf-e380ac-v2|\
dr342|\
eap120|\
eap300v2|\
eap7660d|\
Expand All @@ -98,10 +97,12 @@ ar71xx_setup_interfaces()
rb-911g-5hpnd|\
rb-912uag-2hpnd|\
rb-912uag-5hpnd|\
rb-921gs-5hpacd-r2|\
rb-lhg-5nd|\
rb-mapl-2nd|\
rb-sxt2n|\
rb-sxt5n|\
rb-wap-2nd|\
re450|\
rocket-m-xw|\
sc300m |\
Expand All @@ -124,18 +125,16 @@ ar71xx_setup_interfaces()
tl-wa901nd-v2|\
tl-wa901nd-v3|\
tl-wa901nd-v4|\
tl-wa901nd-v5|\
tl-wr703n|\
tl-wr802n-v1|\
tl-wr802n-v2|\
tl-wr902ac-v1|\
tube2h|\
unifi|\
unifiac-lite|\
wi2a-ac200i|\
wndap360|\
sgr-w500-n85b-v2|\
sgr-w500-ebi-fit-v3|\
maselink-ap2600i|\
maselink-ap2600ifm|\
wp543)
ucidef_set_interface_lan "eth0"
;;
Expand All @@ -151,29 +150,25 @@ ar71xx_setup_interfaces()
gl-inet|\
gl-mifi|\
jwap003|\
om2pv4|\
om2p-hsv4|\
om2pv4|\
pb42|\
pb44|\
rb-951ui-2hnd|\
rb-951ui-2nd|\
rb-952ui-5ac2nd|\
routerstation|\
tl-wr710n|\
tl-wr720n-v3|\
tl-wr810n|\
tl-wr810n-v2|\
wpe72|\
wrtnode2q)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
mw316r-v1)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
;;
rb-750-r2|\
rb-750p-pbr2|\
rb-750up-r2)
rb-750up-r2|\
rb-951ui-2nd)
ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
Expand All @@ -182,6 +177,7 @@ ar71xx_setup_interfaces()
all0315n|\
dlan-hotspot|\
dlan-pro-500-wp|\
ens202ext|\
ja76pf2|\
rocket-m-ti|\
ubnt-unifi-outdoor)
Expand Down Expand Up @@ -283,7 +279,8 @@ ar71xx_setup_interfaces()
dir-835-a1|\
esr900|\
mynet-n750|\
sr3200)
sr3200|\
tl-wr1043n-v5)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
;;
Expand Down Expand Up @@ -322,7 +319,6 @@ ar71xx_setup_interfaces()
r6100|\
smart-300|\
tl-wdr6500-v2|\
tl-wdr6500-v6|\
tl-wr940n-v4|\
tl-wr941nd-v6|\
wnr1000-v2|\
Expand Down Expand Up @@ -423,9 +419,13 @@ ar71xx_setup_interfaces()
rb-493g)
ucidef_set_interfaces_lan_wan "eth0.1 eth1.1" "eth1.2"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
"0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
ucidef_add_switch "switch1" \
"0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
"0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
;;
rb-map-2nd)
ucidef_add_switch "switch0" \
"0@eth0" "1:wan" "2:lan"
;;
tellstick-znet-lite)
ucidef_set_interface_wan "eth0"
Expand All @@ -442,7 +442,6 @@ ar71xx_setup_interfaces()
;;
archer-c7-v4|\
tl-wdr4300|\
tl-wr941n-v7|\
tl-wr1041n-v2)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
Expand Down Expand Up @@ -546,6 +545,7 @@ ar71xx_setup_macs()
fritz300e)
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
;;
tl-wr1043n-v5|\
tl-wr1043nd-v4)
lan_mac=$(mtd_get_mac_binary product-info 8)
wan_mac=$(macaddr_add "$lan_mac" 1)
Expand Down
Loading

0 comments on commit 66dbc4d

Please sign in to comment.