ar71xx: bring back Atheros AP83 support
authorZoltan HERPAI <wigyori@uid0.hu>
Tue, 5 May 2020 15:09:35 +0000 (17:09 +0200)
committerZoltan HERPAI <wigyori@uid0.hu>
Mon, 7 Sep 2020 16:45:42 +0000 (18:45 +0200)
I still have a (working!) AP83-040 board, so let's bring back
support for it. Changes since it was dropped:

 - WLAN LED isn't working, "fixme"
 - hardcoded flash layout was added back into the mach file
 - sysupgrade is "fixme"
 - the flash mechanism and the custom SPI driver was not
   modernized, but they compile and work.

Other than these notes, the board is working as expected.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
13 files changed:
target/linux/ar71xx/base-files/etc/board.d/01_leds [new file with mode: 0755]
target/linux/ar71xx/base-files/etc/board.d/02_network [new file with mode: 0755]
target/linux/ar71xx/base-files/etc/diag.sh [new file with mode: 0644]
target/linux/ar71xx/base-files/lib/ar71xx.sh [new file with mode: 0755]
target/linux/ar71xx/base-files/lib/upgrade/platform.sh [new file with mode: 0755]
target/linux/ar71xx/config-4.14 [new file with mode: 0644]
target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt [new file with mode: 0644]
target/linux/ar71xx/files/arch/mips/ath79/Makefile [new file with mode: 0644]
target/linux/ar71xx/files/arch/mips/ath79/mach-ap83.c [new file with mode: 0644]
target/linux/ar71xx/files/arch/mips/ath79/machtypes.h [new file with mode: 0644]
target/linux/ar71xx/generic/config-default [new file with mode: 0644]
target/linux/ar71xx/image/generic-legacy-devices.mk [new file with mode: 0644]
target/linux/ar71xx/image/legacy.mk [new file with mode: 0644]

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
new file mode 100755 (executable)
index 0000000..2c6cbc7
--- /dev/null
@@ -0,0 +1,1133 @@
+#!/bin/sh
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+board=$(board_name)
+
+case "$board" in
+a40)
+       ucidef_set_led_default "status-red" "Status (red)" "a40:red:status" "0"
+       ucidef_set_led_default "status-blue" "Status (blue)" "a40:blue:status" "0"
+       ;;
+a60)
+       ucidef_set_led_default "status-red" "Status (red)" "a60:red:status" "0"
+       ucidef_set_led_default "status-blue" "Status (blue)" "a60:blue:status" "0"
+       ;;
+ap83)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ;;
+airgateway|\
+airgatewaypro)
+       ucidef_set_led_wlan "wlan" "WLAN" "ubnt:blue:wlan" "phy0tpt"
+       ;;
+alfa-nx)
+       ucidef_set_led_netdev "wan" "WAN" "alfa:green:led_2" "eth0"
+       ucidef_set_led_netdev "lan" "LAN" "alfa:green:led_3" "eth1"
+       ;;
+all0258n|\
+all0315n)
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "$board:red:rssilow" "wlan0" "1" "40" "0" "6"
+       ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$board:yellow:rssimedium" "wlan0" "30" "80" "-29" "5"
+       ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$board:green:rssihigh" "wlan0" "70" "100" "-69" "8"
+       ;;
+antminer-s1|\
+antminer-s3)
+       ucidef_set_led_default "sys" "SYS" "$board:green:sys" "0"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+
+       case "$board" in
+       antminer-s3)
+               ucidef_set_led_default "lan" "LAN" "$board:yellow:lan" "0"
+               ;;
+       esac
+       ;;
+antrouter-r1)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ucidef_set_led_default "btc" "BTC" "$board:green:btc" "0"
+       ;;
+ap121f)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ;;
+ap147-010)
+       ucidef_set_led_netdev "wan" "WAN" "ap147:green:wan" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "ap147:green:lan1" "switch0" "0x10"
+       ucidef_set_led_switch "lan2" "LAN2" "ap147:green:lan2" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "ap147:green:lan3" "switch0" "0x04"
+       ucidef_set_led_switch "lan4" "LAN4" "ap147:green:lan4" "switch0" "0x02"
+       ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "ap147:green:wlan-2g" "phy0tpt"
+       ;;
+ap90q|\
+cpe505n|\
+cpe830|\
+cpe870|\
+dr531|\
+e600g-v2|\
+e600gac-v2|\
+e750a-v4)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
+       ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1"
+
+       case "$board" in
+       ap90q)
+               ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+               ;;
+       cpe505n)
+               ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt"
+               ;;
+       cpe830|\
+       cpe870)
+               ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+               ucidef_set_rssimon "wlan0" "200000" "1"
+               ucidef_set_led_rssi "rssilow" "RSSILOW" "$board:green:link1" "wlan0" "1" "100" "0" "13"
+               ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$board:green:link2" "wlan0" "26" "100" "-25" "13"
+               ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$board:green:link3" "wlan0" "51" "100" "-50" "13"
+               ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$board:green:link4" "wlan0" "76" "100" "-75" "13"
+               ;;
+       esac
+       ;;
+ap531b0|\
+gl-usb150|\
+sc1750|\
+sc450)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ;;
+ap91-5g|\
+n5q)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "signal1" "SIGNAL1" "$board:red:signal1" "wlan0" "1" "100"
+       ucidef_set_led_rssi "signal2" "SIGNAL2" "$board:orange:signal2" "wlan0" "25" "100"
+       ucidef_set_led_rssi "signal3" "SIGNAL3" "$board:green:signal3" "wlan0" "50" "100"
+       ucidef_set_led_rssi "signal4" "SIGNAL4" "$board:green:signal4" "wlan0" "75" "100"
+
+       case "$board" in
+       n5q)
+               ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1"
+               ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+               ;;
+       esac
+       ;;
+archer-c25-v1)
+       ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
+       ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan1" "switch0" "0x10"
+       ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x04"
+       ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan4" "switch0" "0x02"
+       ;;
+archer-c5|\
+archer-c7)
+       ucidef_set_led_usbport "usb1" "USB1" "tp-link:green:usb1" "usb1-port1"
+       ucidef_set_led_usbport "usb2" "USB2" "tp-link:green:usb2" "usb2-port1"
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:green:wlan2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:green:wlan5g" "phy0tpt"
+       ;;
+archer-c58-v1|\
+archer-c59-v1|\
+archer-c59-v2|\
+archer-c60-v1|\
+archer-c60-v2)
+       ucidef_set_led_switch "lan" "LAN" "$board:green:lan" "switch0" "0x1E"
+       ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
+
+       case "$board" in
+       archer-c59-v1|\
+       archer-c59-v2)
+               ucidef_set_led_usbport "usb" "USB" "$board:green:usb" "usb1-port1"
+               ;;
+       esac
+       ;;
+archer-c7-v4|\
+archer-c7-v5)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
+       ucidef_set_led_switch "wan" "WAN" "$board:green:wan" "switch0" "0x02"
+       ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan4" "switch0" "0x04"
+       ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan3" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan2" "switch0" "0x10"
+       ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan1" "switch0" "0x20"
+
+       case "$board" in
+       archer-c7-v4)
+               ucidef_set_led_usbport "usb1" "USB1" "$board:green:usb1" "usb1-port1"
+               ucidef_set_led_usbport "usb2" "USB2" "$board:green:usb2" "usb2-port1"
+               ;;
+       esac
+
+       case "$board" in
+       archer-c7-v5)
+               ucidef_set_led_usbport "usb" "USB" "$board:green:usb" "usb1-port1"
+               ;;
+       esac
+       ;;
+arduino-yun)
+       ucidef_set_led_wlan "wlan" "WLAN" "arduino:blue:wlan" "phy0tpt"
+       ucidef_set_led_usbport "usb" "USB" "arduino:white:usb" "1-1-port1"
+       ;;
+bhr-4grv2)
+       ucidef_set_led_default "power" "POWER" "buffalo:green:power" "1"
+       ucidef_set_led_default "diag" "DIAG" "buffalo:red:diag" "0"
+       ;;
+bsb)
+       ucidef_set_led_default "sys" "SYS" "$board:red:sys" "1"
+       ;;
+bullet-m|\
+bullet-m-xw|\
+loco-m-xw|\
+nanostation-m|\
+nanostation-m-xw|\
+rocket-m|\
+rocket-m-xw)
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100"
+       ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100"
+       ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100"
+       ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link4" "wlan0" "76" "100"
+       ;;
+bxu2000n-2-a1)
+       ucidef_set_led_wlan "wlan" "WLAN" "bhu:green:wlan" "phy0tpt"
+       ;;
+cap324)
+       ucidef_set_led_netdev "lan" "LAN" "pcs:green:lan" "eth0"
+       ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "pcs:amber:wlan" "phy0tpt"
+       ucidef_set_led_wlan "wlan_green" "WLAN_GREEN" "pcs:green:wlan" "phy1tpt"
+       ;;
+c-55)
+       ucidef_set_led_netdev "lan_green" "LAN_GREEN" "$board:green:lan" "eth0"
+       ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "$board:amber:wlan" "phy0tpt"
+       ucidef_set_led_wlan "wlan_green" "WLAN_GREEN" "$board:green:wlan" "phy1tpt"
+       ;;
+c-60)
+       ucidef_set_led_wlan "wlan1_green" "WLAN1_GREEN" "$board:green:wlan1" "phy0tpt"
+       ucidef_set_led_wlan "wlan2_green" "WLAN2_GREEN" "$board:green:wlan2" "phy1tpt"
+       ;;
+cap4200ag)
+       ucidef_set_led_default "lan_green" "LAN_GREEN" "senao:green:lan" "1"
+       ucidef_set_led_wlan "wlan_amber" "WLAN_AMBER" "senao:amber:wlan" "phy0tpt"
+       ucidef_set_led_wlan "wlan_green" "WLAN_GREEN" "senao:green:wlan" "phy1tpt"
+       ;;
+carambola2)
+       ucidef_set_led_netdev "lan" "LAN" "$board:orange:eth0" "eth0"
+       ucidef_set_led_netdev "wan" "WAN" "$board:orange:eth1" "eth1"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ;;
+cf-e316n-v2)
+       ucidef_set_led_netdev "lan" "LAN" "$board:blue:lan" "eth0"
+       ucidef_set_led_netdev "wan" "WAN" "$board:blue:wan" "eth1"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt"
+       ;;
+cf-e320n-v2)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
+       ucidef_set_led_netdev "wan" "WAN" "$board:red:wan" "eth1"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt"
+       ;;
+cf-e355ac-v1|\
+cf-e355ac-v2|\
+cf-e375ac|\
+cf-e380ac-v1|\
+cf-e380ac-v2|\
+cf-e385ac)
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:blue:wlan2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:red:wlan5g" "phy0tpt"
+
+       case "$board" in
+       cf-e375ac|\
+       cf-e385ac)
+               ucidef_set_led_switch "lan" "LAN" "$board:green:lan" "switch0" "0x04"
+               ;;
+       *)
+               ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
+               ;;
+       esac
+       ;;
+cf-e520n|\
+cf-e530n)
+       ucidef_set_led_netdev "wan" "WAN" "$board:blue:wan" "eth1"
+       ;;
+cpe210|\
+cpe210-v2|\
+cpe210-v3|\
+cpe510|\
+cpe510-v2|\
+wbs210|\
+wbs510)
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" "0" "13"
+       ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "26" "100" "-25" "13"
+       ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
+       ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
+
+       case "$board" in
+       cpe210-v2|\
+       cpe210-v3|\
+       cpe510-v2)
+               ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan0" "eth0"
+               ;;
+       *)
+               ucidef_set_led_switch "lan0" "LAN0" "tp-link:green:lan0" "switch0" "0x20"
+               ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
+               ;;
+       esac
+       ;;
+cr3000)
+       ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "pcs:blue:lan1" "switch0" "0x04"
+       ucidef_set_led_switch "lan2" "LAN2" "pcs:blue:lan2" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "pcs:blue:lan3" "switch0" "0x10"
+       ucidef_set_led_switch "lan4" "LAN4" "pcs:blue:lan4" "switch0" "0x02"
+       ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+       ;;
+cr5000)
+       ucidef_set_led_wlan "wlan" "WLAN" "pcs:blue:wlan" "phy0tpt"
+       ucidef_set_led_usbport "usb" "USB" "pcs:white:wps" "usb1-port1"
+       ;;
+db120)
+       ucidef_set_led_usbport "usb" "USB" "$board:green:usb" "usb1-port1"
+       ;;
+dr344)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
+       ;;
+dragino2)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt"
+       ucidef_set_led_netdev "lan" "LAN" "$board:red:lan" "eth0"
+       ucidef_set_led_netdev "wan" "WAN" "$board:red:wan" "eth1"
+       ;;
+dw33d)
+       ucidef_set_led_usbport "mmc" "MMC" "$board:blue:mmc" "usb1-port1"
+       ucidef_set_led_usbport "usb" "USB" "$board:blue:usb" "usb2-port1"
+       ucidef_set_led_netdev "internet" "INTERNET" "$board:blue:internet" "eth0"
+       ucidef_set_led_wlan "wlan2g" "WLAN-2.4G" "$board:blue:wlan-2g" "phy1tpt"
+       ;;
+eap300v2)
+       ucidef_set_led_netdev "lan" "LAN" "engenius:blue:lan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "engenius:blue:wlan" "phy0tpt"
+       ;;
+ens202ext)
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "engenius:amber:wlan1" "wlan0" "1"  "100" "0" "13"
+       ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "engenius:red:wlan2" "wlan0" "25" "100" "-39" "13"
+       ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "engenius:amber:wlan3" "wlan0" "50" "100" "-59" "13"
+       ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "engenius:green:wlan4" "wlan0" "75" "100" "-79" "13"
+       ;;
+f9k1115v2)
+       ucidef_set_led_usbport "usb2" "USB2" "belkin:green:usb2" "usb1-port1"
+       ;;
+fritz300e)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "$board:green:rssi0" "wlan0" "1" "100"
+       ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$board:green:rssi1" "wlan0" "20" "100"
+       ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$board:green:rssi2" "wlan0" "40" "100"
+       ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$board:green:rssi3" "wlan0" "60" "100"
+       ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$board:green:rssi4" "wlan0" "80" "100"
+       ;;
+dap-1330-a1)
+       ucidef_set_rssimon "wlan0" "2000000" "2"
+       ucidef_set_led_rssi "wifi-low" "wifi-low" "d-link:red:wifi" "wlan0" "1" "29"
+       ucidef_set_led_rssi "wifi-medium" "wifi-medium" "d-link:green:wifi" "wlan0" "30" "100"
+       ucidef_set_led_rssi "wifi-high" "wifi-high" "d-link:green:signal1" "wlan0" "50" "100"
+       ucidef_set_led_rssi "wifi-max" "wifi-max" "d-link:green:signal2" "wlan0" "70" "100"
+       ;;
+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"
+       ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "d-link:green:wlan2g" "phy1tpt"
+       ;;
+dhp-1565-a1)
+       ucidef_set_led_switch "wan" "WAN" "d-link:green:planet" "switch0" "0x20"
+       ;;
+dir-600-a1|\
+dir-615-e1|\
+dir-615-e4|\
+ebr-2310-c1)
+       ucidef_set_led_netdev "wan" "WAN" "d-link:green:wan" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "d-link:green:lan1" "switch0" "0x02"
+       ucidef_set_led_switch "lan2" "LAN2" "d-link:green:lan2" "switch0" "0x04"
+       ucidef_set_led_switch "lan3" "LAN3" "d-link:green:lan3" "switch0" "0x08"
+       ucidef_set_led_switch "lan4" "LAN4" "d-link:green:lan4" "switch0" "0x10"
+       ;;
+dir-615-c1)
+       ucidef_set_led_netdev "wan" "WAN" "d-link:green:wan" "eth1"
+       ucidef_set_led_wlan "wlan" "WLAN" "d-link:green:wlan" "phy0tpt"
+       ;;
+dir-825-b1|\
+dir-825-c1)
+       ucidef_set_led_usbport "usb" "USB" "d-link:blue:usb" "usb1-port1"
+
+       case "$board" in
+       dir-825-c1)
+               ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "d-link:blue:wlan2g" "phy0tpt"
+               ;;
+       esac
+       ;;
+dir-615-i1)
+       ucidef_set_led_default "power" "POWER" "d-link:green:power" "1"
+       ucidef_set_led_default "diag" "DIAG" "d-link:amber:power" "0"
+       ucidef_set_led_default "wps" "WPS" "d-link:blue:wps" "0"
+       ucidef_set_led_netdev "wan" "WAN" "d-link:green:wan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "d-link:green:wlan" "phy0tpt"
+       ;;
+dlan-hotspot)
+       ucidef_set_led_wlan "wlan" "WLAN" "devolo:green:wifi" "phy0tpt"
+       ;;
+dlan-pro-500-wp)
+       ucidef_set_led_default "power" "System Power" "devolo:green:status" "1"
+       ucidef_set_led_netdev "lan" "Ethernet Activity" "devolo:green:eth" "br-lan"
+       ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "devolo:green:wlan-2g" "phy0tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "devolo:blue:wlan-5g" "none"
+       ;;
+dlan-pro-1200-ac)
+       ucidef_set_led_wlan "wlan" "WLAN" "devolo:status:wlan" "phy0radio"
+       ucidef_set_led_gpio "plcw" "dLAN" "devolo:status:dlan" "17" "0"
+       ucidef_set_led_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
+       ;;
+e1700ac-v2)
+       ucidef_set_led_usbport "usb" "USB" "$board:green:usb" "usb1-port1"
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:green:wlan2g" "phy1tpt"
+       ;;
+e558-v2|\
+e750g-v8)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ;;
+esr900)
+       ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "engenius:blue:wlan-2g" "phy0tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "engenius:blue:wlan-5g" "phy1tpt"
+       ;;
+esr1750|\
+epg5000)
+       ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan-2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan-5g" "phy0tpt"
+       ;;
+fritz4020)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
+       ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ;;
+fritz450e)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ;;
+gl-ar300m)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt"
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
+       ;;
+gl-ar750)
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:white:wlan2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:white:wlan5g" "phy0tpt"
+       ;;
+gl-ar750s)
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:green:wlan2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
+       ;;
+gl-mifi)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
+       ucidef_set_led_netdev "3gnet" "3GNET" "$board:green:net" "3g-wan"
+       ;;
+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"
+       ;;
+gl-domino|\
+sc300m|\
+wrt160nl)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt"
+       ;;
+gl-inet)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt"
+       ;;
+hiwifi-hc6361)
+       ucidef_set_led_netdev "inet" "INET" "hiwifi:blue:internet" "eth1"
+       ucidef_set_led_wlan "wlan" "WLAN" "hiwifi:blue:wlan-2p4" "phy0tpt"
+       ;;
+hornet-ub|\
+hornet-ub-x2)
+       ucidef_set_led_netdev "lan" "LAN" "alfa:blue:lan" "eth0"
+       ucidef_set_led_netdev "wan" "WAN" "alfa:blue:wan" "eth1"
+       ucidef_set_led_wlan "wlan" "WLAN" "alfa:blue:wlan" "phy0tpt"
+       ucidef_set_led_usbport "usb" "USB" "alfa:blue:usb" "usb1-port1"
+       ;;
+koala)
+       ucidef_set_led_default "power" "POWER" "$board:green:power" "1"
+       ucidef_set_led_wlan "wlan2g" "WLAN 2.4GHz" "$board:yellow:wlan2" "phy1tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN 5GHz" "$board:red:wlan58" "phy0tpt"
+       ;;
+lan-turtle)
+       ucidef_set_led_netdev "wan" "WAN" "$board:orange:system" "eth1"
+       ;;
+lbe-m5)
+       ucidef_set_led_netdev "lan" "LAN" "ubnt:green:lan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "ubnt:green:wlan" "phy0tpt"
+       ;;
+mc-mac1200r)
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "mercury:green:wlan2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "mercury:green:wlan5g" "phy0tpt"
+       ;;
+mr12|\
+mr16)
+       ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
+       ucidef_set_led_wlan "wlan1" "WLAN1" "$board:green:wifi1" "phy0assoc"
+       ucidef_set_led_wlan "wlan2" "WLAN2" "$board:green:wifi2" "phy0assoc"
+       ucidef_set_led_wlan "wlan3" "WLAN3" "$board:green:wifi3" "phy0assoc"
+       ucidef_set_led_wlan "wlan4" "WLAN4" "$board:green:wifi4" "phy0tpt"
+       ;;
+mr18)
+       ucidef_set_led_netdev "wlan0" "WLAN0" "$board:blue:tricolor0" "wlan0"
+       ;;
+mr600)
+       ucidef_set_led_wlan "wlan58" "WLAN58" "$board:green:wlan58" "phy0tpt"
+       ucidef_set_led_default "wps" "WPS" "mr600:blue:wps" "0"
+       ;;
+mr600v2)
+       ucidef_set_led_default "wlan24-red" "WLAN 2.4GHz (red)" "mr600:red:wlan24" "0"
+       ucidef_set_led_default "wlan24-yellow" "WLAN 2.4GHz (yellow)" "mr600:yellow:wlan24" "0"
+       ucidef_set_led_wlan "wlan24-green" "WLAN 4GHz (green)" "mr600:green:wlan24" "phy1tpt"
+       ucidef_set_led_default "wlan5-red" "WLAN 5GHz (red)" "mr600:red:wlan58" "0"
+       ucidef_set_led_default "wlan5-yellow" "WLAN 5GHz (yellow)" "mr600:yellow:wlan58" "0"
+       ucidef_set_led_wlan "wlan5-green" "WLAN 5GHz (green)" "mr600:green:wlan58" "phy0tpt"
+       ;;
+mr1750|\
+mr1750v2)
+       ucidef_set_led_netdev "lan" "LAN" "mr1750:blue:wan" "eth0"
+       ucidef_set_led_wlan "wlan58" "WLAN58" "mr1750:blue:wlan58" "phy0tpt"
+       ucidef_set_led_wlan "wlan24" "WLAN24" "mr1750:blue:wlan24" "phy1tpt"
+       ucidef_set_led_default "status-red" "Status (red)" "mr1750:red:wifi" "0"
+       ucidef_set_led_default "status-green" "Status (green)" "mr1750:green:wifi" "0"
+       ;;
+mr900|\
+mr900v2)
+       ucidef_set_led_netdev "lan" "LAN" "mr900:blue:wan" "eth0"
+       ucidef_set_led_wlan "wlan24" "WLAN24" "mr900:blue:wlan24" "phy0tpt"
+       ucidef_set_led_wlan "wlan58" "WLAN58" "mr900:blue:wlan58" "phy1tpt"
+       ucidef_set_led_default "status-red" "Status (red)" "mr900:red:wifi" "0"
+       ucidef_set_led_default "status-green" "Status (green)" "mr900:green:wifi" "0"
+       ;;
+mynet-n600)
+       ucidef_set_led_netdev "wan" "WAN" "wd:blue:internet" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "wd:green:lan1" "switch0" "0x02"
+       ucidef_set_led_switch "lan2" "LAN2" "wd:green:lan2" "switch0" "0x10"
+       ucidef_set_led_switch "lan3" "LAN3" "wd:green:lan3" "switch0" "0x08"
+       ucidef_set_led_switch "lan4" "LAN4" "wd:green:lan4" "switch0" "0x04"
+       ;;
+mynet-rext)
+       ucidef_set_led_netdev "lan" "LAN" "wd:blue:ethernet" "eth0"
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "wd:blue:quality1" "wlan0" "1" "40" "0" "6"
+       ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "wd:blue:quality2" "wlan0" "30" "80" "-29" "5"
+       ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "wd:blue:quality3" "wlan0" "70" "100" "-69" "8"
+       ucidef_set_led_wlan "wlan" "WLAN" "wd:blue:wireless" "phy0tpt"
+       ;;
+mzk-w04u)
+       ucidef_set_led_usbport "usb" "USB" "planex:green:usb" "usb1-port1"
+       ;;
+mzk-w300nh)
+       ucidef_set_led_wlan "wlan" "WLAN" "planex:green:wlan" "phy0tpt"
+       ;;
+nbg460n_550n_550nh)
+       ucidef_set_led_wlan "wlan" "WLAN" "nbg460n:green:wlan" "phy0tpt"
+       ;;
+nbg6616)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wifi2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5" "WLAN5" "$board:green:wifi5g" "phy0tpt"
+       ucidef_set_led_usbport "usb1" "USB1" "$board:green:usb1" "usb1-port1"
+       ucidef_set_led_usbport "usb2" "USB2" "$board:green:usb2" "usb2-port1"
+       ;;
+nbg6716)
+       ucidef_set_led_netdev "wan" "WAN" "$board:white:internet" "eth1"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:white:wifi2g" "phy1tpt"
+       ucidef_set_led_wlan "wlan5" "WLAN5" "$board:white:wifi5g" "phy0tpt"
+       ucidef_set_led_usbport "usb1" "USB1" "$board:white:usb1" "usb1-port1"
+       ucidef_set_led_usbport "usb2" "USB2" "$board:white:usb2" "usb2-port1"
+       ;;
+om2p|\
+om2p-hs|\
+om2p-hsv2|\
+om2p-hsv3|\
+om2p-hsv4|\
+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"
+       ucidef_set_led_default "wlan-yellow" "WLAN (yellow)" "om2p:yellow:wifi" "0"
+       ucidef_set_led_default "wlan-green" "WLAN (green)" "om2p:green:wifi" "0"
+       ;;
+om5p|\
+om5p-an)
+       ucidef_set_led_netdev "port1" "port1" "om5p:blue:wan" "eth0"
+       ucidef_set_led_netdev "port2" "port2" "om5p:blue:lan" "eth1"
+       ucidef_set_led_default "wlan-red" "WLAN (red)" "om5p:red:wifi" "0"
+       ucidef_set_led_default "wlan-yellow" "WLAN (yellow)" "om5p:yellow:wifi" "0"
+       ucidef_set_led_default "wlan-green" "WLAN (green)" "om5p:green:wifi" "0"
+       ;;
+om5p-ac)
+       ucidef_set_led_netdev "port1" "port1" "om5pac:blue:lan" "eth0"
+       ucidef_set_led_netdev "port2" "port2" "om5pac:blue:wan" "eth1"
+       ucidef_set_led_default "wlan-red" "WLAN (red)" "om5pac:red:wifi" "0"
+       ucidef_set_led_default "wlan-yellow" "WLAN (yellow)" "om5pac:yellow:wifi" "0"
+       ucidef_set_led_default "wlan-green" "WLAN (green)" "om5pac:green:wifi" "0"
+       ;;
+om5p-acv2)
+       ucidef_set_led_default "wlan-red" "WLAN (red)" "om5pac:red:wifi" "0"
+       ucidef_set_led_default "wlan-yellow" "WLAN (yellow)" "om5pac:yellow:wifi" "0"
+       ucidef_set_led_default "wlan-green" "WLAN (green)" "om5pac:green:wifi" "0"
+       ;;
+omy-g1)
+       ucidef_set_led_wlan "wlan" "WLAN" "omy:green:wlan" "phy0tpt"
+       ucidef_set_led_netdev "wan" "WAN" "omy:green:wan" "eth0"
+       ucidef_set_led_netdev "lan" "LAN" "omy:green:lan" "eth1"
+       ;;
+omy-x1)
+       ucidef_set_led_default "power" "POWER" "omy:green:power" "1"
+       ucidef_set_led_default "wan" "WAN" "omy:green:wan" "eth0"
+       ;;
+pqi-air-pen)
+       ucidef_set_led_wlan "wlan" "WLAN" "pqi-air-pen:blue:wlan" "phy0tpt"
+       ucidef_set_led_default "wps" "WPS" "pqi-air-pen:blue:wps" "0"
+       ;;
+qihoo-c301)
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "qihoo:red:status" "phy1tpt"
+       ;;
+r36a)
+       ucidef_set_led_netdev "lan" "LAN" "$board:blue:lan" "eth0"
+       ucidef_set_led_usbport "usb" "USB" "$board:blue:usb" "usb1-port1"
+       ucidef_set_led_netdev "wan" "WAN" "$board:blue:wan" "eth1"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt"
+       ;;
+r602n|\
+t830|\
+zbt-we1526)
+       ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan1" "switch0" "0x10"
+       ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x04"
+       ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan4" "switch0" "0x02"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+
+       case "$board" in
+       t830)
+               ucidef_set_led_usbport "usb" "USB" "$board:green:usb" "usb1-port1"
+               ;;
+       esac
+       ;;
+r6100)
+       ucidef_set_led_netdev "wan" "WAN (green)" "netgear:green:wan" "eth0"
+       ucidef_set_led_usbport "usb" "USB" "netgear:blue:usb" "usb1-port1"
+       ucidef_set_led_wlan "wlan" "WLAN" "netgear:blue:wlan" "phy1tpt"
+       ;;
+rb-750)
+       ucidef_set_led_default "act" "act" "rb750:green:act" "1"
+       ucidef_set_led_netdev "port1" "port1" "rb750:green:port1" "eth1"
+       ucidef_set_led_switch "port2" "port2" "rb750:green:port2" "switch0" "0x10"
+       ucidef_set_led_switch "port3" "port3" "rb750:green:port3" "switch0" "0x08"
+       ucidef_set_led_switch "port4" "port4" "rb750:green:port4" "switch0" "0x04"
+       ucidef_set_led_switch "port5" "port5" "rb750:green:port5" "switch0" "0x02"
+       ;;
+rb-750-r2|\
+rb-750p-pbr2|\
+rb-750up-r2)
+       ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
+       ucidef_set_led_netdev "port1" "port1" "rb:green:port1" "eth0"
+       ucidef_set_led_switch "port2" "port2" "rb:green:port2" "switch0" "0x10"
+       ucidef_set_led_switch "port3" "port2" "rb:green:port3" "switch0" "0x08"
+       ucidef_set_led_switch "port4" "port3" "rb:green:port4" "switch0" "0x04"
+       ucidef_set_led_switch "port5" "port5" "rb:green:port5" "switch0" "0x02"
+       ;;
+rb-911-2hn|\
+rb-911-5hn)
+       ucidef_set_led_netdev "eth" "ETH" "rb:green:eth" "eth0"
+       ;;
+rb-931-2nd|\
+rb-941-2nd)
+       ucidef_set_led_timer "user" "USR/ACT" "rb:green:user" "1000" "1000"
+       ;;
+rb-951ui-2nd|\
+rb-952ui-5ac2nd)
+       ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
+       ucidef_set_led_netdev "port1" "port1" "rb:green:port1" "eth0"
+       ucidef_set_led_switch "port2" "port2" "rb:green:port2" "switch0" "0x10"
+       ucidef_set_led_switch "port3" "port2" "rb:green:port3" "switch0" "0x08"
+       ucidef_set_led_switch "port4" "port3" "rb:green:port4" "switch0" "0x04"
+       ucidef_set_led_switch "port5" "port5" "rb:green:port5" "switch0" "0x02"
+       ucidef_set_led_wlan "wlan" "WLAN" "rb:blue:wlan" "phy0tpt"
+       ;;
+rb-962uigs-5hact2hnt)
+       ucidef_set_led_timer "user" "USER/SFP" "rb:green:user" "1000" "1000"
+       ;;
+rb-2011il|\
+rb-2011ils|\
+rb-2011l|\
+rb-2011uas|\
+rb-2011uas-2hnd|\
+rb-2011uias|\
+rb-2011uias-2hnd|\
+rb-2011uias-2hnd-r2)
+       ucidef_set_led_switch "eth6" "ETH6" "rb:green:eth6" "switch1" "0x20"
+       ucidef_set_led_switch "eth7" "ETH7" "rb:green:eth7" "switch1" "0x10"
+       ucidef_set_led_switch "eth8" "ETH8" "rb:green:eth8" "switch1" "0x08"
+       ucidef_set_led_switch "eth9" "ETH9" "rb:green:eth9" "switch1" "0x04"
+       ucidef_set_led_switch "eth10" "ETH10" "rb:green:eth10" "switch1" "0x02"
+       ;;
+rb-lhg-5nd)
+       ucidef_set_led_netdev "lan" "LAN" "rb:green:eth" "eth0"
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "rb:green:rssi0" "wlan0" "1" "100" "0" "13"
+       ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "rb:green:rssi1" "wlan0" "20" "100" "-19" "13"
+       ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "rb:green:rssi2" "wlan0" "40" "100" "-39" "13"
+       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"
+       ;;
+rb-wapr-2nd)
+       ucidef_set_led_wlan "wlan" "WLAN" "rb:green:user" "phy0tpt"
+       ;;
+re355|\
+re450)
+       ucidef_set_led_netdev "lan_data" "LAN Data" "$board:green:lan_data" "eth0" "tx rx"
+       ucidef_set_led_netdev "lan_link" "LAN Link" "$board:green:lan_link" "eth0" "link"
+       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"
+       ;;
+rme-eg200)
+        ucidef_set_led_netdev "wan" "WAN" "eg200:red:eth0" "eth0"
+        ucidef_set_led_wlan "wlan" "WLAN" "eg200:red:wlan" "phy0tpt"
+        ucidef_set_led_oneshot "modbus" "Modbus" "eg200:red:modbus" "100" "33"
+        ucidef_set_led_default "etactica" "etactica" "eg200:red:etactica" "ignore"
+        ;;
+rocket-m-ti)
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssiverylow" "RSSIVERYLOW" "ubnt:green:link1" "wlan0" "1" "100"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:green:link2" "wlan0" "18" "100"
+       ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:green:link3" "wlan0" "34" "100"
+       ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link4" "wlan0" "51" "100"
+       ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "ubnt:green:link5" "wlan0" "67" "100"
+       ucidef_set_led_rssi "rssiveryhigh" "RSSIVERYHIGH" "ubnt:green:link6" "wlan0" "84" "100"
+       ;;
+rut900)
+       ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan1" "switch0" "0x10"
+       ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x04"
+       ;;
+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"
+       ucidef_set_led_switch "lan2" "LAN2" "nc-link:green:lan2" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "nc-link:green:lan3" "switch0" "0x10"
+       ucidef_set_led_switch "lan4" "LAN4" "nc-link:green:lan4" "switch0" "0x02"
+       ucidef_set_led_wlan "wlan" "WLAN" "nc-link:green:wlan" "phy0tpt"
+       ;;
+som9331)
+       ucidef_set_led_netdev "wan" "WAN" "$board:orange:wan" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "$board:orange:lan1" "switch0" "0x08"
+       ucidef_set_led_switch "lan2" "LAN2" "$board:orange:lan2" "switch0" "0x02"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt"
+       ucidef_set_led_usbport "usb" "USB" "$board:green:system" "usb1-port1"
+       ;;
+sr3200)
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:green:wlan2g" "phy1tpt"
+       ;;
+tellstick-znet-lite)
+       ucidef_set_led_netdev "lan_act" "LANACT" "tellstick:green:lan" "eth0" "tx rx"
+       ucidef_set_led_netdev "lan_link" "LANLINK" "tellstick:orange:lan" "eth0" "link"
+       ;;
+tew-712br)
+       ucidef_set_led_netdev "wan" "WAN" "trendnet:green:wan" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "trendnet:green:lan1" "switch0" "0x02"
+       ucidef_set_led_switch "lan2" "LAN2" "trendnet:green:lan2" "switch0" "0x04"
+       ucidef_set_led_switch "lan3" "LAN3" "trendnet:green:lan3" "switch0" "0x08"
+       ucidef_set_led_switch "lan4" "LAN4" "trendnet:green:lan4" "switch0" "0x10"
+       ucidef_set_led_wlan "wlan" "WLAN" "trendnet:green:wlan" "phy0tpt"
+       ;;
+tew-732br)
+       ucidef_set_led_netdev "wan" "WAN" "trendnet:green:wan" "eth1"
+       ;;
+tew-823dru)
+       ucidef_set_led_netdev "wan" "WAN" "trendnet:green:planet" "eth0"
+       ;;
+tl-mr11u|\
+tl-mr3020|\
+tl-mr3040|\
+tl-mr3040-v2)
+       ucidef_set_led_usbport "usb" "USB" "tp-link:green:3g" "usb1-port1"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
+       ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
+       ;;
+tl-mr3220|\
+tl-mr3420)
+       ucidef_set_led_usbport "usb" "USB" "tp-link:green:3g" "usb1-port1"
+       ;;
+tl-mr3220-v2|\
+tl-wr741nd-v4)
+       ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
+       ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
+       ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
+
+       case "$board" in
+       tl-mr3220-v2)
+               ucidef_set_led_usbport "usb" "USB" "tp-link:green:3g" "usb1-port1"
+               ;;
+       esac
+       ;;
+tl-mr3420-v2|\
+tl-wr841n-v8|\
+tl-wr842n-v2|\
+tl-wr941nd-v5)
+       ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
+       ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
+       ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
+       ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
+
+       case "$board" in
+       tl-mr3420-v2|\
+       tl-wr842n-v2)
+               ucidef_set_led_usbport "usb" "USB" "tp-link:green:3g" "usb1-port1"
+               ;;
+       esac
+       ;;
+tl-mr6400)
+       ucidef_set_led_netdev "lan" "LAN" "tp-link:white:lan" "eth0"
+       ucidef_set_led_netdev "wan" "WAN" "tp-link:white:wan" "eth1"
+       ucidef_set_led_netdev "4g" "4G" "tp-link:white:4g" "usb0"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:white:wlan" "phy0tpt"
+       ;;
+tl-wa7210n-v2)
+       ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:signal1" "wlan0" "1" "100" "0" "13"
+       ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:signal2" "wlan0" "26" "100" "-25" "13"
+       ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:signal3" "wlan0" "51" "100" "-50" "13"
+       ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:signal4" "wlan0" "76" "100" "-75" "13"
+       ;;
+tl-wa750re)
+       ucidef_set_led_netdev "lan" "LAN" "tp-link:orange:lan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:orange:wlan" "phy0tpt"
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:orange:signal1" "wlan0" "1" "100" "0" "13"
+       ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:orange:signal2" "wlan0" "20" "100" "-19" "13"
+       ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "tp-link:orange:signal3" "wlan0" "40" "100" "-39" "13"
+       ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:orange:signal4" "wlan0" "60" "100" "-59" "13"
+       ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:orange:signal5" "wlan0" "80" "100" "-79" "13"
+       ;;
+tl-wa801nd-v3)
+       ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth1"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
+       ;;
+tl-wa850re|\
+tl-wa850re-v2)
+       ucidef_set_led_netdev "lan" "LAN" "tp-link:blue:lan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt"
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:blue:signal1" "wlan0" "1" "100" "0" "13"
+       ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:blue:signal2" "wlan0" "20" "100" "-19" "13"
+       ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "tp-link:blue:signal3" "wlan0" "40" "100" "-39" "13"
+       ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:blue:signal4" "wlan0" "60" "100" "-59" "13"
+       ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:blue:signal5" "wlan0" "80" "100" "-79" "13"
+       ;;
+tl-wa701nd-v2|\
+tl-wa801nd-v2|\
+tl-wa830re-v2|\
+tl-wa860re|\
+tl-wa901nd-v3|\
+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"
+       ;;
+tl-wa901nd)
+       ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
+       ;;
+tl-wa901nd-v2|\
+tl-wr941nd|\
+tl-wr1041n-v2)
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
+       ;;
+tl-wdr3320-v2)
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:green:wlan5g" "phy0tpt"
+       ;;
+tl-wdr3500)
+       ucidef_set_led_usbport "usb" "USB" "tp-link:green:usb" "usb1-port1"
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:green:wlan2g" "phy0tpt"
+       ;;
+tl-wdr4300)
+       ucidef_set_led_usbport "usb1" "USB1" "tp-link:green:usb1" "1-1-port1"
+       ucidef_set_led_usbport "usb2" "USB2" "tp-link:green:usb2" "1-1-port2"
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:blue:wlan2g" "phy0tpt"
+       ;;
+tl-wdr4900-v2)
+       ucidef_set_led_usbport "usb1" "USB1" "tp-link:green:usb1" "usb1-port1"
+       ucidef_set_led_usbport "usb2" "USB2" "tp-link:green:usb2" "usb2-port1"
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:blue:wlan2g" "phy0tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy1tpt"
+       ;;
+tl-wdr6500-v2|\
+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"
+       ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x04"
+       ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x08"
+       ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x10"
+       ;;
+tl-wpa8630)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
+       ucidef_set_led_netdev "wlan" "WLAN" "$board:green:wlan" "wlan1"
+       ucidef_set_led_netdev "wlan5" "WLAN5" "$board:green:wlan5" "wlan0"
+       ;;
+tl-wr740n-v6|\
+tl-wr841n-v9|\
+tl-wr841n-v11|\
+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"
+       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"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
+
+       case "$board" in
+       tl-wr842n-v3)
+               ucidef_set_led_usbport "usb" "USB" "tp-link:green:3g" "usb1-port1"
+               ;;
+       esac
+       ;;
+tl-wr802n-v1)
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:system" "phy0tpt"
+       ;;
+tl-wr802n-v2)
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:system" "phy0tpt"
+       ;;
+tl-wr902ac-v1)
+       ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
+       ucidef_set_led_usbport "usb" "USB" "$board:green:usb" "usb1-port1"
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:green:wlan2g" "phy1tpt"
+       ;;
+tl-wr940n-v4|\
+tl-wr941nd-v6)
+       ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0"
+       ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10"
+       ucidef_set_led_switch "lan2" "LAN2" "tp-link:blue:lan2" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04"
+       ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:wlan" "phy0tpt"
+       ;;
+tl-wr840n-v2|\
+tl-wr840n-v3)
+       ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
+       ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x1E"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
+       ;;
+tl-wr940n-v6)
+       ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0"
+       ;;
+tl-wr942n-v1)
+       ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan1" "switch0" "0x04"
+       ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08"
+       ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x10"
+       ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan4" "switch0" "0x02"
+       ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
+       ucidef_set_led_usbport "usb1" "USB1" "$board:green:usb1" "1-1-port2"
+       ucidef_set_led_usbport "usb2" "USB2" "$board:green:usb2" "1-1-port1"
+       ;;
+tl-wr1043nd|\
+tl-wr1043nd-v2)
+       ucidef_set_led_usbport "usb" "USB" "tp-link:green:usb" "usb1-port1"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
+       ;;
+tl-wr1043n-v5|\
+tl-wr1043nd-v4)
+       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_usbport "usb" "USB" "tp-link:green:usb" "usb1-port1"
+               ;;
+       esac
+       ;;
+tl-wr2543n)
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:green:wlan2g" "phy0tpt"
+       ucidef_set_led_usbport "usb" "USB" "tp-link:green:usb" "usb1-port1"
+       ;;
+tube2h)
+       ucidef_set_led_netdev "lan" "LAN" "alfa:blue:lan" "eth0"
+       ucidef_set_rssimon "wlan0" "200000" "1"
+       ucidef_set_led_rssi "signal1" "SIGNAL1" "alfa:red:signal1" "wlan0" "1" "100" "0" "13"
+       ucidef_set_led_rssi "signal2" "SIGNAL2" "alfa:orange:signal2" "wlan0" "26" "100" "-25" "13"
+       ucidef_set_led_rssi "signal3" "SIGNAL3" "alfa:green:signal3" "wlan0" "51" "100" "-50" "13"
+       ucidef_set_led_rssi "signal4" "SIGNAL4" "alfa:green:signal4" "wlan0" "76" "100" "-75" "13"
+       ;;
+wam250)
+       ucidef_set_led_netdev "lan" "LAN" "$board:white:lan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "$board:white:wlan" "phy0tpt"
+       ;;
+wndap360)
+       ucidef_set_led_power "power" "POWER GREEN" "netgear:green:power" "1"
+       ;;
+wndr3700)
+       ucidef_set_led_default "wan" "WAN LED (green)" "netgear:green:wan" "0"
+       ucidef_set_led_usbport "usb" "USB" "netgear:green:usb" "usb1-port1"
+       ;;
+wi2a-ac200i)
+       ucidef_set_led_default "power" "Power (green)" "nokia:green:power" "1"
+       ucidef_set_led_default "wan" "Ethernet LED (green)" "nokia:green:wan" "1"
+       ucidef_set_led_wlan "wlan5g" "WLAN" "nokia:green:wlan-5g" "phy0tpt"
+       ucidef_set_led_wlan "wlan2g" "WLAN" "nokia:green:wlan-2g" "phy1tpt"
+       ;;
+wndr3700v4|\
+wndr4300)
+       ucidef_set_led_switch "wan-amber" "WAN (amber)" "netgear:amber:wan" "switch0" "0x20"
+       ucidef_set_led_usbport "usb" "USB" "netgear:green:usb" "usb1-port1"
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "netgear:green:wlan2g" "phy0tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "netgear:blue:wlan5g" "phy1tpt"
+       ;;
+whr-g301n|\
+whr-hp-g300n|\
+whr-hp-gn)
+       ucidef_set_led_netdev "wan" "WAN" "buffalo:green:wan" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "buffalo:green:lan1" "switch0" "0x02"
+       ucidef_set_led_switch "lan2" "LAN2" "buffalo:green:lan2" "switch0" "0x04"
+       ucidef_set_led_switch "lan3" "LAN3" "buffalo:green:lan3" "switch0" "0x08"
+       ucidef_set_led_switch "lan4" "LAN4" "buffalo:green:lan4" "switch0" "0x10"
+       ;;
+wifi-pineapple-nano)
+       ucidef_set_led_wlan "wlan0" "WLAN0" "$board:blue:system" "phy0tpt"
+       ;;
+wlae-ag300n)
+       ucidef_set_led_netdev "wireless" "WIRELESS" "buffalo:green:wireless" "wlan0"
+       ;;
+wnr1000-v2|\
+wnr2000-v3)
+       ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0"
+       ucidef_set_led_default "wan-green" "WAN (green)" "netgear:green:wan" "0"
+       ucidef_set_led_wlan "wlan" "WLAN" "netgear:blue:wlan" "phy0tpt"
+       ucidef_set_led_switch "lan1green" "LAN1 (green)" "netgear:green:lan1" "switch0" "0x02" "0x04"
+       ucidef_set_led_switch "lan2green" "LAN2 (green)" "netgear:green:lan2" "switch0" "0x04" "0x04"
+       ucidef_set_led_switch "lan3green" "LAN3 (green)" "netgear:green:lan3" "switch0" "0x08" "0x04"
+       ucidef_set_led_switch "lan4green" "LAN4 (green)" "netgear:green:lan4" "switch0" "0x10" "0x04"
+       ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "netgear:amber:lan1" "switch0" "0x02" "0x02"
+       ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "netgear:amber:lan2" "switch0" "0x04" "0x02"
+       ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "netgear:amber:lan3" "switch0" "0x08" "0x02"
+       ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" "switch0" "0x10" "0x02"
+       ;;
+wnr2000-v4)
+       ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0"
+       ucidef_set_led_netdev "wlan" "WLAN" "netgear:blue:wlan" "wlan0"
+       ucidef_set_led_switch "lan1" "LAN1" "netgear:amber:lan1" "switch0" "0x02"
+       ucidef_set_led_switch "lan2" "LAN2" "netgear:amber:lan2" "switch0" "0x04"
+       ucidef_set_led_switch "lan3" "LAN3" "netgear:amber:lan3" "switch0" "0x08"
+       ucidef_set_led_switch "lan4" "LAN4" "netgear:amber:lan4" "switch0" "0x10"
+       ucidef_set_led_usbport "usb" "USB" "netgear:amber:status" "usb1-port1"
+       ;;
+wnr2200)
+       ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0"
+       ucidef_set_led_default "wan-green" "WAN (green)" "netgear:green:wan" "0"
+       ucidef_set_led_wlan "wlan" "WLAN" "netgear:blue:wlan" "phy0tpt"
+       ucidef_set_led_switch "lan1green" "LAN1 (green)" "netgear:green:lan1" "switch0" "0x02" "0x04"
+       ucidef_set_led_switch "lan2green" "LAN2 (green)" "netgear:green:lan2" "switch0" "0x04" "0x04"
+       ucidef_set_led_switch "lan3green" "LAN3 (green)" "netgear:green:lan3" "switch0" "0x08" "0x04"
+       ucidef_set_led_switch "lan4green" "LAN4 (green)" "netgear:green:lan4" "switch0" "0x10" "0x04"
+       ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "netgear:amber:lan1" "switch0" "0x02" "0x02"
+       ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "netgear:amber:lan2" "switch0" "0x04" "0x02"
+       ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "netgear:amber:lan3" "switch0" "0x08" "0x02"
+       ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" "switch0" "0x10" "0x02"
+       ucidef_set_led_usbport "usb" "USB" "netgear:green:usb" "usb1-port1"
+       ;;
+wnr612-v2)
+       ucidef_set_led_netdev "wan" "WAN" "netgear:green:wan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "netgear:green:wlan" "phy0tpt"
+       ucidef_set_led_switch "lan1" "LAN1" "netgear:green:lan1" "switch0" "0x02" "0x0f"
+       ucidef_set_led_switch "lan2" "LAN2" "netgear:green:lan2" "switch0" "0x04" "0x0f"
+       ;;
+wpn824n)
+       ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "netgear:blue:wlan" "phy0tpt"
+       ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "netgear:amber:lan1" "switch0" "0x02"
+       ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "netgear:amber:lan2" "switch0" "0x04"
+       ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "netgear:amber:lan3" "switch0" "0x08"
+       ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" "switch0" "0x10"
+       ucidef_set_led_default "lan1green" "LAN1 (green)" "netgear:green:lan1" "0"
+       ucidef_set_led_default "lan2green" "LAN2 (green)" "netgear:green:lan2" "0"
+       ucidef_set_led_default "lan3green" "LAN3 (green)" "netgear:green:lan3" "0"
+       ucidef_set_led_default "lan4green" "LAN4 (green)" "netgear:green:lan4" "0"
+       ucidef_set_led_default "wan-green" "WAN (green)" "netgear:green:wan" "0"
+       ucidef_set_led_default "wps1" "WPS1" "netgear:blue:wps1" "0"
+       ucidef_set_led_default "wps2" "WPS2" "netgear:blue:wps2" "0"
+       ucidef_set_led_default "status" "STATUS" "netgear:amber:status" "0"
+       ucidef_set_led_default "test" "TEST" "netgear:amber:test" "0"
+       ;;
+wzr-hp-ag300h)
+       ucidef_set_led_default "diag" "DIAG" "buffalo:red:diag" "0"
+       ucidef_set_led_netdev "router" "ROUTER" "buffalo:green:router" "eth1"
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "buffalo:amber:band2g" "phy0tpt"
+       ucidef_set_led_wlan "wlan5g" "WLAN5G" "buffalo:amber:band5g" "phy1tpt"
+       ucidef_set_led_usbport "usb" "USB" "buffalo:green:usb" "usb1-port1"
+       ;;
+wzr-hp-g300nh)
+       ucidef_set_led_wlan "wlan" "Wireless" "buffalo:green:wireless" "phy0tpt"
+       ucidef_set_led_netdev "router" "Router" "buffalo:green:router" "eth1"
+       ucidef_set_led_usbport "usb" "USB" "buffalo:blue:usb" "usb1-port1"
+       ;;
+wzr-hp-g300nh2|\
+wzr-hp-g450h)
+       ucidef_set_led_wlan "wlan" "Wireless" "buffalo:green:wireless" "phy0tpt"
+       ;;
+xd3200)
+       ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:blue:wlan2g" "phy1tpt"
+       ;;
+z1)
+       ucidef_set_led_netdev "wlan1" "WLAN1" "$board:blue:tricolor0" "wlan1"
+       ;;
+zcn-1523h-2)
+       ucidef_set_led_netdev "lan1" "lan1" "zcn-1523h:green:lan1" "eth0"
+       ;;
+zcn-1523h-5)
+       ucidef_set_led_netdev "lan1" "lan1" "zcn-1523h:green:lan1" "eth0"
+       ucidef_set_led_netdev "lan2" "lan2" "zcn-1523h:green:lan2" "eth1"
+       ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
new file mode 100755 (executable)
index 0000000..8c0f5b4
--- /dev/null
@@ -0,0 +1,712 @@
+#!/bin/sh
+#
+# Copyright (C) 2011-2015 OpenWrt.org
+#
+
+. /lib/functions/system.sh
+. /lib/functions/uci-defaults.sh
+
+ar71xx_setup_interfaces()
+{
+       local board="$1"
+
+       case "$board" in
+       airgatewaypro)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "4:lan" "5:wan"
+               ;;
+       airrouter|\
+       ap121|\
+       ap121-mini|\
+       ap96|\
+       dir-600-a1|\
+       dir-615-c1|\
+       dir-615-e1|\
+       dir-615-e4|\
+       hiwifi-hc6361|\
+       ja76pf|\
+       mc-mac1200r|\
+       minibox-v1|\
+       mynet-n600|\
+       oolite-v1|\
+       oolite-v5.2|\
+       oolite-v5.2-dev|\
+       qihoo-c301|\
+       r602n|\
+       rb-750|\
+       rb-751|\
+       som9331|\
+       t830|\
+       tew-632brp|\
+       tew-712br|\
+       tew-732br|\
+       tl-mr3220|\
+       tl-mr3420|\
+       tl-wdr3320-v2|\
+       tl-wdr3500|\
+       tl-wr740n-v6|\
+       tl-wr840n-v2|\
+       tl-wr840n-v3|\
+       tl-wr841n-v11|\
+       tl-wr841n-v9|\
+       tl-wr842n-v3|\
+       whr-g301n|\
+       whr-hp-g300n|\
+       whr-hp-gn|\
+       wzr-hp-ag300h|\
+       zbt-we1526)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
+               ;;
+       alfa-ap120c|\
+       all0305|\
+       antminer-s1|\
+       antminer-s3|\
+       antrouter-r1|\
+       ap121f|\
+       ap91-5g|\
+       aw-nr580|\
+       bullet-m|\
+       bullet-m-xw|\
+       c-55|\
+       cap324|\
+       cap4200ag|\
+       cf-e380ac-v1|\
+       cf-e380ac-v2|\
+       cpe210-v2|\
+       cpe210-v3|\
+       cpe510-v2|\
+       dr342|\
+       eap120|\
+       eap300v2|\
+       eap7660d|\
+       el-mini|\
+       fritz300e|\
+       fritz450e|\
+       gl-usb150|\
+       hiveap-121|\
+       koala|\
+       lbe-m5|\
+       loco-m-xw|\
+       mr12|\
+       mr16|\
+       mr1750|\
+       mr1750v2|\
+       mr18|\
+       mr600|\
+       mr600v2|\
+       mr900|\
+       mr900v2|\
+       mynet-rext|\
+       pqi-air-pen|\
+       rb-411|\
+       rb-411u|\
+       rb-911-2hn|\
+       rb-911-5hn|\
+       rb-911g-2hpnd|\
+       rb-911g-5hpacd|\
+       rb-911g-5hpnd|\
+       rb-912uag-2hpnd|\
+       rb-912uag-5hpnd|\
+       rb-921gs-5hpacd-r2|\
+       rb-922uags-5hpacd|\
+       rb-lhg-5nd|\
+       rb-mapl-2nd|\
+       rb-sxt2n|\
+       rb-sxt-2nd-r3|\
+       rb-sxt5n|\
+       rb-wap-2nd|\
+       rb-wapr-2nd|\
+       rb-wapg-5hact2hnd|\
+       re355|\
+       re450|\
+       rocket-m-xw|\
+       sc300m |\
+       tl-mr10u|\
+       tl-mr11u|\
+       tl-mr12u|\
+       tl-mr13u|\
+       tl-mr3020|\
+       tl-mr3040|\
+       tl-mr3040-v2|\
+       tl-wa701nd-v2|\
+       tl-wa7210n-v2|\
+       tl-wa750re|\
+       tl-wa801nd-v2|\
+       tl-wa830re-v2|\
+       tl-wa850re|\
+       tl-wa850re-v2|\
+       tl-wa855re-v1|\
+       tl-wa901nd|\
+       tl-wa901nd-v2|\
+       tl-wa901nd-v3|\
+       tl-wa901nd-v4|\
+       tl-wa901nd-v5|\
+       tl-wr703n|\
+       tl-wr802n-v1|\
+       tl-wr802n-v2|\
+       tl-wr902ac-v1|\
+       ts-d084|\
+       tube2h|\
+       unifi|\
+       unifiac-lite|\
+       wi2a-ac200i|\
+       wifi-pineapple-nano|\
+       wndap360|\
+       wp543)
+               ucidef_set_interface_lan "eth0"
+               ;;
+       a40|\
+       a60|\
+       alfa-ap96|\
+       alfa-nx|\
+       ap83|\
+       dr344|\
+       gl-ar150|\
+       gl-ar300m|\
+       gl-domino|\
+       gl-inet|\
+       gl-mifi|\
+       jwap003|\
+       om2p-hsv4|\
+       om2pv4|\
+       pb42|\
+       pb44|\
+       rb-951ui-2hnd|\
+       routerstation|\
+       tl-wr710n|\
+       tl-wr720n-v3|\
+       tl-wr810n|\
+       tl-wr810n-v2|\
+       wpe72|\
+       wrtnode2q)
+               ucidef_set_interfaces_lan_wan "eth1" "eth0"
+               ;;
+       all0258n|\
+       all0315n|\
+       dlan-hotspot|\
+       dlan-pro-500-wp|\
+       ja76pf2|\
+       rocket-m-ti|\
+       ubnt-unifi-outdoor)
+               ucidef_set_interface_lan "eth0 eth1"
+               ;;
+       wzr-hp-g300nh2)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "2:wan"
+               ;;
+       ap132|\
+       ap136|\
+       ap152|\
+       rb-750gl|\
+       rb-751g|\
+       rb-951g-2hnd|\
+       rb-962uigs-5hact2hnt|\
+       wlr8100|\
+       wzr-hp-g450h)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
+               ;;
+       ap135-020|\
+       ap136-020|\
+       bhr-4grv2|\
+       tew-823dru|\
+       tl-wr1043nd-v2|\
+       wzr-450hp2)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0.2"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
+               ;;
+       ap136-010|\
+       ap147-010|\
+       nbg6616|\
+       nbg6716)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
+               ;;
+       ap143|\
+       rb-433|\
+       rb-433u)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+               ucidef_add_switch "switch0" \
+                       "1:lan" "2:lan" "5@eth1"
+               ;;
+       archer-c5|\
+       archer-c7|\
+       tl-wdr4900-v2)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0.2"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
+               ;;
+       archer-c25-v1|\
+       archer-c60-v1|\
+       archer-c60-v2|\
+       rb-750-r2|\
+       rb-750p-pbr2|\
+       rb-750up-r2|\
+       rb-951ui-2nd|\
+       rb-952ui-5ac2nd)
+               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"
+               ;;
+       archer-c58-v1|\
+       archer-c59-v1|\
+       archer-c59-v2|\
+       fritz4020|\
+       rb-450g)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
+               ;;
+       arduino-yun|\
+       dir-505-a1|\
+       tl-wa801nd-v3)
+               ucidef_set_interface_lan "eth1"
+               ;;
+       bsb)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "1:lan" "3:lan"
+               ;;
+       c-60)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "3:wan" "4:lan"
+               ;;
+       rme-eg200)
+               ucidef_set_interface_lan "eth0" "dhcp"
+               ;;
+       cf-e375ac|\
+       rb-map-2nd)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:wan" "2:lan"
+               ;;
+       cf-e385ac)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan" "1:wan" "6@eth1"
+               ;;
+       cpe210|\
+       cpe510|\
+       wbs210|\
+       wbs510)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "5:lan" "4:wan"
+               ;;
+       cr3000)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
+               ;;
+       cr5000|\
+       dgl-5500-a1|\
+       dhp-1565-a1|\
+       dir-825-c1|\
+       dir-835-a1|\
+       esr900|\
+       mynet-n750|\
+       sr3200)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
+               ;;
+       tl-wr1043n-v5)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
+               ;;
+       dap-2695-a1)
+               ucidef_add_switch "switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
+               ;;
+       rb-931-2nd)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:3" "2:lan:2" "3:wan:1"
+       ;;
+       rb-941-2nd)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"
+       ;;
+       db120|\
+       rb-2011il|\
+       rb-2011ils|\
+       rb-2011l|\
+       rb-2011uas|\
+       rb-2011uas-2hnd|\
+       rb-2011uias|\
+       rb-2011uias-2hnd|\
+       rb-2011uias-2hnd-r2)
+               case "$board" in
+               rb-2011ils|\
+               rb-2011uas*|\
+               rb-2011uias|\
+               rb-2011uias-2hnd|\
+               rb-2011uias-2hnd-r2)
+                       ucidef_add_switch "switch0" \
+                               "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" "6:sfp"
+               ;;
+               *)
+                       ucidef_add_switch "switch0" \
+                               "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
+               ;;
+               esac
+
+               ucidef_add_switch "switch1" \
+                       "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
+               ;;
+       dir-615-i1|\
+       omy-g1|\
+       r6100|\
+       smart-300|\
+       tl-wdr6500-v2|\
+       tl-wr940n-v4|\
+       tl-wr940n-v6|\
+       tl-wr941nd-v6|\
+       wnr1000-v2|\
+       wnr2000-v4|\
+       wnr2200|\
+       wnr612-v2|\
+       wpn824n)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
+               ;;
+       tl-mr6400)
+               ucidef_set_interfaces_lan_wan "eth0.1 eth1" "usb0"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan" "2:lan" "3:lan"
+               ;;
+       dir-825-b1|\
+       nbg460n_550n_550nh|\
+       tew-673gru|\
+       wzr-hp-g300nh)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
+               ;;
+       dlan-pro-1200-ac)
+               ucidef_set_interface_lan "eth0"
+               ucidef_add_switch "switch0" \
+                       "0u@eth0" "2:lan" "3:lan" "4:lan"
+               ucidef_add_switch_attr "switch0" "enable" "false"
+               ;;
+       e1700ac-v2|\
+       e750g-v8|\
+       unifiac-pro|\
+       xd3200)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan" "3:wan"
+               ;;
+       e558-v2)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0.2"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "4:lan" "5:lan" "6@eth0"  "3:wan"
+               ;;
+       ebr-2310-c1)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
+               ;;
+       el-m150)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+               ucidef_add_switch "switch0" \
+                       "0:lan" "1:lan" "3@eth1"
+               ;;
+       dir-869-a1|\
+       epg5000|\
+       esr1750|\
+       tl-wr1043nd-v4|\
+       wndr3700v4|\
+       wndr4300)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
+               ;;
+       ew-balin)
+               ucidef_set_interface "usb2" ifname "usb0" protocol "static"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
+               ;;
+       ew-dorin)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan" "2:lan" "3:wan"
+               ;;
+       ew-dorin-router)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan" "3:lan"
+               ;;
+       dw33d|\
+       f9k1115v2)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0.2"
+               ucidef_add_switch "switch0" \
+                       "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
+               ;;
+       gl-ar300|\
+       wnr2000-v3)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
+               ;;
+       gl-ar750|\
+       rb-435g)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "1:lan" "2:lan"
+               ;;
+       gl-ar750s)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
+               ;;
+       jwap230)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan" "5:wan" "6@eth1"
+               ;;
+       nanostation-m-xw)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "5:lan" "1:wan"
+               ;;
+       onion-omega)
+               ucidef_set_interface_lan "wlan0"
+               ;;
+       rb-450)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+               ucidef_add_switch "switch0" \
+                       "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1"
+               ;;
+       routerstation-pro)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
+               ;;
+       rb-493g)
+               ucidef_set_interfaces_lan_wan "eth0.1 eth1.1" "eth1.2"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
+               ucidef_add_switch "switch1" \
+                       "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan"
+               ;;
+       rut900)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
+               ;;
+       tellstick-znet-lite)
+               ucidef_set_interface_wan "eth0"
+               ucidef_set_interface "wlan" ifname "wlan0" protocol "dhcp"
+               ;;
+       tl-mr3420-v2|\
+       tl-wr841n-v8|\
+       tl-wr842n-v2|\
+       tl-wr941nd-v5|\
+       tl-wr942n-v1)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
+               ;;
+       archer-c7-v4|\
+       archer-c7-v5|\
+       tl-wdr4300|\
+       tl-wr1041n-v2)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
+               ;;
+       tl-wpa8630)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
+               ;;
+       tl-wr1043nd)
+               ucidef_add_switch "switch0" \
+                       "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
+               ;;
+       tl-wr2543n)
+               ucidef_add_switch "switch0" \
+                       "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
+               ;;
+       tl-mr3220-v2|\
+       tl-wr741nd-v4)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
+               ;;
+       tl-wr841n-v1|\
+       tl-wr941nd)
+               ucidef_set_interface "eth" ifname "eth0"
+               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
+               ;;
+       tl-wr741nd|\
+       tl-wr841n-v7)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
+               ;;
+       uap-pro|\
+       wpj342)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan" "2:wan"
+               ;;
+       wndr3700|\
+       wndr3700v2|\
+       wndr3800|\
+       wndr3800ch)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0"
+
+               ucidef_add_switch_attr "switch0" "blinkrate" 2
+               ucidef_add_switch_port_attr "switch0" 1 led 6
+               ucidef_add_switch_port_attr "switch0" 2 led 9
+               ucidef_add_switch_port_attr "switch0" 5 led 2
+               ;;
+       wpj344)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "3:lan" "2:wan"
+               ;;
+       wpj558)
+               ucidef_add_switch "switch0" \
+                       "5:lan" "1:wan" "6@eth0"
+               ;;
+       wpj563)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan" "3:wan"
+               ;;
+       wrt160nl)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4@eth0"
+               ;;
+       wzr-hp-g450h)
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "2:lan:1 3:lan:2 4:lan:3 5:lan:4" "1:wan"
+               ;;
+       z1)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
+               ;;
+       ens202ext)
+               ucidef_set_interfaces_lan_wan "eth1.1" "eth1.2"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
+               ;;
+       *)
+               ucidef_set_interfaces_lan_wan "eth0" "eth1"
+               ;;
+       esac
+}
+
+ar71xx_setup_macs()
+{
+       local board="$1"
+       local lan_mac=""
+       local wan_mac=""
+
+       case $board in
+       archer-c7-v4)
+               base_mac=$(mtd_get_mac_binary config 0x8)
+               wan_mac=$(macaddr_add "$base_mac" 1)
+               ;;
+       archer-c7-v5)
+               base_mac=$(mtd_get_mac_binary info 0x8)
+               wan_mac=$(macaddr_add "$base_mac" 1)
+               ;;
+       dgl-5500-a1|\
+       dir-825-c1)
+               wan_mac=$(mtd_get_mac_ascii nvram "wan_mac")
+               ;;
+       dhp-1565-a1|\
+       dir-835-a1|\
+       wndr3700v4|\
+       wndr4300)
+               lan_mac=$(mtd_get_mac_binary caldata 0x0)
+               wan_mac=$(mtd_get_mac_binary caldata 0x6)
+               ;;
+       dir-869-a1|\
+       mynet-n750)
+               wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
+               ;;
+       esr900)
+               wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr")
+               ;;
+       fritz300e)
+               lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
+               ;;
+       tl-wdr4300)
+               base_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
+               wan_mac=$(macaddr_add "$base_mac" 1)
+               ;;
+       tl-wr1043n-v5|\
+       tl-wr1043nd-v4)
+               lan_mac=$(mtd_get_mac_binary product-info 0x8)
+               wan_mac=$(macaddr_add "$lan_mac" 1)
+               ;;
+       wlr8100)
+               lan_mac=$(mtd_get_mac_ascii u-boot-env "ethaddr")
+               wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr")
+               ;;
+       wpj344|\
+       wpj558)
+               wan_mac=$(mtd_get_mac_binary u-boot 0x2e018)
+               ;;
+       esac
+
+       [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
+       [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
+}
+
+ar71xx_setup_ar8xxx_switch()
+{
+       local board="$1"
+
+       case $board in
+       ap147-010|\
+       archer-c25-v1|\
+       archer-c58-v1|\
+       archer-c59-v1|\
+       archer-c59-v2|\
+       archer-c60-v1|\
+       archer-c60-v2|\
+       archer-c7-v4|\
+       archer-c7-v5|\
+       cf-e375ac|\
+       cf-e385ac|\
+       cr3000|\
+       dhp-1565-a1|\
+       mynet-n600|\
+       rb-2011il|\
+       rb-2011ils|\
+       rb-2011l|\
+       rb-2011uas|\
+       rb-2011uas-2hnd|\
+       rb-2011uias|\
+       rb-2011uias-2hnd|\
+       rb-2011uias-2hnd-r2|\
+       rb-750|\
+       rb-750p-pbr2|\
+       rb-750-r2|\
+       rb-750up-r2|\
+       rb-951ui-2nd|\
+       rb-952ui-5ac2nd|\
+       rb-map-2nd|\
+       tl-wr1043nd-v4|\
+       tl-wr1043n-v5|\
+       wndr3700v4|\
+       wndr3700v4|\
+       wndr4300|\
+       wnr1000-v2|\
+       wnr2000-v3|\
+       wnr2200|\
+       wnr612-v2|\
+       wpn824n)
+               ucidef_set_ar8xxx_switch_mib "switch0" 0 500
+               ;;
+       esac
+}
+
+board_config_update
+board=$(board_name)
+ar71xx_setup_interfaces $board
+ar71xx_setup_macs $board
+ar71xx_setup_ar8xxx_switch $board
+board_config_flush
+
+exit 0
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
new file mode 100644 (file)
index 0000000..35216e3
--- /dev/null
@@ -0,0 +1,600 @@
+#!/bin/sh
+# Copyright (C) 2009-2013 OpenWrt.org
+
+. /lib/functions.sh
+. /lib/functions/leds.sh
+
+get_status_led() {
+       local board=$(board_name)
+
+       case $board in
+       a40)
+               status_led="a40:green:status"
+               ;;
+       a60)
+               status_led="a60:green:status"
+               ;;
+       alfa-nx)
+               status_led="alfa:green:led_8"
+               ;;
+       all0305)
+               status_led="eap7660d:green:ds4"
+               ;;
+       antminer-s1|\
+       antminer-s3|\
+       antminer-r1|\
+       e1700ac-v2|\
+       e558-v2|\
+       e600gac-v2|\
+       e750a-v4|\
+       e750g-v8|\
+       eap120|\
+       minibox-v1|\
+       minibox-v3.2|\
+       packet-squirrel|\
+       som9331|\
+       sr3200|\
+       tl-wr802n-v2|\
+       xd3200)
+               status_led="$board:green:system"
+               ;;
+       ap121f)
+               status_led="$board:green:vpn"
+               ;;
+       ap132|\
+       ap531b0|\
+       cpe505n|\
+       db120|\
+       dr342|\
+       dr344|\
+       rut900|\
+       tew-632brp|\
+       tl-wr942n-v1|\
+       wpj344|\
+       zbt-we1526)
+               status_led="$board:green:status"
+               ;;
+       ap136-010|\
+       ap136-020)
+               status_led="ap136:green:status"
+               ;;
+       ap147-010)
+               status_led="ap147:green:status"
+               ;;
+       ap135-020)
+               status_led="ap135:green:status"
+               ;;
+       ap83|\
+       archer-c25-v1|\
+       archer-c58-v1|\
+       archer-c59-v1|\
+       archer-c59-v2|\
+       archer-c60-v1|\
+       archer-c60-v2|\
+       archer-c7-v4|\
+       archer-c7-v5|\
+       fritz300e|\
+       fritz4020|\
+       fritz450e|\
+       gl-ar750s|\
+       gl-usb150|\
+       mr12|\
+       mr16|\
+       nbg6616|\
+       sc1750|\
+       sc450|\
+       tl-wpa8630|\
+       tl-wr902ac-v1)
+               status_led="$board:green:power"
+               ;;
+       tl-mr10u|\
+       tl-mr12u|\
+       tl-mr13u|\
+       tl-wdr4300|\
+       tl-wdr4900-v2|\
+       tl-wr703n|\
+       tl-wr710n|\
+       tl-wr720n-v3|\
+       tl-wr802n-v1|\
+       tl-wr810n|\
+       tl-wr810n-v2|\
+       tl-wr940n-v4|\
+       tl-wr941nd-v6)
+               status_led="tp-link:blue:system"
+               ;;
+       ap90q|\
+       cpe830|\
+       cpe870|\
+       gl-ar300m|\
+       gl-inet|\
+       gl-mifi)
+               status_led="$board:green:lan"
+               ;;
+       ap91-5g|\
+       n5q)
+               status_led="$board:green:signal4"
+               ;;
+       ap96)
+               status_led="$board:green:led2"
+               ;;
+       aw-nr580)
+               status_led="$board:green:ready"
+               ;;
+       bhr-4grv2|\
+       wzr-hp-ag300h|\
+       wzr-hp-g300nh2)
+               status_led="buffalo:red:diag"
+               ;;
+       bsb)
+               status_led="$board:red:sys"
+               ;;
+       bullet-m|\
+       bullet-m-xw|\
+       loco-m-xw|\
+       nano-m|\
+       nanostation-m|\
+       nanostation-m-xw|\
+       rocket-m|\
+       rocket-m-xw)
+               status_led="ubnt:green:link4"
+               ;;
+       bxu2000n-2-a1)
+               status_led="bhu:green:status"
+               ;;
+       cap324)
+               status_led="pcs:green:power"
+               ;;
+       c-55|\
+       c-60)
+               status_led="$board:green:pwr"
+               ;;
+       cap4200ag)
+               status_led="senao:green:pwr"
+               ;;
+       cf-e316n-v2|\
+       cf-e520n|\
+       cf-e530n)
+               status_led="$board:blue:wan"
+               ;;
+       cf-e320n-v2)
+               status_led="$board:blue:wlan"
+               ;;
+       cf-e375ac|\
+       cf-e380ac-v1|\
+       cf-e380ac-v2|\
+       cf-e385ac)
+               status_led="$board:blue:wlan2g"
+               ;;
+       cpe510)
+               status_led="tp-link:green:link4"
+               ;;
+       cr3000|\
+       cr5000)
+               status_led="pcs:amber:power"
+               ;;
+       dap-1330-a1|\
+       dgl-5500-a1|\
+       dhp-1565-a1|\
+       dir-505-a1|\
+       dir-600-a1|\
+       dir-615-e1|\
+       dir-615-i1|\
+       dir-615-e4)
+               status_led="d-link:green:power"
+               ;;
+       dir-615-c1)
+               status_led="d-link:green:status"
+               ;;
+       dir-825-b1)
+               status_led="d-link:orange:power"
+               ;;
+       dir-825-c1|\
+       dir-835-a1)
+               status_led="d-link:amber:power"
+               ;;
+       dir-869-a1)
+               status_led="d-link:white:status"
+               ;;
+       dlan-hotspot)
+               status_led="devolo:green:wifi"
+               ;;
+       dlan-pro-500-wp)
+               status_led="devolo:green:wlan-2g"
+               ;;
+       dlan-pro-1200-ac)
+               status_led="devolo:status:wlan"
+               ;;
+       dr531)
+               status_led="$board:green:sig4"
+               ;;
+       dragino2|\
+       oolite-v1)
+               status_led="$board:red:system"
+               ;;
+       dw33d|\
+       r36a)
+               status_led="$board:blue:status"
+               ;;
+       e600g-v2|\
+       oolite-v5.2-dev|\
+       ts-d084|\
+       wifi-pineapple-nano)
+               status_led="$board:blue:system"
+               ;;
+       eap300v2)
+               status_led="engenius:blue:power"
+               ;;
+       ens202ext|\
+       esr900)
+               status_led="engenius:amber:power"
+               ;;
+       eap7660d)
+               status_led="$board:green:ds4"
+               ;;
+       el-m150|\
+       el-mini)
+               status_led="easylink:green:system"
+               ;;
+       ew-balin)
+               status_led="balin:green:status"
+               ;;
+       ew-dorin|\
+       ew-dorin-router)
+               status_led="dorin:green:status"
+               ;;
+       f9k1115v2)
+               status_led="belkin:blue:status"
+               ;;
+       epg5000|\
+       esr1750)
+               status_led="$board:amber:power"
+               ;;
+       gl-ar750|\
+       hiveap-121|\
+       nbg6716|\
+       wam250)
+               status_led="$board:white:power"
+               ;;
+       hiwifi-hc6361)
+               status_led="hiwifi:blue:system"
+               ;;
+       hornet-ub|\
+       hornet-ub-x2)
+               status_led="alfa:blue:wps"
+               ;;
+       ja76pf|\
+       ja76pf2)
+               status_led="jjplus:green:led1"
+               ;;
+       jwap230)
+               status_led="$board:green:led1"
+               ;;
+       koala)
+               status_led="$board:blue:sys"
+               ;;
+       lan-turtle)
+               status_led="$board:orange:system"
+               ;;
+       lbe-m5)
+               status_led="ubnt:green:sys"
+               ;;
+       ls-sr71)
+               status_led="ubnt:green:d22"
+               ;;
+       mc-mac1200r)
+               status_led="mercury:green:system"
+               ;;
+       mr18|\
+       z1)
+               status_led="$board:green:tricolor0"
+               ;;
+       mr600)
+               status_led="$board:orange:power"
+               ;;
+       mr600v2)
+               status_led="mr600:blue:power"
+               ;;
+       mr1750|\
+       mr1750v2)
+               status_led="mr1750:blue:power"
+               ;;
+       mr900|\
+       mr900v2)
+               status_led="mr900:blue:power"
+               ;;
+       mynet-n600|\
+       mynet-n750|\
+       mynet-rext)
+               status_led="wd:blue:power"
+               ;;
+       mzk-w04nu|\
+       mzk-w300nh)
+               status_led="planex:green:status"
+               ;;
+       nbg460n_550n_550nh)
+               status_led="nbg460n:green:power"
+               ;;
+       om2p|\
+       om2p-hs|\
+       om2p-hsv2|\
+       om2p-hsv3|\
+       om2p-hsv4|\
+       om2p-lc|\
+       om2pv2|\
+       om2pv4)
+               status_led="om2p:blue:power"
+               ;;
+       om5p|\
+       om5p-an)
+               status_led="om5p:blue:power"
+               ;;
+       om5p-ac|\
+       om5p-acv2)
+               status_led="om5pac:blue:power"
+               ;;
+       omy-g1)
+               status_led="omy:green:wlan"
+               ;;
+       omy-x1)
+               status_led="omy:green:power"
+               ;;
+       onion-omega)
+               status_led="onion:amber:system"
+               ;;
+       pb44)
+               status_led="$board:amber:jump1"
+               ;;
+       r602n)
+               status_led="$board:green:wan"
+               ;;
+       rb-2011il|\
+       rb-2011ils|\
+       rb-2011l|\
+       rb-2011uas|\
+       rb-2011uas-2hnd)
+               status_led="rb:green:usr"
+               ;;
+       rb-411|\
+       rb-411u|\
+       rb-433|\
+       rb-433u|\
+       rb-450|\
+       rb-450g|\
+       rb-493)
+               status_led="rb4xx:yellow:user"
+               ;;
+       rb-750)
+               status_led="rb750:green:act"
+               ;;
+       rb-750-r2|\
+       rb-750p-pbr2|\
+       rb-750up-r2|\
+       rb-911-2hn|\
+       rb-911-5hn|\
+       rb-911g-2hpnd|\
+       rb-911g-5hpacd|\
+       rb-911g-5hpnd|\
+       rb-931-2nd|\
+       rb-941-2nd|\
+       rb-951ui-2nd|\
+       rb-952ui-5ac2nd|\
+       rb-962uigs-5hact2hnt|\
+       rb-lhg-5nd|\
+       rb-map-2nd|\
+       rb-mapl-2nd|\
+       rb-sxt-2nd-r3|\
+       rb-wap-2nd|\
+       rb-wapr-2nd)
+               status_led="rb:green:user"
+               ;;
+       rb-951ui-2hnd)
+               status_led="rb:green:act"
+               ;;
+       rb-912uag-2hpnd|\
+       rb-912uag-5hpnd|\
+       rb-sxt2n|\
+       rb-sxt5n|\
+       rb-wapg-5hact2hnd)
+               status_led="rb:green:power"
+               ;;
+       re355|\
+       re450|\
+       sc300m)
+               status_led="$board:blue:power"
+               ;;
+       rocket-m-ti)
+               status_led="ubnt:green:link6"
+               ;;
+       routerstation|\
+       routerstation-pro)
+               status_led="ubnt:green:rf"
+               ;;
+       rw2458n)
+               status_led="$board:green:d3"
+               ;;
+       smart-300)
+               status_led="nc-link:green:system"
+               ;;
+       qihoo-c301)
+               status_led="qihoo:green:status"
+               ;;
+       t830)
+               status_led="$board:green:usb"
+               ;;
+       tellstick-znet-lite)
+               status_led="tellstick:white:system"
+               ;;
+       tew-673gru)
+               status_led="trendnet:blue:wps"
+               ;;
+       tew-712br|\
+       tew-732br|\
+       tew-823dru)
+               status_led="trendnet:green:power"
+               ;;
+       tl-mr3020|\
+       tl-wr2543n)
+               status_led="tp-link:green:wps"
+               ;;
+       tl-wa750re)
+               status_led="tp-link:orange:re"
+               ;;
+       tl-wa850re|\
+       tl-wa850re-v2)
+               status_led="tp-link:blue:re"
+               ;;
+       tl-wa855re-v1|\
+       tl-wa860re)
+               status_led="tp-link:green:power"
+               ;;
+       tl-mr6400)
+               status_led="tp-link:white:power"
+               ;;
+       archer-c5|\
+       archer-c7|\
+       tl-mr3220|\
+       tl-mr3220-v2|\
+       tl-mr3420|\
+       tl-mr3420-v2|\
+       tl-wa701nd-v2|\
+       tl-wa801nd-v2|\
+       tl-wa801nd-v3|\
+       tl-wa830re-v2|\
+       tl-wa901nd|\
+       tl-wa901nd-v2|\
+       tl-wa901nd-v3|\
+       tl-wa901nd-v4|\
+       tl-wa901nd-v5|\
+       tl-wdr3320-v2|\
+       tl-wdr3500|\
+       tl-wr1041n-v2|\
+       tl-wr1043n-v5|\
+       tl-wr1043nd|\
+       tl-wr1043nd-v2|\
+       tl-wr1043nd-v4|\
+       tl-wr740n-v6|\
+       tl-wr741nd|\
+       tl-wr741nd-v4|\
+       tl-wr840n-v2|\
+       tl-wr840n-v3|\
+       tl-wr841n-v1|\
+       tl-wr841n-v7|\
+       tl-wr841n-v8|\
+       tl-wr841n-v11|\
+       tl-wr842n-v2|\
+       tl-wr842n-v3|\
+       tl-wr941nd|\
+       tl-wr941nd-v5)
+               status_led="tp-link:green:system"
+               ;;
+       tl-wr841n-v9)
+               status_led="tp-link:green:qss"
+               ;;
+       tl-wr940n-v6)
+               status_led="tp-link:orange:diag"
+               ;;
+       tl-wdr6500-v2)
+               status_led="tp-link:white:system"
+               ;;
+       tube2h)
+               status_led="alfa:green:signal4"
+               ;;
+       unifi)
+               status_led="ubnt:green:dome"
+               ;;
+       uap-pro|\
+       unifiac-lite|\
+       unifiac-pro)
+               status_led="ubnt:white:dome"
+               ;;
+       unifi-outdoor-plus)
+               status_led="ubnt:white:front"
+               ;;
+       airgateway|\
+       airgatewaypro)
+               status_led="ubnt:white:status"
+               ;;
+       wi2a-ac200i)
+               status_led="nokia:green:ctrl"
+               ;;
+       whr-g301n|\
+       whr-hp-g300n|\
+       whr-hp-gn|\
+       wzr-hp-g300nh)
+               status_led="buffalo:green:router"
+               ;;
+       wlae-ag300n)
+               status_led="buffalo:green:status"
+               ;;
+       r6100|\
+       wndap360|\
+       wndr3700|\
+       wndr3700v4|\
+       wndr4300|\
+       wnr2000|\
+       wnr2000-v3|\
+       wnr2200|\
+       wnr612-v2|\
+       wnr1000-v2|\
+       wpn824n)
+               status_led="netgear:green:power"
+               ;;
+       wp543)
+               status_led="$board:green:diag"
+               ;;
+       wpj342|\
+       wpj531|\
+       wpj558)
+               status_led="$board:green:sig3"
+               ;;
+       wpj563)
+               status_led="$board:green:sig1"
+               ;;
+       wrt160nl|\
+       wrt400n)
+               status_led="$board:blue:wps"
+               ;;
+       zcn-1523h-2|\
+       zcn-1523h-5)
+               status_led="zcn-1523h:amber:init"
+               ;;
+       wlr8100)
+               status_led="sitecom:amber:status"
+               ;;
+       esac
+}
+
+set_state() {
+       get_status_led
+
+       case "$1" in
+       preinit)
+               status_led_blink_preinit
+               ;;
+       failsafe)
+               status_led_blink_failsafe
+               ;;
+       preinit_regular)
+               status_led_blink_preinit_regular
+               ;;
+       upgrade)
+               status_led_blink_preinit_regular
+               ;;
+       done)
+               status_led_on
+               case $(board_name) in
+               gl-ar300m|\
+               gl-ar750)
+                       fw_printenv lc >/dev/null 2>&1 && fw_setenv "bootcount" 0
+                       ;;
+               qihoo-c301)
+                       local n=$(fw_printenv activeregion | cut -d = -f 2)
+                       fw_setenv "image${n}trynum" 0
+                       ;;
+               wi2a-ac200i)
+                       fw_setenv PKRstCnt 0
+                       ;;
+               esac
+               ;;
+       esac
+}
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
new file mode 100755 (executable)
index 0000000..5e33ba6
--- /dev/null
@@ -0,0 +1,1592 @@
+#!/bin/sh
+#
+# Copyright (C) 2009-2011 OpenWrt.org
+#
+
+AR71XX_BOARD_NAME=
+AR71XX_MODEL=
+
+ar71xx_get_mtd_offset_size_format() {
+       local mtd="$1"
+       local offset="$2"
+       local size="$3"
+       local format="$4"
+       local dev
+
+       dev=$(find_mtd_part $mtd)
+       [ -z "$dev" ] && return
+
+       dd if=$dev iflag=skip_bytes bs=$size skip=$offset count=1 2>/dev/null | hexdump -v -e "1/1 \"$format\""
+}
+
+ar71xx_get_mtd_part_magic() {
+       local mtd="$1"
+       ar71xx_get_mtd_offset_size_format "$mtd" 0 4 %02x
+}
+
+wndr3700_board_detect() {
+       local machine="$1"
+       local magic
+       local name
+
+       name="wndr3700"
+
+       magic="$(ar71xx_get_mtd_part_magic firmware)"
+       case $magic in
+       "33373030")
+               machine="NETGEAR WNDR3700"
+               ;;
+       "33373031")
+               model="$(ar71xx_get_mtd_offset_size_format art 41 32 %c)"
+               # Use awk to remove everything unprintable
+               model_stripped="$(ar71xx_get_mtd_offset_size_format art 41 32 %c | LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}')"
+               case $model in
+               $'\xff'*)
+                       if [ "${model:24:1}" = 'N' ]; then
+                               machine="NETGEAR WNDRMAC"
+                       else
+                               machine="NETGEAR WNDR3700v2"
+                       fi
+                       ;;
+               '29763654+16+64'*)
+                       machine="NETGEAR ${model_stripped:14}"
+                       ;;
+               '29763654+16+128'*)
+                       machine="NETGEAR ${model_stripped:15}"
+                       ;;
+               *)
+                       # Unknown ID
+                       machine="NETGEAR ${model_stripped}"
+               esac
+       esac
+
+       AR71XX_BOARD_NAME="$name"
+       AR71XX_MODEL="$machine"
+}
+
+ubnt_get_mtd_part_magic() {
+       ar71xx_get_mtd_offset_size_format EEPROM 4118 2 %02x
+}
+
+ubnt_xm_board_detect() {
+       local model
+       local magic
+
+       magic="$(ubnt_get_mtd_part_magic)"
+       case ${magic:0:3} in
+       "e00"|\
+       "e01"|\
+       "e80")
+               model="Ubiquiti NanoStation M"
+               ;;
+       "e0a")
+               model="Ubiquiti NanoStation loco M"
+               ;;
+       "e1b"|\
+       "e1d")
+               model="Ubiquiti Rocket M"
+               ;;
+       "e20"|\
+       "e2d")
+               model="Ubiquiti Bullet M"
+               ;;
+       "e30")
+               model="Ubiquiti PicoStation M"
+               ;;
+       esac
+
+       [ -z "$model" ] || AR71XX_MODEL="${model}${magic:3:1}"
+}
+
+ubnt_unifi_ac_get_mtd_part_magic() {
+       ar71xx_get_mtd_offset_size_format EEPROM 12 2 %02x
+}
+
+ubnt_unifi_ac_board_detect() {
+       local model
+       local magic
+
+       magic="$(ubnt_unifi_ac_get_mtd_part_magic)"
+       case ${magic:0:4} in
+       "e517")
+               model="Ubiquiti UniFi-AC-LITE"
+               ;;
+       "e527")
+               model="Ubiquiti UniFi-AC-LR"
+               ;;
+       "e537")
+               model="Ubiquiti UniFi-AC-PRO"
+               ;;
+       "e557")
+               model="Ubiquiti UniFi-AC-MESH"
+               ;;
+       "e567")
+               model="Ubiquiti UniFi-AC-MESH-PRO"
+               ;;
+       esac
+
+       [ -z "$model" ] || AR71XX_MODEL="${model}"
+}
+
+cybertan_get_hw_magic() {
+       local part
+
+       part=$(find_mtd_part firmware)
+       [ -z "$part" ] && return 1
+
+       dd bs=8 count=1 skip=0 if=$part 2>/dev/null | hexdump -v -n 8 -e '1/1 "%02x"'
+}
+
+dir505_board_detect() {
+       local dev=$(find_mtd_part 'mac')
+       [ -z "$dev" ] && return
+
+       # The revision is stored at the beginning of the "mac" partition
+       local rev="$(LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}' $dev)"
+       AR71XX_MODEL="D-Link DIR-505 rev. $rev"
+}
+
+tplink_get_hwid() {
+       local part
+
+       part=$(find_mtd_part firmware)
+       [ -z "$part" ] && return 1
+
+       dd if=$part bs=4 count=1 skip=16 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
+}
+
+tplink_get_mid() {
+       local part
+
+       part=$(find_mtd_part firmware)
+       [ -z "$part" ] && return 1
+
+       dd if=$part bs=4 count=1 skip=17 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
+}
+
+tplink_board_detect() {
+       local model="$1"
+       local hwid
+       local hwver
+
+       hwid=$(tplink_get_hwid)
+       mid=$(tplink_get_mid)
+       hwver=${hwid:6:2}
+       hwver=" v${hwver#0}"
+
+       case "$hwid" in
+       "001001"*)
+               model="TP-Link TL-MR10U"
+               ;;
+       "001101"*)
+               model="TP-Link TL-MR11U"
+               ;;
+       "001201"*)
+               model="TP-Link TL-MR12U"
+               ;;
+       "001301"*)
+               model="TP-Link TL-MR13U"
+               ;;
+       "007260"*)
+               model="TellStick ZNet Lite"
+               ;;
+       "015000"*)
+               model="EasyLink EL-M150"
+               ;;
+       "015300"*)
+               model="EasyLink EL-MINI"
+               ;;
+       "044401"*)
+               model="ANTMINER-S1"
+               ;;
+       "044403"*)
+               model="ANTMINER-S3"
+               ;;
+       "066601"*)
+               model="OMYlink OMY-G1"
+               ;;
+       "066602"*)
+               model="OMYlink OMY-X1"
+               ;;
+       "070100"*)
+               model="TP-Link TL-WA701N/ND"
+               ;;
+       "070301"*)
+               model="TP-Link TL-WR703N"
+               ;;
+       "071000"*)
+               model="TP-Link TL-WR710N"
+
+               [ "$hwid" = '07100002' -a "$mid" = '00000002' ] && hwver=' v2.1'
+               ;;
+       "072001"*)
+               model="TP-Link TL-WR720N"
+               ;;
+       "073000"*)
+               model="TP-Link TL-WA730RE"
+               ;;
+       "074000"*)
+               model="TP-Link TL-WR740N/ND"
+               ;;
+       "074100"*)
+               model="TP-Link TL-WR741N/ND"
+               ;;
+       "074300"*)
+               model="TP-Link TL-WR743N/ND"
+               ;;
+       "075000"*)
+               model="TP-Link TL-WA750RE"
+               ;;
+       "080100"*)
+               model="TP-Link TL-WA801N/ND"
+               ;;
+       "080200"*)
+               model="TP-Link TL-WR802N"
+
+               [ "$hwid" = '08020002' -a "$mid" = '00000002' ] && hwver=' v2'
+               ;;
+       "081000"*)
+               model="TP-Link TL-WR810N"
+               ;;
+       "083000"*)
+               model="TP-Link TL-WA830RE"
+
+               [ "$hwver" = ' v10' ] && hwver=' v1'
+               ;;
+       "084100"*)
+               model="TP-Link TL-WR841N/ND"
+
+               [ "$hwid" = '08410002' -a "$mid" = '00000002' ] && hwver=' v1.5'
+               ;;
+       "084200"*)
+               model="TP-Link TL-WR842N/ND"
+               ;;
+       "084300"*)
+               model="TP-Link TL-WR843N/ND"
+               ;;
+       "085000"*)
+               model="TP-Link TL-WA850RE"
+               ;;
+       "085500"*)
+               model="TP-Link TL-WA855RE"
+               ;;
+       "086000"*)
+               model="TP-Link TL-WA860RE"
+               ;;
+       "090100"*)
+               model="TP-Link TL-WA901N/ND"
+               ;;
+       "094000"*)
+               model="TP-Link TL-WR940N"
+               ;;
+       "094100"*)
+               model="TP-Link TL-WR941N/ND"
+
+               [ "$hwid" = "09410002" -a "$mid" = "00420001" ] && {
+                       model="Rosewill RNX-N360RT"
+                       hwver=""
+               }
+               ;;
+       "104100"*)
+               model="TP-Link TL-WR1041N/ND"
+               ;;
+       "104300"*)
+               model="TP-Link TL-WR1043N/ND"
+               ;;
+       "120000"*)
+               model="MERCURY MAC1200R"
+               ;;
+       "254300"*)
+               model="TP-Link TL-WR2543N/ND"
+               ;;
+       "302000"*)
+               model="TP-Link TL-MR3020"
+               ;;
+       "304000"*)
+               model="TP-Link TL-MR3040"
+               ;;
+       "322000"*)
+               model="TP-Link TL-MR3220"
+               ;;
+       "332000"*)
+               model="TP-Link TL-WDR3320"
+               ;;
+       "342000"*)
+               model="TP-Link TL-MR3420"
+               ;;
+       "350000"*)
+               model="TP-Link TL-WDR3500"
+               ;;
+       "360000"*)
+               model="TP-Link TL-WDR3600"
+               ;;
+       "430000"*)
+               model="TP-Link TL-WDR4300"
+               ;;
+       "430080"*)
+               iw reg set IL
+               model="TP-Link TL-WDR4300 (IL)"
+               ;;
+       "431000"*)
+               model="TP-Link TL-WDR4310"
+               ;;
+       "44440101"*)
+               model="ANTROUTER-R1"
+               ;;
+       "453000"*)
+               model="Mercury MW4530R"
+               ;;
+       "49000002")
+               model="TP-Link TL-WDR4900"
+               ;;
+       "640000"*)
+               model="TP-Link TL-MR6400"
+               ;;
+       "65000002")
+               model="TP-Link TL-WDR6500"
+               ;;
+       "721000"*)
+               model="TP-Link TL-WA7210N"
+               ;;
+       "750000"*|\
+       "c70000"*)
+               model="TP-Link Archer C7"
+               ;;
+       "751000"*)
+               model="TP-Link TL-WA7510N"
+               ;;
+       "934100"*)
+               model="NC-LINK SMART-300"
+               ;;
+       "c50000"*)
+               model="TP-Link Archer C5"
+               ;;
+       *)
+               hwver=""
+               ;;
+       esac
+
+       AR71XX_MODEL="$model$hwver"
+}
+
+tplink_pharos_get_model_string() {
+       local part
+       part=$(find_mtd_part 'product-info')
+       [ -z "$part" ] && return 1
+
+       # The returned string will end with \r\n, but we don't remove it here
+       # to simplify matching against it in the sysupgrade image check
+       dd if=$part bs=1 skip=4360 2>/dev/null | head -n 1
+}
+
+tplink_pharos_board_detect() {
+       local model_string="$1"
+       local oIFS="$IFS"; IFS=":"; set -- $model_string; IFS="$oIFS"
+
+       local model="${1%%\(*}"
+
+       AR71XX_MODEL="TP-Link $model v$2"
+}
+
+tplink_pharos_v2_get_model_string() {
+       local part
+       part=$(find_mtd_part 'product-info')
+       [ -z "$part" ] && return 1
+
+       dd if=$part iflag=skip_bytes bs=64 skip=4360 count=1 2>/dev/null | tr -d '\r\0' | head -n 1
+}
+
+mikrotik_board_detect() {
+       local machine="$1"
+
+       case "$machine" in
+       *"2011iL")
+               name="rb-2011il"
+               ;;
+       *"2011iLS")
+               name="rb-2011ils"
+               ;;
+       *"2011L")
+               name="rb-2011l"
+               ;;
+       *"2011UAS")
+               name="rb-2011uas"
+               ;;
+       *"2011UAS-2HnD")
+               name="rb-2011uas-2hnd"
+               ;;
+       *"2011UiAS")
+               name="rb-2011uias"
+               ;;
+       *"2011UiAS-2HnD")
+               name="rb-2011uias-2hnd"
+               ;;
+       *"2011UiAS-2HnD r2")
+               name="rb-2011uias-2hnd-r2"
+               ;;
+       *"411/A/AH")
+               name="rb-411"
+               ;;
+       *"411U")
+               name="rb-411u"
+               ;;
+       *"433/AH")
+               name="rb-433"
+               ;;
+       *"433UAH")
+               name="rb-433u"
+               ;;
+       *"435G")
+               name="rb-435g"
+               ;;
+       *"450")
+               name="rb-450"
+               ;;
+       *"450G")
+               name="rb-450g"
+               ;;
+       *"493/AH")
+               name="rb-493"
+               ;;
+       *"493G")
+               name="rb-493g"
+               ;;
+       *"750")
+               name="rb-750"
+               ;;
+       *"750 r2"|\
+       *"750r2")
+               name="rb-750-r2"
+               ;;
+       *"750GL")
+               name="rb-750gl"
+               ;;
+       *"750P r2")
+               name="rb-750p-pbr2"
+               ;;
+       *"750UP r2"|\
+       *"750UPr2")
+               name="rb-750up-r2"
+               ;;
+       *"751")
+               name="rb-751"
+               ;;
+       *"751G")
+               name="rb-751g"
+               ;;
+       *"911-2Hn")
+               name="rb-911-2hn"
+               ;;
+       *"911-5Hn")
+               name="rb-911-5hn"
+               ;;
+       *"911G-2HPnD")
+               name="rb-911g-2hpnd"
+               ;;
+       *"911G-5HPacD")
+               name="rb-911g-5hpacd"
+               ;;
+       *"911G-5HPnD")
+               name="rb-911g-5hpnd"
+               ;;
+       *"912UAG-2HPnD")
+               name="rb-912uag-2hpnd"
+               ;;
+       *"912UAG-5HPnD")
+               name="rb-912uag-5hpnd"
+               ;;
+       *"921GS-5HPacD r2")
+               name="rb-921gs-5hpacd-r2"
+               ;;
+       *"922UAGS-5HPacD")
+               name="rb-922uags-5hpacd"
+               ;;
+       *"931-2nD")
+               name="rb-931-2nd"
+               ;;
+       *"941-2nD")
+               name="rb-941-2nd"
+               ;;
+       *"951G-2HnD")
+               name="rb-951g-2hnd"
+               ;;
+       *"951Ui-2HnD")
+               name="rb-951ui-2hnd"
+               ;;
+       *"951Ui-2nD")
+               name="rb-951ui-2nd"
+               ;;
+       *"952Ui-5ac2nD")
+               name="rb-952ui-5ac2nd"
+               ;;
+       *"962UiGS-5HacT2HnT")
+               name="rb-962uigs-5hact2hnt"
+               ;;
+       *"LHG 5nD")
+               name="rb-lhg-5nd"
+               ;;
+       *"mAP 2nD"|\
+       *"mAP2nD")
+               name="rb-map-2nd"
+               ;;
+       *"mAP L-2nD"|\
+       *"mAPL-2nD")
+               name="rb-mapl-2nd"
+               ;;
+       *"SXT 2nD r3")
+               name="rb-sxt-2nd-r3"
+               ;;
+       *"SXT Lite2")
+               name="rb-sxt2n"
+               ;;
+       *"SXT Lite5")
+               name="rb-sxt5n"
+               ;;
+       *"wAP 2nD r2")
+               name="rb-wap-2nd"
+               ;;
+       *"wAP R-2nD"|\
+       *"wAPR-2nD")
+               name="rb-wapr-2nd"
+               ;;
+       *"wAP G-5HacT2HnD"|\
+       *"wAPG-5HacT2HnD")
+               name="rb-wapg-5hact2hnd"
+               ;;
+       esac
+
+       echo "$name"
+}
+
+ar71xx_board_detect() {
+       local machine
+       local name
+
+       machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
+
+       case "$machine" in
+       *"A40")
+               name="a40"
+               ;;
+       *"A60")
+               name="a60"
+               ;;
+       *"AC1750DB")
+               name="f9k1115v2"
+               ;;
+       *"AirGateway")
+               name="airgateway"
+               ;;
+       *"AirGateway Pro")
+               name="airgatewaypro"
+               ;;
+       *"AirRouter")
+               name="airrouter"
+               ;;
+       *"ALFA Network AP120C")
+               name="alfa-ap120c"
+               ;;
+       *"ALFA Network AP96")
+               name="alfa-ap96"
+               ;;
+       *"ALFA Network N2/N5")
+               name="alfa-nx"
+               ;;
+       *"ALL0258N")
+               name="all0258n"
+               ;;
+       *"ALL0305")
+               name="all0305"
+               ;;
+       *"ALL0315N")
+               name="all0315n"
+               ;;
+       *"Antminer-S1")
+               name="antminer-s1"
+               ;;
+       *"Antminer-S3")
+               name="antminer-s3"
+               ;;
+       *"AP121 reference board")
+               name="ap121"
+               ;;
+       *"AP121-MINI")
+               name="ap121-mini"
+               ;;
+       *"AP121F")
+               name="ap121f"
+               ;;
+       *"AP132 reference board")
+               name="ap132"
+               ;;
+       *"AP135-020 reference board")
+               name="ap135-020"
+               ;;
+       *"AP136-010 reference board")
+               name="ap136-010"
+               ;;
+       *"AP136-020 reference board")
+               name="ap136-020"
+               ;;
+       *"AP143 reference board")
+               name="ap143"
+               ;;
+       *"AP147-010 reference board")
+               name="ap147-010"
+               ;;
+       *"AP152 reference board")
+               name="ap152"
+               ;;
+       *"AP531B0")
+               name="ap531b0"
+               ;;
+       *"AP90Q")
+               name="ap90q"
+               ;;
+       *"AP91-5G")
+               name="ap91-5g"
+               ;;
+       *"Archer C25 v1")
+               name="archer-c25-v1"
+               ;;
+       *"Archer C5")
+               name="archer-c5"
+               ;;
+       *"Archer C7 v4")
+               name="archer-c7-v4"
+               ;;
+       *"Archer C7 v5")
+               name="archer-c7-v5"
+               ;;
+       *"Archer C58 v1")
+               name="archer-c58-v1"
+               ;;
+       *"Archer C59 v1")
+               name="archer-c59-v1"
+        ;;
+       *"Archer C59 v2")
+               name="archer-c59-v2"
+               ;;
+       *"Archer C60 v1")
+               name="archer-c60-v1"
+               ;;
+       *"Archer C60 v2")
+               name="archer-c60-v2"
+               ;;
+       *"Archer C7")
+               name="archer-c7"
+               ;;
+       *"Arduino Yun")
+               name="arduino-yun"
+               ;;
+       *"Atheros AP96")
+               name="ap96"
+               ;;
+       *"Atheros AP83")
+               name="ap83"
+               ;;
+       *"AW-NR580")
+               name="aw-nr580"
+               ;;
+       *"BHR-4GRV2")
+               name="bhr-4grv2"
+               ;;
+       *"Black Swift board"*)
+               name="bsb"
+               ;;
+       *"Bullet M")
+               name="bullet-m"
+               ubnt_xm_board_detect
+               ;;
+       *"Bullet M XW")
+               name="bullet-m-xw"
+               ;;
+       *"BXU2000n-2 rev. A1")
+               name="bxu2000n-2-a1"
+               ;;
+       *"C-55")
+               name="c-55"
+               ;;
+       *"C-60")
+               name="c-60"
+               ;;
+       *"CAP324")
+               name="cap324"
+               ;;
+       *"CAP4200AG")
+               name="cap4200ag"
+               ;;
+       *"Carambola2"*)
+               name="carambola2"
+               ;;
+       *"CF-E316N v2")
+               name="cf-e316n-v2"
+               ;;
+       *"CF-E320N v2")
+               name="cf-e320n-v2"
+               ;;
+       *"CF-E355AC v1")
+               name="cf-e355ac-v1"
+               ;;
+       *"CF-E355AC v2")
+               name="cf-e355ac-v2"
+               ;;
+       *"CF-E375AC")
+               name="cf-e375ac"
+               ;;
+       *"CF-E380AC v1")
+               name="cf-e380ac-v1"
+               ;;
+       *"CF-E380AC v2")
+               name="cf-e380ac-v2"
+               ;;
+       *"CF-E385AC")
+               name="cf-e385ac"
+               ;;
+       *"CF-E520N")
+               name="cf-e520n"
+               ;;
+       *"CF-E530N")
+               name="cf-e530n"
+               ;;
+       *"CPE210/220")
+               name="cpe210"
+               tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
+               ;;
+       *"CPE210 v2")
+               name="cpe210-v2"
+               tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
+               ;;
+       *"CPE210 v3")
+               name="cpe210-v3"
+               tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
+               ;;
+       *"CPE505N")
+               name="cpe505n"
+               ;;
+       *"CPE510/520")
+               name="cpe510"
+               tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
+               ;;
+       *"CPE510 v2")
+               name="cpe510-v2"
+               tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
+               ;;
+       *"CPE830")
+               name="cpe830"
+               ;;
+       *"CPE870")
+               name="cpe870"
+               ;;
+       *"CR3000")
+               name="cr3000"
+               ;;
+       *"CR5000")
+               name="cr5000"
+               ;;
+       *"DAP-1330 Rev. A1")
+               name="dap-1330-a1"
+               ;;
+       *"DAP-2695 rev. A1")
+               name="dap-2695-a1"
+               ;;
+       *"DB120 reference board")
+               name="db120"
+               ;;
+       *"DGL-5500 rev. A1")
+               name="dgl-5500-a1"
+               ;;
+       *"DHP-1565 rev. A1")
+               name="dhp-1565-a1"
+               ;;
+       *"DIR-505 rev. A1")
+               name="dir-505-a1"
+               dir505_board_detect
+               ;;
+       *"DIR-600 rev. A1")
+               name="dir-600-a1"
+               ;;
+       *"DIR-615 rev. C1")
+               name="dir-615-c1"
+               ;;
+       *"DIR-615 rev. E1")
+               name="dir-615-e1"
+               ;;
+       *"DIR-615 rev. E4")
+               name="dir-615-e4"
+               ;;
+       *"DIR-615 rev. I1")
+               name="dir-615-i1"
+               ;;
+       *"DIR-825 rev. B1")
+               name="dir-825-b1"
+               ;;
+       *"DIR-825 rev. C1")
+               name="dir-825-c1"
+               ;;
+       *"DIR-835 rev. A1")
+               name="dir-835-a1"
+               ;;
+       *"DIR-869 rev. A1")
+               name="dir-869-a1"
+               ;;
+       *"dLAN Hotspot")
+               name="dlan-hotspot"
+               ;;
+       *"dLAN pro 1200+ WiFi ac")
+               name="dlan-pro-1200-ac"
+               ;;
+       *"dLAN pro 500 Wireless+")
+               name="dlan-pro-500-wp"
+               ;;
+       *"Domino Pi")
+               name="gl-domino"
+               ;;
+       *"DR342")
+               name="dr342"
+               ;;
+       *"DR344")
+               name="dr344"
+               ;;
+       *"DR531")
+               name="dr531"
+               ;;
+       *"Dragino v2")
+               name="dragino2"
+               ;;
+       *"DW33D")
+               name="dw33d"
+               ;;
+       *"E1700AC v2")
+               name="e1700ac-v2"
+               ;;
+       *"E2100L")
+               name="e2100l"
+               ;;
+       *"E558 v2")
+               name="e558-v2"
+               ;;
+       *"E600G v2")
+               name="e600g-v2"
+               ;;
+       *"E600GAC v2")
+               name="e600gac-v2"
+               ;;
+       *"E750A v4")
+               name="e750a-v4"
+               ;;
+       *"E750G v8")
+               name="e750g-v8"
+               ;;
+       *"EAP120")
+               name="eap120"
+               tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
+               ;;
+       *"EAP300 v2")
+               name="eap300v2"
+               ;;
+       *"EAP7660D")
+               name="eap7660d"
+               ;;
+       *"EBR-2310 rev. C1")
+               name="ebr-2310-c1"
+               ;;
+       *"EL-M150")
+               name="el-m150"
+               ;;
+       *"EL-MINI")
+               name="el-mini"
+               ;;
+       *"EmbWir-Balin")
+               name="ew-balin"
+               ;;
+       *"EmbWir-Dorin")
+               name="ew-dorin"
+               ;;
+       *"EmbWir-Dorin-Router")
+               name="ew-dorin-router"
+               ;;
+       *"ENS202EXT")
+               name="ens202ext"
+               ;;
+       *"EPG5000")
+               name="epg5000"
+               ;;
+       *"ESR1750")
+               name="esr1750"
+               ;;
+       *"ESR900")
+               name="esr900"
+               ;;
+       *"eTactica EG-200")
+               name="rme-eg200"
+               ;;
+       *"FRITZ!Box 4020")
+               name="fritz4020"
+               ;;
+       *"FRITZ!WLAN Repeater 300E")
+               name="fritz300e"
+               ;;
+       *"FRITZ!WLAN Repeater 450E")
+               name="fritz450e"
+               ;;
+       *"GL-AR150")
+               name="gl-ar150"
+               ;;
+       *"GL-AR300")
+               name="gl-ar300"
+               ;;
+       *"GL-AR300M")
+               name="gl-ar300m"
+               ;;
+       *"GL-AR750")
+               name="gl-ar750"
+               ;;
+       *"GL-AR750S")
+               name="gl-ar750s"
+               ;;
+       *"GL-CONNECT INET v1")
+               name="gl-inet"
+
+               local size="$(mtd_get_part_size 'firmware')"
+
+               [ "$size" = "8192000" ] && AR71XX_MODEL="GL-iNet 6408A v1"
+               [ "$size" = "16580608" ] && AR71XX_MODEL="GL-iNet 6416A v1"
+               ;;
+       *"GL-MIFI")
+               name="gl-mifi"
+               ;;
+       *"GL-USB150")
+               name="gl-usb150"
+               ;;
+       *"HiveAP-121")
+               name="hiveap-121"
+               ;;
+       *"HiWiFi HC6361")
+               name="hiwifi-hc6361"
+               ;;
+       *"Hornet-UB")
+               local size="$(mtd_get_part_size 'firmware')"
+
+               [ "$size" = "7929856" ] && name="hornet-ub"
+               [ "$size" = "16318464" ] && name="hornet-ub-x2"
+               ;;
+       *"JA76PF")
+               name="ja76pf"
+               ;;
+       *"JA76PF2")
+               name="ja76pf2"
+               ;;
+       *"JWAP003")
+               name="jwap003"
+               ;;
+       *"JWAP230")
+               name="jwap230"
+               ;;
+       *"Koala")
+               name="koala"
+               ;;
+       *"LAN Turtle")
+               name="lan-turtle"
+               ;;
+       *"Lima"*)
+               name="lima"
+               ;;
+       *"Litebeam M5"*)
+               name="lbe-m5"
+               ;;
+       *"Loco M XW")
+               name="loco-m-xw"
+               ;;
+       *"LS-SR71")
+               name="ls-sr71"
+               ;;
+       *"MAC1200R")
+               name="mc-mac1200r"
+               ;;
+       "MikroTik"*|\
+       "Mikrotik"*)
+               name=$(mikrotik_board_detect "$machine")
+               ;;
+       *"MiniBox V1.0")
+               name="minibox-v1"
+               ;;
+       *"Minibox V3.2")
+               name="minibox-v3.2"
+               ;;
+       *"MR12")
+               name="mr12"
+               ;;
+       *"MR16")
+               name="mr16"
+               ;;
+       *"MR1750")
+               name="mr1750"
+               ;;
+       *"MR1750v2")
+               name="mr1750v2"
+               ;;
+       *"MR18")
+               name="mr18"
+               ;;
+       *"MR600")
+               name="mr600"
+               ;;
+       *"MR600v2")
+               name="mr600v2"
+               ;;
+       *"MR900")
+               name="mr900"
+               ;;
+       *"MR900v2")
+               name="mr900v2"
+               ;;
+       *"My Net N600")
+               name="mynet-n600"
+               ;;
+       *"My Net N750")
+               name="mynet-n750"
+               ;;
+       *"My Net Wi-Fi Range Extender")
+               name="mynet-rext"
+               ;;
+       *"MZK-W04NU")
+               name="mzk-w04nu"
+               ;;
+       *"MZK-W300NH")
+               name="mzk-w300nh"
+               ;;
+       *"N5Q")
+               name="n5q"
+               ;;
+       *"Nanostation M")
+               name="nanostation-m"
+               ubnt_xm_board_detect
+               ;;
+       *"Nanostation M XW")
+               name="nanostation-m-xw"
+               ;;
+       *"NBG460N/550N/550NH")
+               name="nbg460n_550n_550nh"
+               ;;
+       *"NBG6616")
+               name="nbg6616"
+               ;;
+       *"NBG6716")
+               name="nbg6716"
+               ;;
+       *"OM2P")
+               name="om2p"
+               ;;
+       *"OM2P HS")
+               name="om2p-hs"
+               ;;
+       *"OM2P HSv2")
+               name="om2p-hsv2"
+               ;;
+       *"OM2P HSv3")
+               name="om2p-hsv3"
+               ;;
+       *"OM2P HSv4")
+               name="om2p-hsv4"
+               ;;
+       *"OM2P LC")
+               name="om2p-lc"
+               ;;
+       *"OM2Pv2")
+               name="om2pv2"
+               ;;
+       *"OM2Pv4")
+               name="om2pv4"
+               ;;
+       *"OM5P")
+               name="om5p"
+               ;;
+       *"OM5P AC")
+               name="om5p-ac"
+               ;;
+       *"OM5P ACv2")
+               name="om5p-acv2"
+               ;;
+       *"OM5P AN")
+               name="om5p-an"
+               ;;
+       *"OMY-G1")
+               name="omy-g1"
+               ;;
+       *"OMY-X1")
+               name="omy-x1"
+               ;;
+       *"Onion Omega")
+               name="onion-omega"
+               ;;
+       *"Oolite V1.0")
+               name="oolite-v1"
+               ;;
+       *"Packet Squirrel")
+               name="packet-squirrel"
+               ;;
+       *"Oolite V5.2")
+               name="oolite-v5.2"
+               ;;
+       *"Oolite V5.2-Dev")
+               name="oolite-v5.2-dev"
+               ;;
+       *"PB42")
+               name="pb42"
+               ;;
+       *"PB44 reference board")
+               name="pb44"
+               ;;
+       *"PQI Air Pen")
+               name="pqi-air-pen"
+               ;;
+       *"Qihoo 360 C301")
+               name="qihoo-c301"
+               ;;
+       *"R36A")
+               name="r36a"
+               ;;
+       *"R602N")
+               name="r602n"
+               ;;
+       *"R6100")
+               name="r6100"
+               ;;
+       *"Rambutan"*)
+               name="rambutan"
+               ;;
+       *"RE355")
+               name="re355"
+               ;;
+       *"RE450")
+               name="re450"
+               ;;
+       *"Rocket M")
+               name="rocket-m"
+               ubnt_xm_board_detect
+               ;;
+       *"Rocket M TI")
+               name="rocket-m-ti"
+               ;;
+       *"Rocket M XW")
+               name="rocket-m-xw"
+               ;;
+       *"RouterStation")
+               name="routerstation"
+               ;;
+       *"RouterStation Pro")
+               name="routerstation-pro"
+               ;;
+       *"RUT900")
+               name="rut900"
+               ;;
+       *"RW2458N")
+               name="rw2458n"
+               ;;
+       *"SC1750")
+               name="sc1750"
+               ;;
+       *"SC300M")
+               name="sc300m"
+               ;;
+       *"SC450")
+               name="sc450"
+               ;;
+       *"SMART-300")
+               name="smart-300"
+               ;;
+       *"SOM9331")
+               name="som9331"
+               ;;
+       *"SR3200")
+               name="sr3200"
+               ;;
+       *"T830")
+               name="t830"
+               ;;
+       *"TellStick ZNet Lite")
+               name="tellstick-znet-lite"
+               ;;
+       *"TEW-632BRP")
+               name="tew-632brp"
+               ;;
+       *"TEW-673GRU")
+               name="tew-673gru"
+               ;;
+       *"TEW-712BR")
+               name="tew-712br"
+               ;;
+       *"TEW-732BR")
+               name="tew-732br"
+               ;;
+       *"TEW-823DRU")
+               name="tew-823dru"
+               ;;
+       *"TL-MR10U")
+               name="tl-mr10u"
+               ;;
+       *"TL-MR11U")
+               name="tl-mr11u"
+               ;;
+       *"TL-MR12U")
+               name="tl-mr12u"
+               ;;
+       *"TL-MR13U v1")
+               name="tl-mr13u"
+               ;;
+       *"TL-MR3020")
+               name="tl-mr3020"
+               ;;
+       *"TL-MR3040")
+               name="tl-mr3040"
+               ;;
+       *"TL-MR3040 v2")
+               name="tl-mr3040-v2"
+               ;;
+       *"TL-MR3220")
+               name="tl-mr3220"
+               ;;
+       *"TL-MR3220 v2")
+               name="tl-mr3220-v2"
+               ;;
+       *"TL-MR3420")
+               name="tl-mr3420"
+               ;;
+       *"TL-MR3420 v2")
+               name="tl-mr3420-v2"
+               ;;
+       *"TL-MR6400")
+               name="tl-mr6400"
+               ;;
+       *"TL-WA701ND v2")
+               name="tl-wa701nd-v2"
+               ;;
+       *"TL-WA7210N v2")
+               name="tl-wa7210n-v2"
+               ;;
+       *"TL-WA750RE")
+               name="tl-wa750re"
+               ;;
+       *"TL-WA7510N v1")
+               name="tl-wa7510n"
+               ;;
+       *"TL-WA801ND v2")
+               name="tl-wa801nd-v2"
+               ;;
+       *"TL-WA801ND v3")
+               name="tl-wa801nd-v3"
+               ;;
+       *"TL-WA830RE v2")
+               name="tl-wa830re-v2"
+               ;;
+       *"TL-WA850RE")
+               name="tl-wa850re"
+               ;;
+       *"TL-WA850RE v2")
+               name="tl-wa850re-v2"
+               ;;
+       *"TL-WA855RE v1")
+               name="tl-wa855re-v1"
+               ;;
+       *"TL-WA860RE")
+               name="tl-wa860re"
+               ;;
+       *"TL-WA901ND")
+               name="tl-wa901nd"
+               ;;
+       *"TL-WA901ND v2")
+               name="tl-wa901nd-v2"
+               ;;
+       *"TL-WA901ND v3")
+               name="tl-wa901nd-v3"
+               ;;
+       *"TL-WA901ND v4")
+               name="tl-wa901nd-v4"
+               ;;
+       *"TL-WA901ND v5")
+               name="tl-wa901nd-v5"
+               ;;
+       *"TL-WDR3320 v2")
+               name="tl-wdr3320-v2"
+               ;;
+       *"TL-WDR3500")
+               name="tl-wdr3500"
+               ;;
+       *"TL-WDR3600/4300/4310")
+               name="tl-wdr4300"
+               ;;
+       *"TL-WDR4900 v2")
+               name="tl-wdr4900-v2"
+               ;;
+       *"TL-WDR6500 v2")
+               name="tl-wdr6500-v2"
+               ;;
+       *"TL-WPA8630")
+               name="tl-wpa8630"
+               ;;
+       *"TL-WR1041N v2")
+               name="tl-wr1041n-v2"
+               ;;
+       *"TL-WR1043N v5")
+               name="tl-wr1043n-v5"
+               ;;
+       *"TL-WR1043ND")
+               name="tl-wr1043nd"
+               ;;
+       *"TL-WR1043ND v2")
+               name="tl-wr1043nd-v2"
+               ;;
+       *"TL-WR1043ND v4")
+               name="tl-wr1043nd-v4"
+               ;;
+       *"TL-WR2543N"*)
+               name="tl-wr2543n"
+               ;;
+       *"TL-WR703N v1")
+               name="tl-wr703n"
+               ;;
+       *"TL-WR710N v1")
+               name="tl-wr710n"
+               ;;
+       *"TL-WR720N"*)
+               name="tl-wr720n-v3"
+               ;;
+       *"TL-WR740N/ND v6")
+               name="tl-wr740n-v6"
+               ;;
+       *"TL-WR741ND")
+               name="tl-wr741nd"
+               ;;
+       *"TL-WR741ND v4")
+               name="tl-wr741nd-v4"
+               ;;
+       *"TL-WR802N v1")
+               name="tl-wr802n-v1"
+               ;;
+       *"TL-WR802N v2")
+               name="tl-wr802n-v2"
+               ;;
+       *"TL-WR810N")
+               name="tl-wr810n"
+               ;;
+       *"TL-WR810N v2")
+               name="tl-wr810n-v2"
+               ;;
+       *"TL-WR840N v2")
+               name="tl-wr840n-v2"
+               ;;
+       *"TL-WR840N v3")
+               name="tl-wr840n-v3"
+               ;;
+       *"TL-WR841N v1")
+               name="tl-wr841n-v1"
+               ;;
+       *"TL-WR841N/ND v11")
+               name="tl-wr841n-v11"
+               ;;
+       *"TL-WR841N/ND v7")
+               name="tl-wr841n-v7"
+               ;;
+       *"TL-WR841N/ND v8")
+               name="tl-wr841n-v8"
+               ;;
+       *"TL-WR841N/ND v9")
+               name="tl-wr841n-v9"
+               ;;
+       *"TL-WR842N/ND v2")
+               name="tl-wr842n-v2"
+               ;;
+       *"TL-WR842N/ND v3")
+               name="tl-wr842n-v3"
+               ;;
+       *"TL-WR902AC v1")
+               name="tl-wr902ac-v1"
+               ;;
+       *"TL-WR940N v4")
+               name="tl-wr940n-v4"
+               ;;
+       *"TL-WR940N v6")
+               name="tl-wr940n-v6"
+               ;;
+       *"TL-WR941N/ND v5")
+               name="tl-wr941nd-v5"
+               ;;
+       *"TL-WR941N/ND v6")
+               name="tl-wr941nd-v6"
+               ;;
+       *"TL-WR941ND")
+               name="tl-wr941nd"
+               ;;
+       *"TL-WR942N v1")
+               name="tl-wr942n-v1"
+               ;;
+       *"TS-D084")
+               name="ts-d084"
+               ;;
+       *"Tube2H")
+               name="tube2h"
+               ;;
+       *"UniFi")
+               name="unifi"
+               ;;
+       *"UniFi AP Pro")
+               name="uap-pro"
+               ;;
+       *"UniFi-AC-LITE/MESH")
+               name="unifiac-lite"
+               ubnt_unifi_ac_board_detect
+               ;;
+       *"UniFi-AC-PRO/MESH-PRO")
+               name="unifiac-pro"
+               ubnt_unifi_ac_board_detect
+               ;;
+       *"UniFiAP Outdoor")
+               name="unifi-outdoor"
+               ;;
+       *"UniFiAP Outdoor+")
+               name="unifi-outdoor-plus"
+               ;;
+       *"WAM250")
+               name="wam250"
+               ;;
+       *"WBS210")
+               name="wbs210"
+               tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
+               ;;
+       *"WBS510")
+               name="wbs510"
+               tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
+               ;;
+       "WeIO"*)
+               name="weio"
+               ;;
+       *"WI2A-AC200i")
+               name="wi2a-ac200i"
+               ;;
+       *"WHR-G301N")
+               name="whr-g301n"
+               ;;
+       *"WHR-HP-G300N")
+               name="whr-hp-g300n"
+               ;;
+       *"WHR-HP-GN")
+               name="whr-hp-gn"
+               ;;
+       *"WiFi Pineapple NANO")
+               name="wifi-pineapple-nano"
+               ;;
+       *"WLAE-AG300N")
+               name="wlae-ag300n"
+               ;;
+       *"WLR-8100")
+               name="wlr8100"
+               ;;
+       *"WNDAP360")
+               name="wndap360"
+               ;;
+       *"WNDR3700/WNDR3800/WNDRMAC")
+               wndr3700_board_detect "$machine"
+               ;;
+       *"WNDR3700v4")
+               name="wndr3700v4"
+               ;;
+       *"WNDR4300")
+               name="wndr4300"
+               ;;
+       *"WNR1000 V2")
+               name="wnr1000-v2"
+               ;;
+       *"WNR2000")
+               name="wnr2000"
+               ;;
+       *"WNR2000 V3")
+               name="wnr2000-v3"
+               ;;
+       *"WNR2000 V4")
+               name="wnr2000-v4"
+               ;;
+       *"WNR2200")
+               name="wnr2200"
+               ;;
+       *"WNR612 V2")
+               name="wnr612-v2"
+               ;;
+       *"WP543")
+               name="wp543"
+               ;;
+       *"WPE72")
+               name="wpe72"
+               ;;
+       *"WPJ342")
+               name="wpj342"
+               ;;
+       *"WPJ344")
+               name="wpj344"
+               ;;
+       *"WPJ531")
+               name="wpj531"
+               ;;
+       *"WPJ558")
+               name="wpj558"
+               ;;
+       *"WPJ563")
+               name="wpj563"
+               ;;
+       *"WPN824N")
+               name="wpn824n"
+               ;;
+       *"WRT160NL")
+               name="wrt160nl"
+               ;;
+       *"WRT400N")
+               name="wrt400n"
+               ;;
+       *"WRTnode2Q"*)
+               name="wrtnode2q"
+               ;;
+       *"WZR-450HP2")
+               name="wzr-450hp2"
+               ;;
+       *"WZR-HP-AG300H/WZR-600DHP")
+               name="wzr-hp-ag300h"
+               ;;
+       *"WZR-HP-G300NH")
+               name="wzr-hp-g300nh"
+               ;;
+       *"WZR-HP-G300NH2")
+               name="wzr-hp-g300nh2"
+               ;;
+       *"WZR-HP-G450H")
+               name="wzr-hp-g450h"
+               ;;
+       *"XD3200")
+               name="xd3200"
+               ;;
+       *"Z1")
+               name="z1"
+               ;;
+       *"ZBT-WE1526")
+               name="zbt-we1526"
+               ;;
+       *"ZCN-1523H-2")
+               name="zcn-1523h-2"
+               ;;
+       *"ZCN-1523H-5")
+               name="zcn-1523h-5"
+               ;;
+       esac
+
+       [ -z "$AR71XX_MODEL" ] && [ "${machine:0:8}" = 'TP-LINK ' ] && \
+               tplink_board_detect "$machine"
+
+       [ -z "$name" ] && name="unknown"
+
+       [ -z "$AR71XX_BOARD_NAME" ] && AR71XX_BOARD_NAME="$name"
+       [ -z "$AR71XX_MODEL" ] && AR71XX_MODEL="$machine"
+
+       [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
+
+       echo "$AR71XX_BOARD_NAME" > /tmp/sysinfo/board_name
+       echo "$AR71XX_MODEL" > /tmp/sysinfo/model
+}
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
new file mode 100755 (executable)
index 0000000..d7aa40a
--- /dev/null
@@ -0,0 +1,916 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+
+. /lib/functions/system.sh
+. /lib/ar71xx.sh
+
+PART_NAME=firmware
+RAMFS_COPY_DATA='/lib/ar71xx.sh /etc/fw_env.config /var/lock/fw_printenv.lock'
+RAMFS_COPY_BIN='nandwrite fw_printenv fw_setenv'
+
+CI_BLKSZ=65536
+CI_LDADR=0x80060000
+
+PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD=0
+
+platform_find_partitions() {
+       local first dev size erasesize name
+       while read dev size erasesize name; do
+               name=${name#'"'}; name=${name%'"'}
+               case "$name" in
+                       vmlinux.bin.l7|vmlinux|kernel|linux|linux.bin|rootfs|filesystem)
+                               if [ -z "$first" ]; then
+                                       first="$name"
+                               else
+                                       echo "$erasesize:$first:$name"
+                                       break
+                               fi
+                       ;;
+               esac
+       done < /proc/mtd
+}
+
+platform_find_kernelpart() {
+       local part
+       for part in "${1%:*}" "${1#*:}"; do
+               case "$part" in
+                       vmlinux.bin.l7|vmlinux|kernel|linux|linux.bin)
+                               echo "$part"
+                               break
+                       ;;
+               esac
+       done
+}
+
+platform_find_rootfspart() {
+       local part
+       for part in "${1%:*}" "${1#*:}"; do
+               [ "$part" != "$2" ] && echo "$part" && break
+       done
+}
+
+platform_do_upgrade_combined() {
+       local partitions=$(platform_find_partitions)
+       local kernelpart=$(platform_find_kernelpart "${partitions#*:}")
+       local erase_size=$((0x${partitions%%:*})); partitions="${partitions#*:}"
+       local kern_length=0x$(dd if="$1" bs=2 skip=1 count=4 2>/dev/null)
+       local kern_blocks=$(($kern_length / $CI_BLKSZ))
+       local root_blocks=$((0x$(dd if="$1" bs=2 skip=5 count=4 2>/dev/null) / $CI_BLKSZ))
+
+       if [ -n "$partitions" ] && [ -n "$kernelpart" ] && \
+          [ ${kern_blocks:-0} -gt 0 ] && \
+          [ ${root_blocks:-0} -gt 0 ] && \
+          [ ${erase_size:-0} -gt 0 ];
+       then
+               local rootfspart=$(platform_find_rootfspart "$partitions" "$kernelpart")
+               local append=""
+               [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP"
+
+               if [ "$PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD" -ne 1 ]; then
+                   ( dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null; \
+                     dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null ) | \
+                           mtd -r $append -F$kernelpart:$kern_length:$CI_LDADR,rootfs write - $partitions
+               elif [ -n "$rootfspart" ]; then
+                   dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null | \
+                           mtd write - $kernelpart
+                   dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null | \
+                           mtd -r $append write - $rootfspart
+               fi
+       fi
+       PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD=0
+}
+
+tplink_get_image_hwid() {
+       get_image "$@" | dd bs=4 count=1 skip=16 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
+}
+
+tplink_get_image_mid() {
+       get_image "$@" | dd bs=4 count=1 skip=17 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
+}
+
+tplink_get_image_boot_size() {
+       get_image "$@" | dd bs=4 count=1 skip=37 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
+}
+
+tplink_pharos_check_support_list() {
+       local image="$1"
+       local offset="$2"
+       local model="$3"
+       local trargs="$4"
+
+       # Here $image is given to dd directly instead of using get_image;
+       # otherwise the skip will take almost a second (as dd can't seek)
+       dd if="$image" bs=1 skip=$offset count=1024 2>/dev/null | tr -d "$trargs" | (
+               while IFS= read -r line; do
+                       [ "$line" = "$model" ] && exit 0
+               done
+
+               exit 1
+       )
+}
+
+tplink_pharos_check_image() {
+       local image_magic="$(get_magic_long "$1")"
+       local board_magic="$2"
+       [ "$image_magic" != "$board_magic" ] && {
+               echo "Invalid image magic '$image_magic'. Expected '$board_magic'."
+               return 1
+       }
+
+       local model_string="$3"
+       local trargs="$4"
+
+       # New images have the support list at 7802888, old ones at 1511432
+       tplink_pharos_check_support_list "$1" 7802888 "$model_string" "$trargs" || \
+       tplink_pharos_check_support_list "$1" 1511432 "$model_string" "$trargs" || {
+               echo "Unsupported image (model not in support-list)"
+               return 1
+       }
+
+       return 0
+}
+
+seama_get_type_magic() {
+       get_image "$@" | dd bs=1 count=4 skip=53 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
+}
+
+wrgg_get_image_magic() {
+       get_image "$@" | dd bs=4 count=1 skip=8 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
+}
+
+cybertan_get_image_magic() {
+       get_image "$@" | dd bs=8 count=1 skip=0  2>/dev/null | hexdump -v -n 8 -e '1/1 "%02x"'
+}
+
+cybertan_check_image() {
+       local magic="$(cybertan_get_image_magic "$1")"
+       local fw_magic="$(cybertan_get_hw_magic)"
+
+       [ "$fw_magic" != "$magic" ] && {
+               echo "Invalid image, ID mismatch, got:$magic, but need:$fw_magic"
+               return 1
+       }
+
+       return 0
+}
+
+platform_do_upgrade_compex() {
+       local fw_file=$1
+       local fw_part=$PART_NAME
+       local fw_mtd=$(find_mtd_part $fw_part)
+       local fw_length=0x$(dd if="$fw_file" bs=2 skip=1 count=4 2>/dev/null)
+       local fw_blocks=$(($fw_length / 65536))
+
+       if [ -n "$fw_mtd" ] &&  [ ${fw_blocks:-0} -gt 0 ]; then
+               local append=""
+               [ -f "$UPGRADE_BACKUP" ] && append="-j $UPGRADE_BACKUP"
+
+               sync
+               dd if="$fw_file" bs=64k skip=1 count=$fw_blocks 2>/dev/null | \
+                       mtd $append write - "$fw_part"
+       fi
+}
+
+alfa_check_image() {
+       local magic_long="$(get_magic_long "$1")"
+       local fw_part_size=$(mtd_get_part_size firmware)
+
+       case "$magic_long" in
+       "27051956")
+               [ "$fw_part_size" != "16318464" ] && {
+                       echo "Invalid image magic \"$magic_long\" for $fw_part_size bytes"
+                       return 1
+               }
+               ;;
+       "68737173")
+               [ "$fw_part_size" != "7929856" ] && {
+                       echo "Invalid image magic \"$magic_long\" for $fw_part_size bytes"
+                       return 1
+               }
+               ;;
+       esac
+
+       return 0
+}
+
+platform_check_image() {
+       local board=$(board_name)
+       local magic="$(get_magic_word "$1")"
+       local magic_long="$(get_magic_long "$1")"
+
+       [ "$#" -gt 1 ] && return 1
+
+       case "$board" in
+       airgateway|\
+       airgatewaypro|\
+       airrouter|\
+       ap121f|\
+       ap132|\
+       ap531b0|\
+       ap90q|\
+       archer-c25-v1|\
+       archer-c58-v1|\
+       archer-c59-v1|\
+       archer-c59-v2|\
+       archer-c60-v1|\
+       archer-c60-v2|\
+       archer-c7-v4|\
+       archer-c7-v5|\
+       bullet-m|\
+       bullet-m-xw|\
+       c-55|\
+       carambola2|\
+       cf-e316n-v2|\
+       cf-e320n-v2|\
+       cf-e355ac-v1|\
+       cf-e355ac-v2|\
+       cf-e375ac|\
+       cf-e380ac-v1|\
+       cf-e380ac-v2|\
+       cf-e385ac|\
+       cf-e520n|\
+       cf-e530n|\
+       cpe505n|\
+       cpe830|\
+       cpe870|\
+       dap-1330-a1|\
+       dgl-5500-a1|\
+       dhp-1565-a1|\
+       dir-505-a1|\
+       dir-600-a1|\
+       dir-615-c1|\
+       dir-615-e1|\
+       dir-615-e4|\
+       dir-615-i1|\
+       dir-825-c1|\
+       dir-835-a1|\
+       dlan-hotspot|\
+       dlan-pro-1200-ac|\
+       dlan-pro-500-wp|\
+       dr342|\
+       dr531|\
+       dragino2|\
+       e1700ac-v2|\
+       e558-v2|\
+       e600g-v2|\
+       e600gac-v2|\
+       e750a-v4|\
+       e750g-v8|\
+       ebr-2310-c1|\
+       ens202ext|\
+       epg5000|\
+       esr1750|\
+       esr900|\
+       ew-balin|\
+       ew-dorin|\
+       ew-dorin-router|\
+       gl-ar150|\
+       gl-ar300m|\
+       gl-ar300|\
+       gl-ar750|\
+       gl-ar750s|\
+       gl-domino|\
+       gl-mifi|\
+       gl-usb150|\
+       hiwifi-hc6361|\
+       hornet-ub-x2|\
+       jwap230|\
+       lbe-m5|\
+       lima|\
+       loco-m-xw|\
+       mzk-w04nu|\
+       mzk-w300nh|\
+       n5q|\
+       nanostation-m|\
+       nanostation-m-xw|\
+       nbg460n_550n_550nh|\
+       pqi-air-pen|\
+       r36a|\
+       r602n|\
+       rme-eg200|\
+       rocket-m|\
+       rocket-m-ti|\
+       rocket-m-xw|\
+       rw2458n|\
+       sc1750|\
+       sc300m|\
+       sc450|\
+       sr3200|\
+       t830|\
+       tew-632brp|\
+       tew-712br|\
+       tew-732br|\
+       tew-823dru|\
+       tl-wr1043n-v5|\
+       tl-wr942n-v1|\
+       unifi|\
+       unifi-outdoor|\
+       unifiac-lite|\
+       unifiac-pro|\
+       wam250|\
+       weio|\
+       whr-g301n|\
+       whr-hp-g300n|\
+       whr-hp-gn|\
+       wlae-ag300n|\
+       wndap360|\
+       wpj342|\
+       wpj344|\
+       wpj531|\
+       wpj558|\
+       wpj563|\
+       wrt400n|\
+       wrtnode2q|\
+       wzr-450hp2|\
+       wzr-hp-ag300h|\
+       wzr-hp-g300nh|\
+       wzr-hp-g300nh2|\
+       wzr-hp-g450h|\
+       xd3200)
+               [ "$magic" != "2705" ] && {
+                       echo "Invalid image type."
+                       return 1
+               }
+
+               return 0
+               ;;
+       alfa-ap96|\
+       alfa-nx|\
+       ap121|\
+       ap121-mini|\
+       ap135-020|\
+       ap136-010|\
+       ap136-020|\
+       ap147-010|\
+       ap152|\
+       ap83|\
+       ap91-5g|\
+       ap96|\
+       arduino-yun|\
+       bhr-4grv2|\
+       bxu2000n-2-a1|\
+       db120|\
+       dr344|\
+       dw33d|\
+       f9k1115v2|\
+       hornet-ub|\
+       mr12|\
+       mr16|\
+       zbt-we1526|\
+       zcn-1523h-2|\
+       zcn-1523h-5)
+               [ "$magic_long" != "68737173" -a "$magic_long" != "19852003" ] && {
+                       echo "Invalid image type."
+                       return 1
+               }
+
+               return 0
+               ;;
+       all0258n|\
+       all0315n|\
+       cap324|\
+       cap4200ag|\
+       cr3000|\
+       cr5000)
+               platform_check_image_allnet "$1" && return 0
+               return 1
+               ;;
+       all0305|\
+       eap300v2|\
+       eap7660d|\
+       ja76pf|\
+       ja76pf2|\
+       jwap003|\
+       ls-sr71|\
+       pb42|\
+       pb44|\
+       routerstation|\
+       routerstation-pro|\
+       wp543|\
+       wpe72)
+               [ "$magic" != "4349" ] && {
+                       echo "Invalid image. Use *-sysupgrade.bin files on this board"
+                       return 1
+               }
+
+               local md5_img=$(dd if="$1" bs=2 skip=9 count=16 2>/dev/null)
+               local md5_chk=$(fwtool -q -t -i /dev/null "$1"; dd if="$1" bs=$CI_BLKSZ skip=1 2>/dev/null | md5sum -); md5_chk="${md5_chk%% *}"
+
+               if [ -n "$md5_img" -a -n "$md5_chk" ] && [ "$md5_img" = "$md5_chk" ]; then
+                       return 0
+               else
+                       echo "Invalid image. Contents do not match checksum (image:$md5_img calculated:$md5_chk)"
+                       return 1
+               fi
+
+               return 0
+               ;;
+       antminer-s1|\
+       antminer-s3|\
+       antrouter-r1|\
+       archer-c5|\
+       archer-c7|\
+       el-m150|\
+       el-mini|\
+       gl-inet|\
+       lan-turtle|\
+       mc-mac1200r|\
+       minibox-v1|\
+       minibox-v3.2|\
+       omy-g1|\
+       omy-x1|\
+       onion-omega|\
+       oolite-v1|\
+       oolite-v5.2|\
+       oolite-v5.2-dev|\
+       packet-squirrel|\
+       re355|\
+       re450|\
+       rut900|\
+       smart-300|\
+       som9331|\
+       tellstick-znet-lite|\
+       tl-mr10u|\
+       tl-mr11u|\
+       tl-mr12u|\
+       tl-mr13u|\
+       tl-mr3020|\
+       tl-mr3040|\
+       tl-mr3040-v2|\
+       tl-mr3220|\
+       tl-mr3220-v2|\
+       tl-mr3420|\
+       tl-mr3420-v2|\
+       tl-mr6400|\
+       tl-wa701nd-v2|\
+       tl-wa7210n-v2|\
+       tl-wa750re|\
+       tl-wa7510n|\
+       tl-wa801nd-v2|\
+       tl-wa801nd-v3|\
+       tl-wa830re-v2|\
+       tl-wa850re|\
+       tl-wa850re-v2|\
+       tl-wa855re-v1|\
+       tl-wa860re|\
+       tl-wa901nd|\
+       tl-wa901nd-v2|\
+       tl-wa901nd-v3|\
+       tl-wa901nd-v4|\
+       tl-wa901nd-v5|\
+       tl-wdr3320-v2|\
+       tl-wdr3500|\
+       tl-wdr4300|\
+       tl-wdr4900-v2|\
+       tl-wdr6500-v2|\
+       tl-wpa8630|\
+       tl-wr1041n-v2|\
+       tl-wr1043nd|\
+       tl-wr1043nd-v2|\
+       tl-wr1043nd-v4|\
+       tl-wr2543n|\
+       tl-wr703n|\
+       tl-wr710n|\
+       tl-wr720n-v3|\
+       tl-wr740n-v6|\
+       tl-wr741nd|\
+       tl-wr741nd-v4|\
+       tl-wr802n-v1|\
+       tl-wr802n-v2|\
+       tl-wr810n|\
+       tl-wr810n-v2|\
+       tl-wr840n-v2|\
+       tl-wr840n-v3|\
+       tl-wr841n-v1|\
+       tl-wr841n-v7|\
+       tl-wr841n-v8|\
+       tl-wr841n-v9|\
+       tl-wr841n-v11|\
+       tl-wr842n-v2|\
+       tl-wr842n-v3|\
+       tl-wr902ac-v1|\
+       tl-wr940n-v4|\
+       tl-wr940n-v6|\
+       tl-wr941nd|\
+       tl-wr941nd-v5|\
+       tl-wr941nd-v6|\
+       ts-d084|\
+       wifi-pineapple-nano)
+               local magic_ver="0100"
+
+               case "$board" in
+               tl-wdr3320-v2|tl-wdr6500-v2)
+                       magic_ver="0200"
+                       ;;
+               esac
+
+               [ "$magic" != "$magic_ver" ] && {
+                       echo "Invalid image type."
+                       return 1
+               }
+
+               local hwid
+               local mid
+               local imagehwid
+               local imagemid
+
+               hwid=$(tplink_get_hwid)
+               mid=$(tplink_get_mid)
+               imagehwid=$(tplink_get_image_hwid "$1")
+               imagemid=$(tplink_get_image_mid "$1")
+
+               [ "$hwid" != "$imagehwid" -o "$mid" != "$imagemid" ] && {
+                       echo "Invalid image, hardware ID mismatch, hw:$hwid $mid image:$imagehwid $imagemid."
+                       return 1
+               }
+
+               local boot_size
+
+               boot_size=$(tplink_get_image_boot_size "$1")
+               [ "$boot_size" != "00000000" ] && {
+                       echo "Invalid image, it contains a bootloader."
+                       return 1
+               }
+
+               return 0
+               ;;
+       bsb|\
+       dir-825-b1|\
+       tew-673gru)
+               dir825b_check_image "$1" && return 0
+               ;;
+       rb-411|\
+       rb-411u|\
+       rb-433|\
+       rb-433u|\
+       rb-435g|\
+       rb-450|\
+       rb-450g|\
+       rb-493|\
+       rb-493g|\
+       rb-750|\
+       rb-750gl|\
+       rb-751|\
+       rb-751g|\
+       rb-911g-2hpnd|\
+       rb-911g-5hpnd|\
+       rb-911g-5hpacd|\
+       rb-912uag-2hpnd|\
+       rb-912uag-5hpnd|\
+       rb-921gs-5hpacd-r2|\
+       rb-922uags-5hpacd|\
+       rb-951g-2hnd|\
+       rb-951ui-2hnd|\
+       rb-2011l|\
+       rb-2011il|\
+       rb-2011ils|\
+       rb-2011uas|\
+       rb-2011uas-2hnd|\
+       rb-2011uias|\
+       rb-2011uias-2hnd|\
+       rb-2011uias-2hnd-r2|\
+       rb-sxt2n|\
+       rb-sxt5n)
+               nand_do_platform_check routerboard $1
+               return $?
+               ;;
+       c-60|\
+       hiveap-121|\
+       nbg6716|\
+       r6100|\
+       rambutan|\
+       wi2a-ac200i|\
+       wndr3700v4|\
+       wndr4300)
+               nand_do_platform_check $board $1
+               return $?
+               ;;
+       cpe210|\
+       cpe510|\
+       eap120|\
+       wbs210|\
+       wbs510)
+               tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_get_model_string)" '' && return 0
+               return 1
+               ;;
+       cpe210-v2|\
+       cpe210-v3)
+               tplink_pharos_check_image "$1" "01000000" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
+               return 1
+               ;;
+       cpe510-v2)
+               tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
+               return 1
+               ;;
+       a40|\
+       a60|\
+       mr1750|\
+       mr1750v2|\
+       mr600|\
+       mr600v2|\
+       mr900|\
+       mr900v2|\
+       om2p|\
+       om2p-hs|\
+       om2p-hsv2|\
+       om2p-hsv3|\
+       om2p-hsv4|\
+       om2p-lc|\
+       om2pv2|\
+       om2pv4|\
+       om5p|\
+       om5p-ac|\
+       om5p-acv2|\
+       om5p-an)
+               platform_check_image_openmesh "$magic_long" "$1" && return 0
+               return 1
+               ;;
+       mr18|\
+       z1)
+               merakinand_do_platform_check $board $1
+               return $?
+               ;;
+       dir-869-a1|\
+       mynet-n600|\
+       mynet-n750|\
+       qihoo-c301)
+               [ "$magic_long" != "5ea3a417" ] && {
+                       echo "Invalid image, bad magic: $magic_long"
+                       return 1
+               }
+
+               local typemagic=$(seama_get_type_magic "$1")
+               [ "$typemagic" != "6669726d" ] && {
+                       echo "Invalid image, bad type: $typemagic"
+                       return 1
+               }
+
+               return 0
+               ;;
+       e2100l|\
+       mynet-rext|\
+       wrt160nl)
+               cybertan_check_image "$1" && return 0
+               return 1
+               ;;
+       nbg6616|\
+       uap-pro|\
+       unifi-outdoor-plus)
+               [ "$magic_long" != "19852003" ] && {
+                       echo "Invalid image type."
+                       return 1
+               }
+
+               return 0
+               ;;
+       tube2h)
+               alfa_check_image "$1" && return 0
+               return 1
+               ;;
+       wndr3700|\
+       wnr1000-v2|\
+       wnr2000-v3|\
+       wnr612-v2|\
+       wpn824n)
+               local hw_magic
+
+               hw_magic="$(ar71xx_get_mtd_part_magic firmware)"
+               [ "$magic_long" != "$hw_magic" ] && {
+                       echo "Invalid image, hardware ID mismatch, hw:$hw_magic image:$magic_long."
+                       return 1
+               }
+
+               return 0
+               ;;
+       wnr2000-v4)
+               [ "$magic_long" != "32303034" ] && {
+                       echo "Invalid image type."
+                       return 1
+               }
+
+               return 0
+               ;;
+       wnr2200)
+               [ "$magic_long" != "32323030" ] && {
+                       echo "Invalid image type."
+                       return 1
+               }
+
+               return 0
+               ;;
+       dap-2695-a1)
+               local magic=$(wrgg_get_image_magic "$1")
+               [ "$magic" != "21030820" ] && {
+                       echo "Invalid image, bad type: $magic"
+                       return 1
+               }
+
+               return 0;
+               ;;
+       # these boards use metadata images
+       fritz300e|\
+       fritz4020|\
+       fritz450e|\
+       koala|\
+       rb-750-r2|\
+       rb-750p-pbr2|\
+       rb-750up-r2|\
+       rb-911-2hn|\
+       rb-911-5hn|\
+       rb-931-2nd|\
+       rb-941-2nd|\
+       rb-951ui-2nd|\
+       rb-952ui-5ac2nd|\
+       rb-962uigs-5hact2hnt|\
+       rb-lhg-5nd|\
+       rb-map-2nd|\
+       rb-mapl-2nd|\
+       rb-sxt-2nd-r3|\
+       rb-wap-2nd|\
+       rb-wapg-5hact2hnd|\
+       rb-wapr-2nd)
+               return 0
+               ;;
+       esac
+
+       echo "Sysupgrade is not yet supported on $board."
+       return 1
+}
+
+platform_do_upgrade_mikrotik_rb() {
+       CI_KERNPART=none
+       local fw_mtd=$(find_mtd_part kernel)
+       fw_mtd="${fw_mtd/block/}"
+       [ -n "$fw_mtd" ] || return
+
+       local board_dir=$(tar tf "$1" | grep -m 1 '^sysupgrade-.*/$')
+       board_dir=${board_dir%/}
+       [ -n "$board_dir" ] || return
+
+       mtd erase kernel
+       tar xf "$1" ${board_dir}/kernel -O | nandwrite -o "$fw_mtd" -
+
+       nand_do_upgrade "$1"
+}
+
+platform_do_upgrade_nokia() {
+       case "$(fw_printenv -n dualPartition)" in
+               imgA)
+                       fw_setenv dualPartition imgB
+                       fw_setenv ActImg NokiaImageB
+               ;;
+               imgB)
+                       fw_setenv dualPartition imgA
+                       fw_setenv ActImg NokiaImageA
+               ;;
+       esac
+       ubiblock -r /dev/ubiblock0_0 2>/dev/null >/dev/null
+       rm -f /dev/ubiblock0_0
+       ubidetach -d 0 2>/dev/null >/dev/null
+       CI_UBIPART=ubi_alt
+       CI_KERNPART=kernel_alt
+
+       nand_do_upgrade "$1"
+}
+
+platform_do_upgrade() {
+       local board=$(board_name)
+
+       case "$board" in
+       rb-750-r2|\
+       rb-750p-pbr2|\
+       rb-750up-r2|\
+       rb-911-2hn|\
+       rb-911-5hn|\
+       rb-931-2nd|\
+       rb-941-2nd|\
+       rb-951ui-2nd|\
+       rb-952ui-5ac2nd|\
+       rb-962uigs-5hact2hnt|\
+       rb-lhg-5nd|\
+       rb-map-2nd|\
+       rb-mapl-2nd|\
+       rb-sxt-2nd-r3|\
+       rb-wap-2nd|\
+       rb-wapg-5hact2hnd|\
+       rb-wapr-2nd)
+               # erase firmware if booted from initramfs
+               [ -z "$(rootfs_type)" ] && mtd erase firmware
+               ;;
+       esac
+
+       case "$board" in
+       all0258n)
+               platform_do_upgrade_allnet "0x9f050000" "$1"
+               ;;
+       all0305|\
+       eap7660d|\
+       ja76pf|\
+       ja76pf2|\
+       jwap003|\
+       ls-sr71|\
+       pb42|\
+       pb44|\
+       routerstation|\
+       routerstation-pro)
+               platform_do_upgrade_combined "$1"
+               ;;
+       all0315n)
+               platform_do_upgrade_allnet "0x9f080000" "$1"
+               ;;
+       cap4200ag|\
+       eap300v2|\
+       ens202ext)
+               platform_do_upgrade_allnet "0xbf0a0000" "$1"
+               ;;
+       dir-825-b1|\
+       tew-673gru)
+               platform_do_upgrade_dir825b "$1"
+               ;;
+       a40|\
+       a60|\
+       mr1750|\
+       mr1750v2|\
+       mr600|\
+       mr600v2|\
+       mr900|\
+       mr900v2|\
+       om2p|\
+       om2p-hs|\
+       om2p-hsv2|\
+       om2p-hsv3|\
+       om2p-hsv4|\
+       om2p-lc|\
+       om2pv2|\
+       om2pv4|\
+       om5p|\
+       om5p-ac|\
+       om5p-acv2|\
+       om5p-an)
+               platform_do_upgrade_openmesh "$1"
+               ;;
+       c-60|\
+       hiveap-121|\
+       nbg6716|\
+       r6100|\
+       rambutan|\
+       wndr3700v4|\
+       wndr4300)
+               nand_do_upgrade "$1"
+               ;;
+       mr18|\
+       z1)
+               merakinand_do_upgrade "$1"
+               ;;
+       rb-411|\
+       rb-411u|\
+       rb-433|\
+       rb-433u|\
+       rb-435g|\
+       rb-450|\
+       rb-450g|\
+       rb-493|\
+       rb-493g|\
+       rb-750|\
+       rb-750gl|\
+       rb-751|\
+       rb-751g|\
+       rb-911g-2hpnd|\
+       rb-911g-5hpacd|\
+       rb-911g-5hpnd|\
+       rb-912uag-2hpnd|\
+       rb-912uag-5hpnd|\
+       rb-921gs-5hpacd-r2|\
+       rb-922uags-5hpacd|\
+       rb-951g-2hnd|\
+       rb-951ui-2hnd|\
+       rb-2011il|\
+       rb-2011ils|\
+       rb-2011l|\
+       rb-2011uas|\
+       rb-2011uas-2hnd|\
+       rb-2011uias|\
+       rb-2011uias-2hnd|\
+       rb-2011uias-2hnd-r2|\
+       rb-sxt2n|\
+       rb-sxt5n)
+               platform_do_upgrade_mikrotik_rb "$1"
+               ;;
+       uap-pro|\
+       unifi-outdoor-plus)
+               MTD_CONFIG_ARGS="-s 0x180000"
+               default_do_upgrade "$1"
+               ;;
+       wi2a-ac200i)
+               platform_do_upgrade_nokia "$1"
+               ;;
+       wp543|\
+       wpe72)
+               platform_do_upgrade_compex "$1"
+               ;;
+       *)
+               default_do_upgrade "$1"
+               ;;
+       esac
+}
diff --git a/target/linux/ar71xx/config-4.14 b/target/linux/ar71xx/config-4.14
new file mode 100644 (file)
index 0000000..4f3703c
--- /dev/null
@@ -0,0 +1,488 @@
+CONFIG_AG71XX=y
+CONFIG_AG71XX_AR8216_SUPPORT=y
+# CONFIG_AG71XX_DEBUG is not set
+# CONFIG_AG71XX_DEBUG_FS is not set
+CONFIG_AR8216_PHY=y
+CONFIG_AR8216_PHY_LEDS=y
+CONFIG_ARCH_BINFMT_ELF_STATE=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set
+CONFIG_ARCH_HAS_RESET_CONTROLLER=y
+# CONFIG_ARCH_HAS_SG_CHAIN is not set
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_AT803X_PHY=y
+CONFIG_ATH79=y
+# CONFIG_ATH79_DEV_AP9X_PCI is not set
+# CONFIG_ATH79_DEV_DSA is not set
+# CONFIG_ATH79_DEV_ETH is not set
+# CONFIG_ATH79_DEV_GPIO_BUTTONS is not set
+# CONFIG_ATH79_DEV_LEDS_GPIO is not set
+# CONFIG_ATH79_DEV_M25P80 is not set
+# CONFIG_ATH79_DEV_SPI is not set
+# CONFIG_ATH79_DEV_USB is not set
+# CONFIG_ATH79_MACH_A60 is not set
+# CONFIG_ATH79_MACH_ALFA_AP120C is not set
+# CONFIG_ATH79_MACH_ALFA_AP96 is not set
+# CONFIG_ATH79_MACH_ALFA_NX is not set
+# CONFIG_ATH79_MACH_ALL0258N is not set
+# CONFIG_ATH79_MACH_ALL0315N is not set
+# CONFIG_ATH79_MACH_ANTMINER_S1 is not set
+# CONFIG_ATH79_MACH_ANTMINER_S3 is not set
+# CONFIG_ATH79_MACH_ANTROUTER_R1 is not set
+# CONFIG_ATH79_MACH_AP121 is not set
+# CONFIG_ATH79_MACH_AP121F is not set
+# CONFIG_ATH79_MACH_AP132 is not set
+# CONFIG_ATH79_MACH_AP136 is not set
+# CONFIG_ATH79_MACH_AP143 is not set
+# CONFIG_ATH79_MACH_AP147 is not set
+# CONFIG_ATH79_MACH_AP152 is not set
+# CONFIG_ATH79_MACH_AP531B0 is not set
+# CONFIG_ATH79_MACH_AP81 is not set
+# CONFIG_ATH79_MACH_AP83 is not set
+# CONFIG_ATH79_MACH_AP90Q is not set
+# CONFIG_ATH79_MACH_AP91_5G is not set
+# CONFIG_ATH79_MACH_AP96 is not set
+# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set
+# CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set
+# CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set
+# CONFIG_ATH79_MACH_ARCHER_C59_V2 is not set
+# CONFIG_ATH79_MACH_ARCHER_C60_V1 is not set
+# CONFIG_ATH79_MACH_ARCHER_C60_V2 is not set
+# CONFIG_ATH79_MACH_ARCHER_C7 is not set
+# CONFIG_ATH79_MACH_ARDUINO_YUN is not set
+# CONFIG_ATH79_MACH_AW_NR580 is not set
+# CONFIG_ATH79_MACH_BHR_4GRV2 is not set
+# CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set
+# CONFIG_ATH79_MACH_BSB is not set
+# CONFIG_ATH79_MACH_C55 is not set
+# CONFIG_ATH79_MACH_C60 is not set
+# CONFIG_ATH79_MACH_CAP324 is not set
+# CONFIG_ATH79_MACH_CAP4200AG is not set
+# CONFIG_ATH79_MACH_CARAMBOLA2 is not set
+# CONFIG_ATH79_MACH_CF_E316N_V2 is not set
+# CONFIG_ATH79_MACH_CF_E320N_V2 is not set
+# CONFIG_ATH79_MACH_CF_E355AC is not set
+# CONFIG_ATH79_MACH_CF_E375AC is not set
+# CONFIG_ATH79_MACH_CF_E380AC_V1 is not set
+# CONFIG_ATH79_MACH_CF_E380AC_V2 is not set
+# CONFIG_ATH79_MACH_CF_E520N is not set
+# CONFIG_ATH79_MACH_CF_E530N is not set
+# CONFIG_ATH79_MACH_CPE505N is not set
+# CONFIG_ATH79_MACH_CPE510 is not set
+# CONFIG_ATH79_MACH_CPE830 is not set
+# CONFIG_ATH79_MACH_CPE870 is not set
+# CONFIG_ATH79_MACH_CR3000 is not set
+# CONFIG_ATH79_MACH_CR5000 is not set
+# CONFIG_ATH79_MACH_DAP_1330_A1 is not set
+# CONFIG_ATH79_MACH_DAP_2695_A1 is not set
+# CONFIG_ATH79_MACH_DB120 is not set
+# CONFIG_ATH79_MACH_DGL_5500_A1 is not set
+# CONFIG_ATH79_MACH_DHP_1565_A1 is not set
+# CONFIG_ATH79_MACH_DIR_505_A1 is not set
+# CONFIG_ATH79_MACH_DIR_600_A1 is not set
+# CONFIG_ATH79_MACH_DIR_615_C1 is not set
+# CONFIG_ATH79_MACH_DIR_615_I1 is not set
+# CONFIG_ATH79_MACH_DIR_825_B1 is not set
+# CONFIG_ATH79_MACH_DIR_825_C1 is not set
+# CONFIG_ATH79_MACH_DIR_869_A1 is not set
+# CONFIG_ATH79_MACH_DLAN_HOTSPOT is not set
+# CONFIG_ATH79_MACH_DLAN_PRO_1200_AC is not set
+# CONFIG_ATH79_MACH_DLAN_PRO_500_WP is not set
+# CONFIG_ATH79_MACH_DOMYWIFI_DW33D is not set
+# CONFIG_ATH79_MACH_DR342 is not set
+# CONFIG_ATH79_MACH_DR344 is not set
+# CONFIG_ATH79_MACH_DR531 is not set
+# CONFIG_ATH79_MACH_DRAGINO2 is not set
+# CONFIG_ATH79_MACH_E1700AC_V2 is not set
+# CONFIG_ATH79_MACH_E2100L is not set
+# CONFIG_ATH79_MACH_E558_V2 is not set
+# CONFIG_ATH79_MACH_E600G_V2 is not set
+# CONFIG_ATH79_MACH_E750A_V4 is not set
+# CONFIG_ATH79_MACH_E750G_V8 is not set
+# CONFIG_ATH79_MACH_EAP120 is not set
+# CONFIG_ATH79_MACH_EAP300V2 is not set
+# CONFIG_ATH79_MACH_EAP7660D is not set
+# CONFIG_ATH79_MACH_EL_M150 is not set
+# CONFIG_ATH79_MACH_EL_MINI is not set
+# CONFIG_ATH79_MACH_ENS202EXT is not set
+# CONFIG_ATH79_MACH_EPG5000 is not set
+# CONFIG_ATH79_MACH_ESR1750 is not set
+# CONFIG_ATH79_MACH_ESR900 is not set
+# CONFIG_ATH79_MACH_EW_BALIN is not set
+# CONFIG_ATH79_MACH_EW_DORIN is not set
+# CONFIG_ATH79_MACH_F9K1115V2 is not set
+# CONFIG_ATH79_MACH_FRITZ300E is not set
+# CONFIG_ATH79_MACH_FRITZ4020 is not set
+# CONFIG_ATH79_MACH_FRITZ450E is not set
+# CONFIG_ATH79_MACH_GL_AR150 is not set
+# CONFIG_ATH79_MACH_GL_AR300 is not set
+# CONFIG_ATH79_MACH_GL_AR300M is not set
+# CONFIG_ATH79_MACH_GL_AR750 is not set
+# CONFIG_ATH79_MACH_GL_AR750S is not set
+# CONFIG_ATH79_MACH_GL_DOMINO is not set
+# CONFIG_ATH79_MACH_GL_INET is not set
+# CONFIG_ATH79_MACH_GL_MIFI is not set
+# CONFIG_ATH79_MACH_GL_USB150 is not set
+# CONFIG_ATH79_MACH_GS_MINIBOX_V32 is not set
+# CONFIG_ATH79_MACH_GS_OOLITE_V1 is not set
+# CONFIG_ATH79_MACH_GS_OOLITE_V5_2 is not set
+# CONFIG_ATH79_MACH_HIVEAP_121 is not set
+# CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set
+# CONFIG_ATH79_MACH_HORNET_UB is not set
+# CONFIG_ATH79_MACH_JA76PF is not set
+# CONFIG_ATH79_MACH_JWAP003 is not set
+# CONFIG_ATH79_MACH_JWAP230 is not set
+# CONFIG_ATH79_MACH_KOALA is not set
+# CONFIG_ATH79_MACH_LAN_TURTLE is not set
+# CONFIG_ATH79_MACH_LIMA is not set
+# CONFIG_ATH79_MACH_MC_MAC1200R is not set
+# CONFIG_ATH79_MACH_MR12 is not set
+# CONFIG_ATH79_MACH_MR16 is not set
+# CONFIG_ATH79_MACH_MR1750 is not set
+# CONFIG_ATH79_MACH_MR18 is not set
+# CONFIG_ATH79_MACH_MR600 is not set
+# CONFIG_ATH79_MACH_MR900 is not set
+# CONFIG_ATH79_MACH_MYNET_N600 is not set
+# CONFIG_ATH79_MACH_MYNET_N750 is not set
+# CONFIG_ATH79_MACH_MYNET_REXT is not set
+# CONFIG_ATH79_MACH_MZK_W04NU is not set
+# CONFIG_ATH79_MACH_MZK_W300NH is not set
+# CONFIG_ATH79_MACH_N5Q is not set
+# CONFIG_ATH79_MACH_NBG460N is not set
+# CONFIG_ATH79_MACH_NBG6716 is not set
+# CONFIG_ATH79_MACH_OM2P is not set
+# CONFIG_ATH79_MACH_OM5P is not set
+# CONFIG_ATH79_MACH_OM5P_AC is not set
+# CONFIG_ATH79_MACH_OM5P_ACv2 is not set
+# CONFIG_ATH79_MACH_OMY_G1 is not set
+# CONFIG_ATH79_MACH_OMY_X1 is not set
+# CONFIG_ATH79_MACH_ONION_OMEGA is not set
+# CONFIG_ATH79_MACH_PB42 is not set
+# CONFIG_ATH79_MACH_PB44 is not set
+# CONFIG_ATH79_MACH_PQI_AIR_PEN is not set
+# CONFIG_ATH79_MACH_QIHOO_C301 is not set
+# CONFIG_ATH79_MACH_R36A is not set
+# CONFIG_ATH79_MACH_R602N is not set
+# CONFIG_ATH79_MACH_R6100 is not set
+# CONFIG_ATH79_MACH_RAMBUTAN is not set
+# CONFIG_ATH79_MACH_RB2011 is not set
+# CONFIG_ATH79_MACH_RB4XX is not set
+# CONFIG_ATH79_MACH_RB750 is not set
+# CONFIG_ATH79_MACH_RB91X is not set
+# CONFIG_ATH79_MACH_RB922 is not set
+# CONFIG_ATH79_MACH_RB95X is not set
+# CONFIG_ATH79_MACH_RBSPI is not set
+# CONFIG_ATH79_MACH_RBSXTLITE is not set
+# CONFIG_ATH79_MACH_RE355 is not set
+# CONFIG_ATH79_MACH_RE450 is not set
+# CONFIG_ATH79_MACH_RME_EG200 is not set
+# CONFIG_ATH79_MACH_RUT9XX is not set
+# CONFIG_ATH79_MACH_RW2458N is not set
+# CONFIG_ATH79_MACH_SC1750 is not set
+# CONFIG_ATH79_MACH_SC300M is not set
+# CONFIG_ATH79_MACH_SC450 is not set
+# CONFIG_ATH79_MACH_SMART_300 is not set
+# CONFIG_ATH79_MACH_SOM9331 is not set
+# CONFIG_ATH79_MACH_SR3200 is not set
+# CONFIG_ATH79_MACH_T830 is not set
+# CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE is not set
+# CONFIG_ATH79_MACH_TEW_632BRP is not set
+# CONFIG_ATH79_MACH_TEW_673GRU is not set
+# CONFIG_ATH79_MACH_TEW_712BR is not set
+# CONFIG_ATH79_MACH_TEW_732BR is not set
+# CONFIG_ATH79_MACH_TEW_823DRU is not set
+# CONFIG_ATH79_MACH_TL_MR11U is not set
+# CONFIG_ATH79_MACH_TL_MR13U is not set
+# CONFIG_ATH79_MACH_TL_MR3020 is not set
+# CONFIG_ATH79_MACH_TL_MR3X20 is not set
+# CONFIG_ATH79_MACH_TL_MR6400 is not set
+# CONFIG_ATH79_MACH_TL_WA701ND_V2 is not set
+# CONFIG_ATH79_MACH_TL_WA7210N_V2 is not set
+# CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set
+# CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set
+# CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set
+# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set
+# CONFIG_ATH79_MACH_TL_WA901ND is not set
+# CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set
+# CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set
+# CONFIG_ATH79_MACH_TL_WAX50RE is not set
+# CONFIG_ATH79_MACH_TL_WDR3320_V2 is not set
+# CONFIG_ATH79_MACH_TL_WDR3500 is not set
+# CONFIG_ATH79_MACH_TL_WDR4300 is not set
+# CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set
+# CONFIG_ATH79_MACH_TL_WPA8630 is not set
+# CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set
+# CONFIG_ATH79_MACH_TL_WR1043ND is not set
+# CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set
+# CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set
+# CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set
+# CONFIG_ATH79_MACH_TL_WR2543N is not set
+# CONFIG_ATH79_MACH_TL_WR703N is not set
+# CONFIG_ATH79_MACH_TL_WR720N_V3 is not set
+# CONFIG_ATH79_MACH_TL_WR741ND is not set
+# CONFIG_ATH79_MACH_TL_WR741ND_V4 is not set
+# CONFIG_ATH79_MACH_TL_WR802N_V1 is not set
+# CONFIG_ATH79_MACH_TL_WR802N_V2 is not set
+# CONFIG_ATH79_MACH_TL_WR810N is not set
+# CONFIG_ATH79_MACH_TL_WR810N_V2 is not set
+# CONFIG_ATH79_MACH_TL_WR840N_V2 is not set
+# CONFIG_ATH79_MACH_TL_WR841N_V1 is not set
+# CONFIG_ATH79_MACH_TL_WR841N_V8 is not set
+# CONFIG_ATH79_MACH_TL_WR841N_V9 is not set
+# CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set
+# CONFIG_ATH79_MACH_TL_WR940N_V4 is not set
+# CONFIG_ATH79_MACH_TL_WR941ND is not set
+# CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set
+# CONFIG_ATH79_MACH_TL_WR942N_V1 is not set
+# CONFIG_ATH79_MACH_TS_D084 is not set
+# CONFIG_ATH79_MACH_TUBE2H is not set
+# CONFIG_ATH79_MACH_UBNT is not set
+# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set
+# CONFIG_ATH79_MACH_UBNT_XM is not set
+# CONFIG_ATH79_MACH_WAM250 is not set
+# CONFIG_ATH79_MACH_WEIO is not set
+# CONFIG_ATH79_MACH_WHR_HP_G300N is not set
+# CONFIG_ATH79_MACH_WI2A_AC200I is not set
+# CONFIG_ATH79_MACH_WIFI_PINEAPPLE_NANO is not set
+# CONFIG_ATH79_MACH_WLAE_AG300N is not set
+# CONFIG_ATH79_MACH_WLR8100 is not set
+# CONFIG_ATH79_MACH_WNDAP360 is not set
+# CONFIG_ATH79_MACH_WNDR3700 is not set
+# CONFIG_ATH79_MACH_WNDR4300 is not set
+# CONFIG_ATH79_MACH_WNR2000 is not set
+# CONFIG_ATH79_MACH_WNR2000_V3 is not set
+# CONFIG_ATH79_MACH_WNR2000_V4 is not set
+# CONFIG_ATH79_MACH_WNR2200 is not set
+# CONFIG_ATH79_MACH_WP543 is not set
+# CONFIG_ATH79_MACH_WPE72 is not set
+# CONFIG_ATH79_MACH_WPJ342 is not set
+# CONFIG_ATH79_MACH_WPJ344 is not set
+# CONFIG_ATH79_MACH_WPJ531 is not set
+# CONFIG_ATH79_MACH_WPJ558 is not set
+# CONFIG_ATH79_MACH_WPJ563 is not set
+# CONFIG_ATH79_MACH_WRT160NL is not set
+# CONFIG_ATH79_MACH_WRT400N is not set
+# CONFIG_ATH79_MACH_WRTNODE2Q is not set
+# CONFIG_ATH79_MACH_WZR_450HP2 is not set
+# CONFIG_ATH79_MACH_WZR_HP_AG300H is not set
+# CONFIG_ATH79_MACH_WZR_HP_G300NH is not set
+# CONFIG_ATH79_MACH_WZR_HP_G300NH2 is not set
+# CONFIG_ATH79_MACH_WZR_HP_G450H is not set
+# CONFIG_ATH79_MACH_XD3200 is not set
+# CONFIG_ATH79_MACH_Z1 is not set
+# CONFIG_ATH79_MACH_ZBT_WE1526 is not set
+# CONFIG_ATH79_MACH_ZCN_1523H is not set
+# CONFIG_ATH79_NVRAM is not set
+# CONFIG_ATH79_PCI_ATH9K_FIXUP is not set
+# CONFIG_ATH79_ROUTERBOOT is not set
+CONFIG_ATH79_WDT=y
+CONFIG_CEVT_R4K=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE="rootfstype=squashfs noinitrd"
+CONFIG_CMDLINE_BOOL=y
+# CONFIG_CMDLINE_OVERRIDE is not set
+# CONFIG_COMMON_CLK_BOSTON is not set
+CONFIG_COMMON_CLK=y
+CONFIG_CPU_BIG_ENDIAN=y
+CONFIG_CPU_GENERIC_DUMP_TLB=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_RIXI=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPS32_R2=y
+CONFIG_CPU_MIPSR2=y
+CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
+CONFIG_CPU_R4K_CACHE_TLB=y
+CONFIG_CPU_R4K_FPU=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CPU_SUPPORTS_MSA=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_CSRC_R4K=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_ETHERNET_PACKET_MANGLE=y
+CONFIG_FIXED_PHY=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_CHIP=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIOLIB_IRQCHIP=y
+CONFIG_GPIO_74X164=y
+CONFIG_GPIO_ATH79=y
+CONFIG_GPIO_GENERIC=y
+# CONFIG_GPIO_LATCH is not set
+CONFIG_GPIO_NXP_74HC153=y
+CONFIG_GPIO_PCF857X=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+# CONFIG_HAVE_ARCH_BITREVERSE is not set
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_CBPF_JIT=y
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_KVM=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HZ_PERIODIC=y
+CONFIG_I2C=y
+CONFIG_I2C_ALGOBIT=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_GPIO=y
+CONFIG_IMAGE_CMDLINE_HACK=y
+CONFIG_INITRAMFS_ROOT_GID=0
+CONFIG_INITRAMFS_ROOT_UID=0
+CONFIG_INITRAMFS_SOURCE="../../root"
+CONFIG_INTEL_XWAY_PHY=y
+CONFIG_IP17XX_PHY=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_MIPS_CPU=y
+CONFIG_IRQ_WORK=y
+CONFIG_LEDS_GPIO=y
+CONFIG_MARVELL_PHY=y
+CONFIG_MDIO_BITBANG=y
+CONFIG_MDIO_BOARDINFO=y
+CONFIG_MDIO_GPIO=y
+CONFIG_MICREL_PHY=y
+CONFIG_MIPS=y
+CONFIG_MIPS_ASID_BITS=8
+CONFIG_MIPS_ASID_SHIFT=0
+CONFIG_MIPS_CLOCK_VSYSCALL=y
+# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
+CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_MIPS_MACHINE=y
+CONFIG_MIPS_SPRAM=y
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_CFI_I2 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CYBERTAN_PARTS=y
+CONFIG_MTD_M25P80=y
+# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
+CONFIG_MTD_MYLOADER_PARTS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-2
+CONFIG_MTD_REDBOOT_PARTS=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_EVA_FW=y
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_LZMA_FW=y
+CONFIG_MTD_SPLIT_MINOR_FW=y
+CONFIG_MTD_SPLIT_SEAMA_FW=y
+CONFIG_MTD_SPLIT_TPLINK_FW=y
+CONFIG_MTD_SPLIT_UIMAGE_FW=y
+CONFIG_MTD_SPLIT_WRGG_FW=y
+CONFIG_MTD_TPLINK_PARTS=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NET_DSA=y
+CONFIG_NET_DSA_MV88E6060=y
+CONFIG_NET_DSA_MV88E6063=y
+CONFIG_NET_DSA_TAG_TRAILER=y
+CONFIG_NET_SWITCHDEV=y
+CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+# CONFIG_NO_IOPORT_MAP is not set
+# CONFIG_OF is not set
+# CONFIG_PCI_AR724X is not set
+CONFIG_PCI_DRIVERS_LEGACY=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_PHYLIB=y
+CONFIG_RATIONAL=y
+# CONFIG_RCU_STALL_COMMON is not set
+CONFIG_RTL8306_PHY=y
+CONFIG_RTL8366RB_PHY=y
+CONFIG_RTL8366S_PHY=y
+CONFIG_RTL8366_SMI=y
+CONFIG_RTL8367_PHY=y
+# CONFIG_SCHED_INFO is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SERIAL_8250_FSL is not set
+CONFIG_SERIAL_8250_NR_UARTS=1
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
+# CONFIG_SOC_AR71XX is not set
+# CONFIG_SOC_AR724X is not set
+# CONFIG_SOC_AR913X is not set
+# CONFIG_SOC_AR933X is not set
+# CONFIG_SOC_AR934X is not set
+# CONFIG_SOC_QCA953X is not set
+# CONFIG_SOC_QCA955X is not set
+# CONFIG_SOC_QCA956X is not set
+CONFIG_SPI=y
+CONFIG_SPI_AP83=y
+CONFIG_SPI_ATH79=y
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_GPIO=y
+CONFIG_SPI_MASTER=y
+# CONFIG_SPI_RB4XX is not set
+# CONFIG_SPI_VSC7385 is not set
+CONFIG_SRCU=y
+CONFIG_SWCONFIG=y
+CONFIG_SWCONFIG_LEDS=y
+CONFIG_SWPHY=y
+CONFIG_SYSCTL_EXCEPTION_TRACE=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_MIPS16=y
+CONFIG_SYS_SUPPORTS_ZBOOT=y
+CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_USB_SUPPORT=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
new file mode 100644 (file)
index 0000000..de59b00
--- /dev/null
@@ -0,0 +1,2466 @@
+config ATH79_MACH_A60
+       bool "OpenMesh A40/A60 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_USB
+
+config ATH79_MACH_WI2A_AC200I
+       bool "Nokia WI2A-AC200i support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_NFC
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_USB
+
+config ATH79_MACH_ALFA_AP120C
+       bool "ALFA Network AP120C board support"
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_AP121F
+       bool "ALFA Network AP121F support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ALFA_AP96
+       bool "ALFA Network AP96 board support"
+       select SOC_AR71XX
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_HORNET_UB
+       bool "ALFA Network Hornet-UB board support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ALFA_NX
+       bool "ALFA Network N2/N5 board support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_TUBE2H
+       bool "ALFA Network Tube2H board support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_SC1750
+       bool "Abicom SC1750 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_SC300M
+       bool "Abicom SC300M board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_SC450
+       bool "Abicom SC450 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ALL0258N
+       bool "Allnet ALL0258N support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_ALL0315N
+       bool "Allnet ALL0315N support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_ANTMINER_S1
+       bool "Bitmain Antminer S1 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ANTMINER_S3
+       bool "Bitmain Antminer S3 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ANTROUTER_R1
+       bool "Bitmain Antrouter R1 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ARDUINO_YUN
+       bool "Arduino Yun"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_AP132
+       bool "Atheros AP132 reference board"
+       select SOC_QCA955X
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_AP143
+       bool "Atheros AP143 reference board"
+       select SOC_QCA953X
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_SPI
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_ETH
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_AP147
+       bool "Atheros AP147 reference board"
+       select SOC_QCA953X
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_AP9X_PCI if PCI
+
+config ATH79_MACH_AP152
+       bool "Atheros AP152 reference board"
+       select SOC_QCA956X
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_AP9X_PCI if PCI
+
+config ATH79_MACH_AP531B0
+       bool "Rockeetech AP531B0 support"
+       select SOC_QCA953X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_SPI
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_AP83
+       bool "Atheros AP83 board support"
+       select SOC_AR913X
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_AP90Q
+       bool "YunCore AP80Q/AP90Q support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_AP91_5G
+       bool "ALFA Network AP91-5G support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_AP96
+       bool "Atheros AP96 board support"
+       select SOC_AR71XX
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_PB42
+       bool "Atheros PB42 board support"
+       select SOC_AR71XX
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_C55
+       bool "AirTight Networks C-55 support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_C60
+       bool "AirTight Networks C-60 support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_NFC
+       select ATH79_DEV_USB
+
+config ATH79_MACH_AW_NR580
+       bool "AzureWave AW-NR580 board support"
+       select SOC_AR71XX
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_F9K1115V2
+       bool "Belkin AC1750DB board support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_EPG5000
+       bool "EnGenius EPG5000 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_ESR1750
+       bool "EnGenius ESR1750 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_PQI_AIR_PEN
+       bool "PQI Air Pen"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_SOM9331
+       bool "SOM9331 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_SR3200
+       bool "YunCore SR3200 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_BHR_4GRV2
+       bool "Buffalo BHR-4GRV2 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_WHR_HP_G300N
+       bool "Buffalo WHR-HP-G300N board support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_WLAE_AG300N
+       bool "Buffalo WLAE-AG300N board support"
+       select SOC_AR71XX
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_WLR8100
+       bool "Sitecom WLR-8100 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WZR_HP_AG300H
+       bool "Buffalo WZR-HP-AG300H board support"
+       select SOC_AR71XX
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_WZR_HP_G300NH
+       bool "Buffalo WZR-HP-G300NH board support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select RTL8366_SMI
+
+config ATH79_MACH_WZR_HP_G300NH2
+       bool "Buffalo WZR-HP-G300NH2 board support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_WZR_HP_G450H
+       bool "Buffalo WZR-HP-G450H board support"
+       select SOC_AR724X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_WZR_450HP2
+       bool "Buffalo WZR-450HP2 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WP543
+       bool "Compex WP543/WPJ543 board support"
+       select SOC_AR71XX
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select MYLOADER
+
+config ATH79_MACH_WPE72
+       bool "Compex WPE72/WPE72NX board support"
+       select SOC_AR724X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select MYLOADER
+
+config ATH79_MACH_WPJ342
+       bool "Compex WPJ342 board support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WPJ344
+       bool "Compex WPJ344 board support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WPJ531
+       bool "Compex WPJ531 board support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WPJ558
+       bool "Compex WPJ558 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WPJ563
+       bool "Compex WPJ563 board support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_XD3200
+       bool "YunCore XD3200 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_DGL_5500_A1
+       bool "D-Link DGL-5500 A1 support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_USB
+
+config ATH79_MACH_DHP_1565_A1
+       bool "D-Link DHP-1565 rev. A1 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_DIR_505_A1
+       bool "D-Link DIR-505-A1 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_DIR_600_A1
+       bool "D-Link DIR-600 A1/DIR-615 E1/DIR-615 E4 support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_NVRAM
+
+config ATH79_MACH_DIR_615_C1
+       bool "D-Link DIR-615 rev. C1 support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_DIR_615_I1
+       bool "D-Link DIR-615 rev. I1 support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_DIR_825_B1
+       bool "D-Link DIR-825 rev. B1 board support"
+       select SOC_AR71XX
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_DIR_825_C1
+       bool "D-Link DIR-825 rev. C1/DIR-835 rev. A1 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_DIR_869_A1
+       bool "D-Link DIR-869 rev. A1"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_DLAN_HOTSPOT
+       bool "devolo dLAN Hotspot support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_DLAN_PRO_500_WP
+       bool "devolo dLAN pro 500 Wireless+ support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_SPI
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_USB
+
+config ATH79_MACH_DLAN_PRO_1200_AC
+       bool "devolo dLAN pro 1200+ WiFi ac support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_SPI
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_NFC
+       select ATH79_DEV_USB
+
+config ATH79_MACH_DOMYWIFI_DW33D
+       bool "DomyWifi DW33D support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_NFC
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_USB
+
+config ATH79_MACH_DR342
+       bool "Wallys DR342 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_DR344
+       bool "Wallys DR344 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_DR531
+       bool "Wallys DR531 board support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_DRAGINO2
+       bool "DRAGINO V2 support"
+       select SOC_AR933X
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_ETH
+       select ATH79_DEV_USB
+
+config ATH79_MACH_E1700AC_V2
+       bool "Qxwlan E1700AC v2 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_E2100L
+       bool "Linksys E2100L board support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_E558_V2
+       bool "Qxwlan E558 v2 support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_E600G_V2
+       bool "Qxwlan E600G/E600GAC v2 support"
+       select SOC_QCA953X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_E750A_V4
+       bool "Qxwlan E750A v4 support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_E750G_V8
+       bool "Qxwlan E750G v8 support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ESR900
+       bool "EnGenius ESR900 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_EW_BALIN
+       bool "embedded wireless Balin Platform support"
+       select SOC_AR934X
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_ETH
+       select ATH79_DEV_USB
+       select ATH79_DEV_AP9X_PCI if PCI
+
+config ATH79_MACH_EW_DORIN
+       bool "embedded wireless Dorin Platform support"
+       select SOC_AR933X
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_ETH
+
+config ATH79_MACH_EL_M150
+       bool "EasyLink EL-M150 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_EL_MINI
+       bool "EasyLink EL-MINI support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GL_AR150
+       bool "GL AR150 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GL_AR300
+       bool "GL_AR300 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GL_AR300M
+       bool "GL_AR300M support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GL_AR750
+       bool "GL.iNet GL-AR750 support"
+       select SOC_QCA953X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GL_AR750S
+       bool "GL.iNet GL-AR750S support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GL_DOMINO
+       bool "DOMINO support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GL_MIFI
+       bool "GL MIFI support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GL_INET
+       bool "GL-INET support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GL_USB150
+       bool "GL.iNet GL-USB150 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_EAP120
+       bool "TP-LINK EAP120 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ENS202EXT
+       bool "EnGenius ENS202EXT support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_EAP300V2
+       bool "EnGenius EAP300 v2 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GS_MINIBOX_V32
+       bool "Gainstrong Minibox V3.2 support"
+       select SOC_QCA953X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_SPI
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_ETH
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_GS_OOLITE_V1
+       bool "GainStrong Oolite/Minibox V1.0 support"
+       select SOC_AR933X
+       select ARH79_DEV_ETH
+       select ARH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_GS_OOLITE_V5_2
+       bool "GainStrong Oolite V5.2 support"
+       select SOC_QCA953X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_HIVEAP_121
+       bool "Aerohive HiveAP-121 support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_NFC
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_HIWIFI_HC6361
+       bool "HiWiFi HC6361 board support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_JA76PF
+       bool "jjPlus JA76PF board support"
+       select SOC_AR71XX
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_JWAP003
+       bool "jjPlus JWAP003 board support"
+       select SOC_AR71XX
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_JWAP230
+       bool "jjPlus JWAP230 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_KOALA
+       bool "OCEDO Koala board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_ETH
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WAM250
+       bool "Samsung WAM250 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WIFI_PINEAPPLE_NANO
+       bool "Hak5 WiFi Pineapple NANO support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WRT160NL
+       bool "Linksys WRT160NL board support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_WRT400N
+       bool "Linksys WRT400N board support"
+       select SOC_AR71XX
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_WRTNODE2Q
+       bool "WRTnode2Q board support"
+       select SOC_QCA953X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_R36A
+       bool "ALFA Network R36A support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_R602N
+       bool "P&W R602N support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_R6100
+       bool "NETGEAR R6100 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_NFC
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_MC_MAC1200R
+       bool "MERCURY MAC1200R board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_RB4XX
+       bool "MikroTik RouterBOARD 4xx series support"
+       select SOC_AR71XX
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_USB
+
+config ATH79_MACH_RB750
+       bool "MikroTik RouterBOARD 750 support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_USB
+       select ATH79_ROUTERBOOT
+
+config ATH79_MACH_RB91X
+       bool "MikroTik RouterBOARD 91X support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_SPI
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_USB
+       select ATH79_ROUTERBOOT
+
+config ATH79_MACH_RB922
+       bool "MikroTik RouterBOARD 922 support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_NFC
+       select ATH79_DEV_USB
+       select ATH79_ROUTERBOOT
+       select RLE_DECOMPRESS
+
+config ATH79_MACH_RB95X
+       bool "MikroTik RouterBOARD 95X support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_NFC
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_USB
+       select ATH79_ROUTERBOOT
+
+config ATH79_MACH_RB2011
+       bool "MikroTik RouterBOARD 2011 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_NFC
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_ROUTERBOOT
+
+config ATH79_MACH_RBSPI
+       bool "MikroTik RouterBOARD SPI-NOR support"
+       select SOC_AR934X
+       select SOC_QCA953X
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_ROUTERBOOT
+       help
+         Say 'Y' here if you want your kernel to support the
+         MikroTik ROuterBOARD 911-2Hn (911 Lite2)
+         MikroTik ROuterBOARD 911-5Hn (911 Lite5)
+         MikroTik RouterBOARD mAP
+         MikroTik RouterBOARD mAP lite
+         MikroTik RouterBOARD hAP mini
+         MikroTik RouterBOARD hAP lite
+         MikroTik RouterBOARD hAP
+         MikroTik RouterBOARD hAP ac
+         MikroTik RouterBOARD hAP ac lite
+         MikroTik RouterBOARD hEX PoE lite
+         MikroTik RouterBOARD hEX lite
+         MikroTik RouterBOARD Powerbox
+         MikroTik RouterBOARD LHG 5
+         MikroTik RouterBOARD cAP (EXPERIMENTAL)
+         MikroTik RouterBOARD SXT Lite 2 r3
+         MikroTik RouterBOARD wAP
+         MikroTik RouterBOARD wAP R-2nD
+
+config ATH79_MACH_RBSXTLITE
+       bool "MikroTik RouterBOARD SXT Lite"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_NFC
+       select ATH79_DEV_WMAC
+       select ATH79_ROUTERBOOT
+
+config ATH79_MACH_SMART_300
+       bool "NC-LINK SMART-300 board support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_T830
+       bool "YunCore T830 support"
+       select SOC_QCA953X
+       select ARH79_DEV_ETH
+       select ARH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TELLSTICK_ZNET_LITE
+       bool "TellStick ZNet Lite"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WNDAP360
+       bool "NETGEAR WNDAP360 board support"
+       select SOC_AR71XX
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_WNDR3700
+       bool "NETGEAR WNDR3700 board support"
+       select SOC_AR71XX
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_WNDR4300
+       bool "NETGEAR WNDR3700v4/WNDR4300 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_NFC
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WNR2000
+       bool "NETGEAR WNR2000 board support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_WNR2000_V3
+       bool "NETGEAR WNR2000 V3/WNR612 v2/WNR1000 v2/WPN824N board support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_WNR2200
+       bool "NETGEAR WNR2200 board support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_WNR2000_V4
+       bool "NETGEAR WNR2000 V4"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_OM2P
+       bool "OpenMesh OM2P board support"
+       select SOC_AR724X
+       select SOC_AR933X
+       select SOC_QCA953X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_OM5P
+       bool "OpenMesh OM5P board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_OM5P_AC
+       bool "OpenMesh OM5P-AC board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_OM5P_ACv2
+       bool "OpenMesh OM5P-ACv2 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_OMY_G1
+       bool "OMYlink OMY G1 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_OMY_X1
+       bool "OMYlink OMY X1 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ONION_OMEGA
+       bool "ONION OMEGA support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_MR12
+       bool "Meraki MR12 board support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_MR16
+       bool "Meraki MR16 board support"
+       select SOC_AR71XX
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_MR18
+       bool "Meraki MR18 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_NFC
+       select ATH79_DEV_WMAC
+       select LEDS_NU801
+
+config ATH79_MACH_MR600
+       bool "OpenMesh MR600 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_MZK_W04NU
+       bool "Planex MZK-W04NU board support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_MZK_W300NH
+       bool "Planex MZK-W300NH board support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_RE355
+       bool "TP-LINK RE355 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_RE450
+       bool "TP-LINK RE450 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_RME_EG200
+       bool "eTactica EG200 board supprt"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_RUT9XX
+       bool "Teltonika RUT900 series support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select GPIO_PCA953X
+
+config ATH79_MACH_RW2458N
+       bool "Redwave RW2458N board support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_CAP324
+       bool "PowerCloud Systems CAP324 support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CAP4200AG
+       bool "Senao CAP4200AG support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CR3000
+       bool "PowerCloud Systems CR3000 support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CR5000
+       bool "PowerCloud CR5000 support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_MR1750
+       bool "OpenMesh MR1750 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_MR900
+       bool "OpenMesh MR900 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_EAP7660D
+       bool "Senao EAP7660D support"
+       select SOC_AR71XX
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_BSB
+       bool "Smart Electronics Black Swift board"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ARCHER_C25_V1
+       bool "TP-LINK Archer C25 v1 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ARCHER_C58_V1
+       bool "TP-LINK Archer C58 v1 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ARCHER_C59_V1
+       bool "TP-LINK Archer C59 v1 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ARCHER_C59_V2
+       bool "TP-LINK Archer C59 v2 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ARCHER_C60_V1
+       bool "TP-LINK Archer C60 v1 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ARCHER_C60_V2
+       bool "TP-LINK Archer C60 v2 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ARCHER_C7
+       bool "TP-LINK Archer C5/C7/TL-WDR4900 v2 board support"
+       select SOC_QCA955X
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CPE505N
+       bool "P&W CPE505N support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CPE510
+       bool "TP-LINK CPE510 support"
+       select SOC_AR934X
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CPE830
+       bool "YunCore CPE830 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CPE870
+       bool "YunCore CPE870 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_MR11U
+       bool "TP-LINK TL-MR11U/TL-MR3040 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_MR13U
+       bool "TP-LINK TL-MR13U support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_MR3020
+       bool "TP-LINK TL-MR3020 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_MR3X20
+       bool "TP-LINK TL-MR3220/3420 support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_TL_MR6400
+       bool "TP-LINK TL-MR6400 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WAX50RE
+       bool "TP-LINK TL-WA750/850RE support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WA701ND_V2
+       bool "TP-LINK TL-WA701ND v2 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WA7210N_V2
+       bool "TP-LINK TL-WA7210N v2 support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WA801ND_V3
+       bool "TP-LINK TL-WA801ND v3 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WA830RE_V2
+       bool "TP-LINK TL-WA830RE v2 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WA850RE_V2
+       bool "TP-LINK TL-WA850RE v2 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WA855RE_V1
+       bool "TP-LINK TL-WA855RE V1 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WA901ND
+       bool "TP-LINK TL-WA901ND/TL-WA7510N support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_TL_WA901ND_V2
+       bool "TP-LINK TL-WA901ND v2 support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WA901ND_V4
+       bool "TP-LINK TL-WA901ND v4 support"
+       select SOC_QCA956X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WDR3320_V2
+       bool "TP-LINK TL-WDR3320 v2 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WDR3500
+       bool "TP-LINK TL-WDR3500 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WDR4300
+       bool "TP-LINK TL-WDR3600/4300/4310 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WDR6500_V2
+       bool "TP-LINK TL-WDR6500 v2 board support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR703N
+       bool "TP-LINK TL-WR703N/TL-WR710N/TL-MR10U support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR720N_V3
+       bool "TP-LINK TL-WR720N v3/v4 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR741ND
+       bool "TP-LINK TL-WR741ND support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_TL_WR741ND_V4
+       bool "TP-LINK TL-WR741ND v4/TL-MR3220 v2 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR802N_V1
+       bool "TP-LINK TL-WR802N v1 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_TL_WR802N_V2
+       bool "TP-LINK TL-WR802N v2 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_TL_WR810N
+       bool "TP-LINK TL-WR810N support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR810N_V2
+       bool "TP-LINK TL-WR810N v2 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR840N_V2
+       bool "TP-LINK TL-WR840N v2/v3 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR841N_V1
+       bool "TP-LINK TL-WR841N v1 support"
+       select SOC_AR71XX
+       select ATH79_DEV_DSA
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_TL_WR841N_V8
+       bool "TP-LINK TL-WR841N/ND v8/TL-MR3420 v2 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR841N_V9
+       bool "TP-LINK TL-WR841N/ND v9/TL-WR842N/ND v3/TL-WR740N/ND v6 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR902AC_V1
+       bool "TP-LINK TL-WR902AC v1 support"
+       select SOC_QCA953X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR941ND
+       bool "TP-LINK TL-WR941ND support"
+       select SOC_AR913X
+       select ATH79_DEV_DSA
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR941ND_V6
+       bool "TP-LINK TL-WR941ND v6 support"
+       select SOC_QCA956X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR940N_V4
+       bool "TP-LINK TL-WR940N v4 support"
+       select SOC_QCA956X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR942N_V1
+       bool "TP-LINK TL-WR942N v1 support"
+       select SOC_QCA956X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_TL_WR1041N_V2
+       bool "TP-LINK TL-WR1041N v2 support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR1043N_V5
+       bool "TP-LINK TL-WR1043N v5 support"
+       select SOC_QCA956X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR1043ND
+       bool "TP-LINK TL-WR1043ND support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR1043ND_V2
+       bool "TP-LINK TL-WR1043ND v2 support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR1043ND_V4
+       bool "TP-LINK TL-WR1043ND v4 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TL_WR2543N
+       bool "TP-LINK TL-WR2543N/ND support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_TS_D084
+       bool "PISEN TS-D084 support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TEW_632BRP
+       bool "TRENDnet TEW-632BRP support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_TEW_673GRU
+       bool "TRENDnet TEW-673GRU support"
+       select SOC_AR71XX
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_TEW_712BR
+       bool "TRENDnet TEW-712BR support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TEW_732BR
+       bool "TRENDnet TEW-732BR support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_TEW_823DRU
+       bool "TRENDnet TEW-823DRU support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_UBNT
+       bool "Ubiquiti AR71xx based boards support"
+       select SOC_AR71XX
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_UBNT_UNIFIAC
+       bool "Ubiquiti UniFi AC (LITE/LR/MESH/PRO/MESH-PRO) support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_USB
+
+config ATH79_MACH_WEIO
+       bool "WeIO board"
+       select SOC_AR933X
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_MYNET_N600
+       bool "WD My Net N600 board support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_MYNET_N750
+       bool "WD My Net N750 board support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_MYNET_REXT
+       bool "WD My Net Wi-Fi Range Extender board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_Z1
+       bool "Meraki Z1 board support"
+       select SOC_AR934X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_NFC
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select LEDS_NU801
+
+config ATH79_MACH_ZBT_WE1526
+       bool "Zbtlink ZBT-WE1526 board support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_ZCN_1523H
+       bool "Zcomax ZCN-1523H support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_N5Q
+       bool "ALFA Network N5Q support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_NBG460N
+       bool "Zyxel NBG460N/550N/550NH board support"
+       select SOC_AR913X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_NBG6716
+       bool "Zyxel NBG6616/NBG6716 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_NFC
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_CARAMBOLA2
+       bool "8devices Carambola2 board"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_LAN_TURTLE
+       bool "Hak5 LAN Turtle and Packet Squirrel support"
+       select SOC_AR933X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+
+config ATH79_MACH_LIMA
+       bool "8devices Lima board"
+       select SOC_QCA953X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_SPI
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_ETH
+
+config ATH79_MACH_RAMBUTAN
+       bool "8devices Rambutan board"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_NFC
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CF_E316N_V2
+       bool "COMFAST CF-E316N v2 support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CF_E320N_V2
+       bool "COMFAST CF-E320N v2 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CF_E355AC
+       bool "COMFAST CF-E355AC v1/v2 support"
+       select SOC_QCA953X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CF_E375AC
+       bool "COMFAST CF-E375AC support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CF_E380AC_V1
+       bool "COMFAST CF-E380AC v1 support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CF_E380AC_V2
+       bool "COMFAST CF-E380AC v2 support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CF_E520N
+       bool "COMFAST CF-E520N support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_CF_E530N
+       bool "COMFAST CF-E530N support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_BHU_BXU2000N2_A
+       bool "BHU BXU2000n-2 rev. A support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_USB
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_QIHOO_C301
+       bool "Qihoo 360 C301 board support"
+       select SOC_AR934X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_DEV_USB
+       select ATH79_NVRAM
+
+config ATH79_MACH_DAP_1330_A1
+       bool "D-Link DAP-1330 rev. A1 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_DAP_2695_A1
+       bool "D-Link DAP-2695 rev. A1 support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+       select ATH79_NVRAM
+
+config ATH79_MACH_TL_WPA8630
+       bool "TP-Link TL-WPA8630 support"
+       select SOC_QCA956X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
+config ATH79_MACH_FRITZ300E
+       bool "AVM FRITZ!WLAN Repeater 300E support"
+       select SOC_AR724X
+       select ATH79_DEV_AP9X_PCI if PCI
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_FRITZ4020
+       bool "AVM FRITZ!Box 4020 support"
+       select SOC_QCA956X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_USB
+       select ATH79_DEV_M25P80
+
+config ATH79_MACH_FRITZ450E
+       bool "AVM FRITZ!WLAN Repeater 450E support"
+       select SOC_QCA955X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
new file mode 100644 (file)
index 0000000..1ff6a5f
--- /dev/null
@@ -0,0 +1,291 @@
+#
+# Makefile for the Atheros AR71XX/AR724X/AR913X specific parts of the kernel
+#
+# Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
+# Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+
+obj-y  := prom.o setup.o irq.o common.o clock.o gpio.o
+
+obj-$(CONFIG_EARLY_PRINTK)             += early_printk.o
+obj-$(CONFIG_PCI)                      += pci.o
+
+#
+# Devices
+#
+obj-y                                  += dev-common.o
+obj-$(CONFIG_ATH79_DEV_AP9X_PCI)       += dev-ap9x-pci.o
+obj-$(CONFIG_ATH79_DEV_DSA)            += dev-dsa.o
+obj-$(CONFIG_ATH79_DEV_ETH)            += dev-eth.o
+obj-$(CONFIG_ATH79_DEV_GPIO_BUTTONS)   += dev-gpio-buttons.o
+obj-$(CONFIG_ATH79_DEV_LEDS_GPIO)      += dev-leds-gpio.o
+obj-$(CONFIG_ATH79_DEV_M25P80)         += dev-m25p80.o
+obj-$(CONFIG_ATH79_DEV_NFC)            += dev-nfc.o
+obj-$(CONFIG_ATH79_DEV_SPI)            += dev-spi.o
+obj-$(CONFIG_ATH79_DEV_USB)            += dev-usb.o
+obj-$(CONFIG_ATH79_DEV_WMAC)           += dev-wmac.o
+
+#
+# Miscellaneous objects
+#
+obj-$(CONFIG_ATH79_NVRAM)              += nvram.o
+obj-$(CONFIG_ATH79_PCI_ATH9K_FIXUP)    += pci-ath9k-fixup.o
+obj-$(CONFIG_ATH79_ROUTERBOOT)         += routerboot.o
+
+#
+# Machines
+#
+obj-$(CONFIG_ATH79_MACH_A60)                   += mach-a60.o
+obj-$(CONFIG_ATH79_MACH_WI2A_AC200I)           += mach-wi2a-ac200i.o
+obj-$(CONFIG_ATH79_MACH_ALFA_AP120C)           += mach-alfa-ap120c.o
+obj-$(CONFIG_ATH79_MACH_ALFA_AP96)             += mach-alfa-ap96.o
+obj-$(CONFIG_ATH79_MACH_ALFA_NX)               += mach-alfa-nx.o
+obj-$(CONFIG_ATH79_MACH_ALL0258N)              += mach-all0258n.o
+obj-$(CONFIG_ATH79_MACH_ALL0315N)              += mach-all0315n.o
+obj-$(CONFIG_ATH79_MACH_ANTMINER_S1)           += mach-antminer-s1.o
+obj-$(CONFIG_ATH79_MACH_ANTMINER_S3)           += mach-antminer-s3.o
+obj-$(CONFIG_ATH79_MACH_ANTROUTER_R1)          += mach-antrouter-r1.o
+obj-$(CONFIG_ATH79_MACH_AP121)                 += mach-ap121.o
+obj-$(CONFIG_ATH79_MACH_AP121F)                        += mach-ap121f.o
+obj-$(CONFIG_ATH79_MACH_AP132)                 += mach-ap132.o
+obj-$(CONFIG_ATH79_MACH_AP136)                 += mach-ap136.o
+obj-$(CONFIG_ATH79_MACH_AP143)                 += mach-ap143.o
+obj-$(CONFIG_ATH79_MACH_AP147)                 += mach-ap147.o
+obj-$(CONFIG_ATH79_MACH_AP152)                 += mach-ap152.o
+obj-$(CONFIG_ATH79_MACH_AP531B0)               += mach-ap531b0.o
+obj-$(CONFIG_ATH79_MACH_AP83)                  += mach-ap83.o
+obj-$(CONFIG_ATH79_MACH_AP90Q)                 += mach-ap90q.o
+obj-$(CONFIG_ATH79_MACH_AP91_5G)               += mach-ap91-5g.o
+obj-$(CONFIG_ATH79_MACH_AP96)                  += mach-ap96.o
+obj-$(CONFIG_ATH79_MACH_ARCHER_C25_V1)         += mach-archer-c25-v1.o
+obj-$(CONFIG_ATH79_MACH_ARCHER_C58_V1)         += mach-archer-c59-v1.o
+obj-$(CONFIG_ATH79_MACH_ARCHER_C59_V1)         += mach-archer-c59-v1.o
+obj-$(CONFIG_ATH79_MACH_ARCHER_C60_V1)         += mach-archer-c60-v1.o
+obj-$(CONFIG_ATH79_MACH_ARCHER_C60_V2)         += mach-archer-c60-v1.o
+obj-$(CONFIG_ATH79_MACH_ARCHER_C7)             += mach-archer-c7.o
+obj-$(CONFIG_ATH79_MACH_ARCHER_C7)             += mach-archer-c7-v4.o
+obj-$(CONFIG_ATH79_MACH_ARCHER_C7)             += mach-archer-c7-v5.o
+obj-$(CONFIG_ATH79_MACH_ARDUINO_YUN)           += mach-arduino-yun.o
+obj-$(CONFIG_ATH79_MACH_AW_NR580)              += mach-aw-nr580.o
+obj-$(CONFIG_ATH79_MACH_BHR_4GRV2)             += mach-bhr-4grv2.o
+obj-$(CONFIG_ATH79_MACH_BHU_BXU2000N2_A)       += mach-bhu-bxu2000n2-a.o
+obj-$(CONFIG_ATH79_MACH_BSB)                   += mach-bsb.o
+obj-$(CONFIG_ATH79_MACH_C55)                   += mach-c55.o
+obj-$(CONFIG_ATH79_MACH_C60)                   += mach-c60.o
+obj-$(CONFIG_ATH79_MACH_CAP324)                        += mach-cap324.o
+obj-$(CONFIG_ATH79_MACH_CAP4200AG)             += mach-cap4200ag.o
+obj-$(CONFIG_ATH79_MACH_CARAMBOLA2)            += mach-carambola2.o
+obj-$(CONFIG_ATH79_MACH_CF_E316N_V2)           += mach-cf-e316n-v2.o
+obj-$(CONFIG_ATH79_MACH_CF_E320N_V2)           += mach-cf-e316n-v2.o
+obj-$(CONFIG_ATH79_MACH_CF_E355AC)             += mach-cf-e316n-v2.o
+obj-$(CONFIG_ATH79_MACH_CF_E375AC)             += mach-cf-e316n-v2.o
+obj-$(CONFIG_ATH79_MACH_CF_E380AC_V1)          += mach-cf-e316n-v2.o
+obj-$(CONFIG_ATH79_MACH_CF_E380AC_V2)          += mach-cf-e316n-v2.o
+obj-$(CONFIG_ATH79_MACH_CF_E520N)              += mach-cf-e316n-v2.o
+obj-$(CONFIG_ATH79_MACH_CF_E530N)              += mach-cf-e316n-v2.o
+obj-$(CONFIG_ATH79_MACH_CPE505N)               += mach-r602n.o
+obj-$(CONFIG_ATH79_MACH_CPE510)                        += mach-cpe510.o
+obj-$(CONFIG_ATH79_MACH_CPE830)                        += mach-ap90q.o
+obj-$(CONFIG_ATH79_MACH_CPE870)                        += mach-cpe870.o
+obj-$(CONFIG_ATH79_MACH_CR3000)                        += mach-cr3000.o
+obj-$(CONFIG_ATH79_MACH_CR5000)                        += mach-cr5000.o
+obj-$(CONFIG_ATH79_MACH_DAP_1330_A1)           += mach-dap-1330-a1.o
+obj-$(CONFIG_ATH79_MACH_DAP_2695_A1)           += mach-dap-2695-a1.o
+obj-$(CONFIG_ATH79_MACH_DB120)                 += mach-db120.o
+obj-$(CONFIG_ATH79_MACH_DGL_5500_A1)           += mach-dgl-5500-a1.o
+obj-$(CONFIG_ATH79_MACH_DHP_1565_A1)           += mach-dhp-1565-a1.o
+obj-$(CONFIG_ATH79_MACH_DIR_505_A1)            += mach-dir-505-a1.o
+obj-$(CONFIG_ATH79_MACH_DIR_600_A1)            += mach-dir-600-a1.o
+obj-$(CONFIG_ATH79_MACH_DIR_615_C1)            += mach-dir-615-c1.o
+obj-$(CONFIG_ATH79_MACH_DIR_615_I1)            += mach-dir-615-i1.o
+obj-$(CONFIG_ATH79_MACH_DIR_825_B1)            += mach-dir-825-b1.o
+obj-$(CONFIG_ATH79_MACH_DIR_825_C1)            += mach-dir-825-c1.o
+obj-$(CONFIG_ATH79_MACH_DIR_869_A1)            += mach-dir-869-a1.o
+obj-$(CONFIG_ATH79_MACH_DLAN_HOTSPOT)          += mach-dlan-hotspot.o
+obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC)      += mach-dlan-pro-1200-ac.o
+obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP)       += mach-dlan-pro-500-wp.o
+obj-$(CONFIG_ATH79_MACH_DOMYWIFI_DW33D)                += mach-domywifi-dw33d.o
+obj-$(CONFIG_ATH79_MACH_DR342)                 += mach-dr344.o
+obj-$(CONFIG_ATH79_MACH_DR344)                 += mach-dr344.o
+obj-$(CONFIG_ATH79_MACH_DR531)                 += mach-dr531.o
+obj-$(CONFIG_ATH79_MACH_DRAGINO2)              += mach-dragino2.o
+obj-$(CONFIG_ATH79_MACH_E1700AC_V2)            += mach-e1700ac-v2.o
+obj-$(CONFIG_ATH79_MACH_E558_V2)               += mach-e558-v2.o
+obj-$(CONFIG_ATH79_MACH_E600G_V2)              += mach-e600g-v2.o
+obj-$(CONFIG_ATH79_MACH_E750A_V4)              += mach-e750a-v4.o
+obj-$(CONFIG_ATH79_MACH_E750G_V8)              += mach-e750g-v8.o
+obj-$(CONFIG_ATH79_MACH_EAP120)                        += mach-eap120.o
+obj-$(CONFIG_ATH79_MACH_EAP300V2)              += mach-eap300v2.o
+obj-$(CONFIG_ATH79_MACH_EAP7660D)              += mach-eap7660d.o
+obj-$(CONFIG_ATH79_MACH_EL_M150)               += mach-el-m150.o
+obj-$(CONFIG_ATH79_MACH_EL_MINI)               += mach-el-mini.o
+obj-$(CONFIG_ATH79_MACH_ENS202EXT)             += mach-ens202ext.o
+obj-$(CONFIG_ATH79_MACH_EPG5000)               += mach-epg5000.o
+obj-$(CONFIG_ATH79_MACH_ESR1750)               += mach-esr1750.o
+obj-$(CONFIG_ATH79_MACH_ESR900)                        += mach-esr900.o
+obj-$(CONFIG_ATH79_MACH_EW_BALIN)              += mach-ew-balin.o
+obj-$(CONFIG_ATH79_MACH_EW_DORIN)              += mach-ew-dorin.o
+obj-$(CONFIG_ATH79_MACH_F9K1115V2)             += mach-f9k1115v2.o
+obj-$(CONFIG_ATH79_MACH_FRITZ300E)             += mach-fritz300e.o
+obj-$(CONFIG_ATH79_MACH_FRITZ4020)             += mach-fritz4020.o
+obj-$(CONFIG_ATH79_MACH_FRITZ450E)             += mach-fritz450e.o
+obj-$(CONFIG_ATH79_MACH_GL_AR150)              += mach-gl-ar150.o
+obj-$(CONFIG_ATH79_MACH_GL_AR300)              += mach-gl-ar300.o
+obj-$(CONFIG_ATH79_MACH_GL_AR300M)             += mach-gl-ar300m.o
+obj-$(CONFIG_ATH79_MACH_GL_AR750)              += mach-gl-ar750.o
+obj-$(CONFIG_ATH79_MACH_GL_AR750S)             += mach-gl-ar750s.o
+obj-$(CONFIG_ATH79_MACH_GL_DOMINO)             += mach-gl-domino.o
+obj-$(CONFIG_ATH79_MACH_GL_INET)               += mach-gl-inet.o
+obj-$(CONFIG_ATH79_MACH_GL_MIFI)               += mach-gl-mifi.o
+obj-$(CONFIG_ATH79_MACH_GL_USB150)             += mach-gl-usb150.o
+obj-$(CONFIG_ATH79_MACH_GS_MINIBOX_V32)                += mach-gs-minibox-v32.o
+obj-$(CONFIG_ATH79_MACH_GS_OOLITE_V1)          += mach-gs-oolite-v1.o
+obj-$(CONFIG_ATH79_MACH_GS_OOLITE_V5_2)                += mach-gs-oolite-v5-2.o
+obj-$(CONFIG_ATH79_MACH_HIVEAP_121)            += mach-hiveap-121.o
+obj-$(CONFIG_ATH79_MACH_HIWIFI_HC6361)         += mach-hiwifi-hc6361.o
+obj-$(CONFIG_ATH79_MACH_HORNET_UB)             += mach-hornet-ub.o
+obj-$(CONFIG_ATH79_MACH_JA76PF)                        += mach-ja76pf.o
+obj-$(CONFIG_ATH79_MACH_JWAP003)               += mach-jwap003.o
+obj-$(CONFIG_ATH79_MACH_JWAP230)               += mach-jwap230.o
+obj-$(CONFIG_ATH79_MACH_KOALA)                 += mach-koala.o
+obj-$(CONFIG_ATH79_MACH_LAN_TURTLE)            += mach-lan-turtle.o
+obj-$(CONFIG_ATH79_MACH_LIMA)                  += mach-lima.o
+obj-$(CONFIG_ATH79_MACH_MC_MAC1200R)           += mach-mc-mac1200r.o
+obj-$(CONFIG_ATH79_MACH_MR12)                  += mach-mr12.o
+obj-$(CONFIG_ATH79_MACH_MR16)                  += mach-mr16.o
+obj-$(CONFIG_ATH79_MACH_MR1750)                        += mach-mr1750.o
+obj-$(CONFIG_ATH79_MACH_MR18)                  += mach-mr18.o
+obj-$(CONFIG_ATH79_MACH_MR600)                 += mach-mr600.o
+obj-$(CONFIG_ATH79_MACH_MR900)                 += mach-mr900.o
+obj-$(CONFIG_ATH79_MACH_MYNET_N600)            += mach-mynet-n600.o
+obj-$(CONFIG_ATH79_MACH_MYNET_N750)            += mach-mynet-n750.o
+obj-$(CONFIG_ATH79_MACH_MYNET_REXT)            += mach-mynet-rext.o
+obj-$(CONFIG_ATH79_MACH_MZK_W04NU)             += mach-mzk-w04nu.o
+obj-$(CONFIG_ATH79_MACH_MZK_W300NH)            += mach-mzk-w300nh.o
+obj-$(CONFIG_ATH79_MACH_N5Q)                   += mach-n5q.o
+obj-$(CONFIG_ATH79_MACH_NBG460N)               += mach-nbg460n.o
+obj-$(CONFIG_ATH79_MACH_NBG6716)               += mach-nbg6716.o
+obj-$(CONFIG_ATH79_MACH_RAMBUTAN)              += mach-rambutan.o
+obj-$(CONFIG_ATH79_MACH_OM2P)                  += mach-om2p.o
+obj-$(CONFIG_ATH79_MACH_OM5P)                  += mach-om5p.o
+obj-$(CONFIG_ATH79_MACH_OM5P_AC)               += mach-om5pac.o
+obj-$(CONFIG_ATH79_MACH_OM5P_ACv2)             += mach-om5pacv2.o
+obj-$(CONFIG_ATH79_MACH_OMY_G1)                        += mach-omy-g1.o
+obj-$(CONFIG_ATH79_MACH_OMY_X1)                        += mach-omy-x1.o
+obj-$(CONFIG_ATH79_MACH_ONION_OMEGA)           += mach-onion-omega.o
+obj-$(CONFIG_ATH79_MACH_PB42)                  += mach-pb42.o
+obj-$(CONFIG_ATH79_MACH_PB44)                  += mach-pb44.o
+obj-$(CONFIG_ATH79_MACH_PQI_AIR_PEN)           += mach-pqi-air-pen.o
+obj-$(CONFIG_ATH79_MACH_QIHOO_C301)            += mach-qihoo-c301.o
+obj-$(CONFIG_ATH79_MACH_R36A)                  += mach-r36a.o
+obj-$(CONFIG_ATH79_MACH_R602N)                 += mach-r602n.o
+obj-$(CONFIG_ATH79_MACH_R6100)                 += mach-r6100.o
+obj-$(CONFIG_ATH79_MACH_RB2011)                        += mach-rb2011.o
+obj-$(CONFIG_ATH79_MACH_RB4XX)                 += mach-rb4xx.o
+obj-$(CONFIG_ATH79_MACH_RB750)                 += mach-rb750.o
+obj-$(CONFIG_ATH79_MACH_RB91X)                 += mach-rb91x.o
+obj-$(CONFIG_ATH79_MACH_RB922)                 += mach-rb922.o
+obj-$(CONFIG_ATH79_MACH_RB941)                 += mach-rb941.o
+obj-$(CONFIG_ATH79_MACH_RB95X)                 += mach-rb95x.o
+obj-$(CONFIG_ATH79_MACH_RBSPI)                 += mach-rbspi.o
+obj-$(CONFIG_ATH79_MACH_RBSXTLITE)             += mach-rbsxtlite.o
+obj-$(CONFIG_ATH79_MACH_RE355)                 += mach-re450.o
+obj-$(CONFIG_ATH79_MACH_RE450)                 += mach-re450.o
+obj-$(CONFIG_ATH79_MACH_RME_EG200)             += mach-rme-eg200.o
+obj-$(CONFIG_ATH79_MACH_RUT9XX)                        += mach-rut9xx.o
+obj-$(CONFIG_ATH79_MACH_RW2458N)               += mach-rw2458n.o
+obj-$(CONFIG_ATH79_MACH_SC1750)                        += mach-sc1750.o
+obj-$(CONFIG_ATH79_MACH_SC300M)                        += mach-sc300m.o
+obj-$(CONFIG_ATH79_MACH_SC450)                 += mach-sc450.o
+obj-$(CONFIG_ATH79_MACH_SMART_300)             += mach-smart-300.o
+obj-$(CONFIG_ATH79_MACH_SOM9331)               += mach-som9331.o
+obj-$(CONFIG_ATH79_MACH_SR3200)                        += mach-sr3200.o
+obj-$(CONFIG_ATH79_MACH_T830)                  += mach-t830.o
+obj-$(CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE)   += mach-tellstick-znet-lite.o
+obj-$(CONFIG_ATH79_MACH_TEW_632BRP)            += mach-tew-632brp.o
+obj-$(CONFIG_ATH79_MACH_TEW_673GRU)            += mach-tew-673gru.o
+obj-$(CONFIG_ATH79_MACH_TEW_712BR)             += mach-tew-712br.o
+obj-$(CONFIG_ATH79_MACH_TEW_732BR)             += mach-tew-732br.o
+obj-$(CONFIG_ATH79_MACH_TEW_823DRU)            += mach-tew-823dru.o
+obj-$(CONFIG_ATH79_MACH_TL_MR11U)              += mach-tl-mr11u.o
+obj-$(CONFIG_ATH79_MACH_TL_MR13U)              += mach-tl-mr13u.o
+obj-$(CONFIG_ATH79_MACH_TL_MR3020)             += mach-tl-mr3020.o
+obj-$(CONFIG_ATH79_MACH_TL_MR3X20)             += mach-tl-mr3x20.o
+obj-$(CONFIG_ATH79_MACH_TL_MR6400)             += mach-tl-mr6400.o
+obj-$(CONFIG_ATH79_MACH_TL_WA701ND_V2)         += mach-tl-wa701nd-v2.o
+obj-$(CONFIG_ATH79_MACH_TL_WA7210N_V2)         += mach-tl-wa7210n-v2.o
+obj-$(CONFIG_ATH79_MACH_TL_WA801ND_V3)         += mach-tl-wa801nd-v3.o
+obj-$(CONFIG_ATH79_MACH_TL_WA830RE_V2)         += mach-tl-wa830re-v2.o
+obj-$(CONFIG_ATH79_MACH_TL_WA850RE_V2)         += mach-tl-wax50re.o
+obj-$(CONFIG_ATH79_MACH_TL_WA855RE_V1)         += mach-tl-wax50re.o
+obj-$(CONFIG_ATH79_MACH_TL_WA901ND)            += mach-tl-wa901nd.o
+obj-$(CONFIG_ATH79_MACH_TL_WA901ND_V2)         += mach-tl-wa901nd-v2.o
+obj-$(CONFIG_ATH79_MACH_TL_WA901ND_V4)         += mach-tl-wa901nd-v4.o
+obj-$(CONFIG_ATH79_MACH_TL_WAX50RE)            += mach-tl-wax50re.o
+obj-$(CONFIG_ATH79_MACH_TL_WDR3320_V2)         += mach-tl-wdr3320-v2.o
+obj-$(CONFIG_ATH79_MACH_TL_WDR3500)            += mach-tl-wdr3500.o
+obj-$(CONFIG_ATH79_MACH_TL_WDR4300)            += mach-tl-wdr4300.o
+obj-$(CONFIG_ATH79_MACH_TL_WDR6500_V2)         += mach-tl-wdr6500-v2.o
+obj-$(CONFIG_ATH79_MACH_TL_WPA8630)            += mach-tl-wpa8630.o
+obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2)         += mach-tl-wr1041n-v2.o
+obj-$(CONFIG_ATH79_MACH_TL_WR1043ND)           += mach-tl-wr1043nd.o
+obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2)                += mach-tl-wr1043nd-v2.o
+obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V4)                += mach-tl-wr1043nd-v4.o
+obj-$(CONFIG_ATH79_MACH_TL_WR2543N)            += mach-tl-wr2543n.o
+obj-$(CONFIG_ATH79_MACH_TL_WR703N)             += mach-tl-wr703n.o
+obj-$(CONFIG_ATH79_MACH_TL_WR720N_V3)          += mach-tl-wr720n-v3.o
+obj-$(CONFIG_ATH79_MACH_TL_WR741ND)            += mach-tl-wr741nd.o
+obj-$(CONFIG_ATH79_MACH_TL_WR741ND_V4)         += mach-tl-wr741nd-v4.o
+obj-$(CONFIG_ATH79_MACH_TL_WR802N_V1)          += mach-tl-wr802n.o
+obj-$(CONFIG_ATH79_MACH_TL_WR802N_V2)          += mach-tl-wr802n.o
+obj-$(CONFIG_ATH79_MACH_TL_WR810N)             += mach-tl-wr810n.o
+obj-$(CONFIG_ATH79_MACH_TL_WR810N_V2)          += mach-tl-wr810n.o
+obj-$(CONFIG_ATH79_MACH_TL_WR840N_V2)          += mach-tl-wr841n-v9.o
+obj-$(CONFIG_ATH79_MACH_TL_WR841N_V1)          += mach-tl-wr841n.o
+obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8)          += mach-tl-wr841n-v8.o
+obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9)          += mach-tl-wr841n-v9.o
+obj-$(CONFIG_ATH79_MACH_TL_WR902AC_V1)         += mach-tl-wr902ac-v1.o
+obj-$(CONFIG_ATH79_MACH_TL_WR941ND)            += mach-tl-wr941nd.o
+obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6)         += mach-tl-wr941nd-v6.o
+obj-$(CONFIG_ATH79_MACH_TL_WR940N_V4)          += mach-tl-wr940n-v4.o
+obj-$(CONFIG_ATH79_MACH_TL_WR942N_V1)          += mach-tl-wr942n-v1.o
+obj-$(CONFIG_ATH79_MACH_TS_D084)               += mach-ts-d084.o
+obj-$(CONFIG_ATH79_MACH_TUBE2H)                        += mach-tube2h.o
+obj-$(CONFIG_ATH79_MACH_UBNT)                  += mach-ubnt.o
+obj-$(CONFIG_ATH79_MACH_UBNT_UNIFIAC)          += mach-ubnt-unifiac.o
+obj-$(CONFIG_ATH79_MACH_UBNT_XM)               += mach-ubnt-xm.o
+obj-$(CONFIG_ATH79_MACH_WAM250)                        += mach-wam250.o
+obj-$(CONFIG_ATH79_MACH_WEIO)                  += mach-weio.o
+obj-$(CONFIG_ATH79_MACH_WHR_HP_G300N)          += mach-whr-hp-g300n.o
+obj-$(CONFIG_ATH79_MACH_WIFI_PINEAPPLE_NANO)   += mach-wifi-pineapple-nano.o
+obj-$(CONFIG_ATH79_MACH_WLAE_AG300N)           += mach-wlae-ag300n.o
+obj-$(CONFIG_ATH79_MACH_WLR8100)               += mach-wlr8100.o
+obj-$(CONFIG_ATH79_MACH_WNDAP360)              += mach-wndap360.o
+obj-$(CONFIG_ATH79_MACH_WNDR3700)              += mach-wndr3700.o
+obj-$(CONFIG_ATH79_MACH_WNDR4300)              += mach-wndr4300.o
+obj-$(CONFIG_ATH79_MACH_WNR2000)               += mach-wnr2000.o
+obj-$(CONFIG_ATH79_MACH_WNR2000_V3)            += mach-wnr2000-v3.o
+obj-$(CONFIG_ATH79_MACH_WNR2000_V4)            += mach-wnr2000-v4.o
+obj-$(CONFIG_ATH79_MACH_WNR2200)               += mach-wnr2200.o
+obj-$(CONFIG_ATH79_MACH_WP543)                 += mach-wp543.o
+obj-$(CONFIG_ATH79_MACH_WPE72)                 += mach-wpe72.o
+obj-$(CONFIG_ATH79_MACH_WPJ342)                        += mach-wpj342.o
+obj-$(CONFIG_ATH79_MACH_WPJ344)                        += mach-wpj344.o
+obj-$(CONFIG_ATH79_MACH_WPJ531)                        += mach-wpj531.o
+obj-$(CONFIG_ATH79_MACH_WPJ558)                        += mach-wpj558.o
+obj-$(CONFIG_ATH79_MACH_WPJ563)                        += mach-wpj563.o
+obj-$(CONFIG_ATH79_MACH_WRT160NL)              += mach-wrt160nl.o
+obj-$(CONFIG_ATH79_MACH_WRT400N)               += mach-wrt400n.o
+obj-$(CONFIG_ATH79_MACH_WRTNODE2Q)             += mach-wrtnode2q.o
+obj-$(CONFIG_ATH79_MACH_WZR_450HP2)            += mach-wzr-450hp2.o
+obj-$(CONFIG_ATH79_MACH_WZR_HP_AG300H)         += mach-wzr-hp-ag300h.o
+obj-$(CONFIG_ATH79_MACH_WZR_HP_G300NH)         += mach-wzr-hp-g300nh.o
+obj-$(CONFIG_ATH79_MACH_WZR_HP_G300NH2)                += mach-wzr-hp-g300nh2.o
+obj-$(CONFIG_ATH79_MACH_WZR_HP_G450H)          += mach-wzr-hp-g450h.o
+obj-$(CONFIG_ATH79_MACH_XD3200)                        += mach-sr3200.o
+obj-$(CONFIG_ATH79_MACH_Z1)                    += mach-z1.o
+obj-$(CONFIG_ATH79_MACH_ZBT_WE1526)            += mach-zbt-we1526.o
+obj-$(CONFIG_ATH79_MACH_ZCN_1523H)             += mach-zcn-1523h.o
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ap83.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ap83.c
new file mode 100644 (file)
index 0000000..053d17d
--- /dev/null
@@ -0,0 +1,277 @@
+/*
+ *  Atheros AP83 board support
+ *
+ *  Copyright (C) 2008-2012 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_gpio.h>
+#include <linux/spi/vsc7385.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include <asm/mach-ath79/ath79.h>
+
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define AP83_GPIO_LED_WLAN     6
+#define AP83_GPIO_LED_POWER    14
+#define AP83_GPIO_LED_JUMPSTART        15
+#define AP83_GPIO_BTN_JUMPSTART        12
+#define AP83_GPIO_BTN_RESET    21
+
+#define AP83_050_GPIO_VSC7385_CS       1
+#define AP83_050_GPIO_VSC7385_MISO     3
+#define AP83_050_GPIO_VSC7385_MOSI     16
+#define AP83_050_GPIO_VSC7385_SCK      17
+
+#define AP83_KEYS_POLL_INTERVAL                20      /* msecs */
+#define AP83_KEYS_DEBOUNCE_INTERVAL    (3 * AP83_KEYS_POLL_INTERVAL)
+
+static struct mtd_partition ap83_flash_partitions[] = {
+       {
+               .name           = "u-boot",
+               .offset         = 0,
+               .size           = 0x040000,
+               .mask_flags     = MTD_WRITEABLE,
+       }, {
+               .name           = "u-boot-env",
+               .offset         = 0x040000,
+               .size           = 0x020000,
+               .mask_flags     = MTD_WRITEABLE,
+       }, {
+               .name           = "rootfs",
+               .offset         = 0x060000,
+               .size           = 0x400000,
+       }, {
+               .name           = "kernel",
+               .offset         = 0x460000,
+               .size           = 0x390000,
+       }, {
+               .name           = "art",
+               .offset         = 0x7f0000,
+               .size           = 0x010000,
+               .mask_flags     = MTD_WRITEABLE,
+       }, {
+               .name           = "firmware",
+               .offset         = 0x060000,
+               .size           = 0x790000,
+       }
+};
+
+static struct physmap_flash_data ap83_flash_data = {
+       .width          = 2,
+       .parts          = ap83_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(ap83_flash_partitions),
+};
+
+static struct resource ap83_flash_resources[] = {
+       [0] = {
+               .start  = AR71XX_SPI_BASE,
+               .end    = AR71XX_SPI_BASE + AR71XX_SPI_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device ap83_flash_device = {
+       .name           = "physmap-flash",
+       .id             = -1,
+       .resource       = ap83_flash_resources,
+       .num_resources  = ARRAY_SIZE(ap83_flash_resources),
+       .dev            = {
+               .platform_data = &ap83_flash_data,
+       }
+};
+
+static struct gpio_led ap83_leds_gpio[] __initdata = {
+       {
+               .name           = "ap83:green:jumpstart",
+               .gpio           = AP83_GPIO_LED_JUMPSTART,
+               .active_low     = 0,
+       }, {
+               .name           = "ap83:green:power",
+               .gpio           = AP83_GPIO_LED_POWER,
+               .active_low     = 0,
+       }, {
+               .name           = "ap83:green:wlan",
+               .gpio           = AP83_GPIO_LED_WLAN,
+               .active_low     = 0,
+       },
+};
+
+static struct gpio_keys_button ap83_gpio_keys[] __initdata = {
+       {
+               .desc           = "soft_reset",
+               .type           = EV_KEY,
+               .code           = KEY_RESTART,
+               .debounce_interval = AP83_KEYS_DEBOUNCE_INTERVAL,
+               .gpio           = AP83_GPIO_BTN_RESET,
+               .active_low     = 1,
+       }, {
+               .desc           = "jumpstart",
+               .type           = EV_KEY,
+               .code           = KEY_WPS_BUTTON,
+               .debounce_interval = AP83_KEYS_DEBOUNCE_INTERVAL,
+               .gpio           = AP83_GPIO_BTN_JUMPSTART,
+               .active_low     = 1,
+       }
+};
+
+static struct resource ap83_040_spi_resources[] = {
+       [0] = {
+               .start  = AR71XX_SPI_BASE,
+               .end    = AR71XX_SPI_BASE + AR71XX_SPI_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device ap83_040_spi_device = {
+       .name           = "ap83-spi",
+       .id             = 0,
+       .resource       = ap83_040_spi_resources,
+       .num_resources  = ARRAY_SIZE(ap83_040_spi_resources),
+};
+
+static struct spi_gpio_platform_data ap83_050_spi_data = {
+       .miso   = AP83_050_GPIO_VSC7385_MISO,
+       .mosi   = AP83_050_GPIO_VSC7385_MOSI,
+       .sck    = AP83_050_GPIO_VSC7385_SCK,
+       .num_chipselect = 1,
+};
+
+static struct platform_device ap83_050_spi_device = {
+       .name           = "spi_gpio",
+       .id             = 0,
+       .dev            = {
+               .platform_data = &ap83_050_spi_data,
+       }
+};
+
+static void ap83_vsc7385_reset(void)
+{
+       ath79_device_reset_set(AR71XX_RESET_GE1_PHY);
+       udelay(10);
+       ath79_device_reset_clear(AR71XX_RESET_GE1_PHY);
+       mdelay(50);
+}
+
+static struct vsc7385_platform_data ap83_vsc7385_data = {
+       .reset          = ap83_vsc7385_reset,
+       .ucode_name     = "vsc7385_ucode_ap83.bin",
+       .mac_cfg = {
+               .tx_ipg         = 6,
+               .bit2           = 0,
+               .clk_sel        = 3,
+       },
+};
+
+static struct spi_board_info ap83_spi_info[] = {
+       {
+               .bus_num        = 0,
+               .chip_select    = 0,
+               .max_speed_hz   = 25000000,
+               .modalias       = "spi-vsc7385",
+               .platform_data  = &ap83_vsc7385_data,
+               .controller_data = (void *) AP83_050_GPIO_VSC7385_CS,
+       }
+};
+
+static void __init ap83_generic_setup(void)
+{
+       u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
+
+       ath79_register_mdio(0, 0xfffffffe);
+
+       ath79_init_mac(ath79_eth0_data.mac_addr, eeprom, 0);
+       ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+       ath79_eth0_data.phy_mask = 0x1;
+
+       ath79_register_eth(0);
+
+       ath79_init_mac(ath79_eth1_data.mac_addr, eeprom, 1);
+       ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+       ath79_eth1_data.speed = SPEED_1000;
+       ath79_eth1_data.duplex = DUPLEX_FULL;
+
+       ath79_eth1_pll_data.pll_1000 = 0x1f000000;
+
+       ath79_register_eth(1);
+
+       ath79_register_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio),
+                                       ap83_leds_gpio);
+
+       ath79_register_gpio_keys_polled(-1, AP83_KEYS_POLL_INTERVAL,
+                                        ARRAY_SIZE(ap83_gpio_keys),
+                                        ap83_gpio_keys);
+
+       ath79_register_usb();
+
+       ath79_register_wmac(eeprom, NULL);
+
+       platform_device_register(&ap83_flash_device);
+
+       spi_register_board_info(ap83_spi_info, ARRAY_SIZE(ap83_spi_info));
+}
+
+static void ap83_040_flash_lock(struct platform_device *pdev)
+{
+       ath79_flash_acquire();
+}
+
+static void ap83_040_flash_unlock(struct platform_device *pdev)
+{
+       ath79_flash_release();
+}
+
+static void __init ap83_040_setup(void)
+{
+       ap83_flash_data.lock = ap83_040_flash_lock;
+       ap83_flash_data.unlock = ap83_040_flash_unlock;
+       ap83_generic_setup();
+       platform_device_register(&ap83_040_spi_device);
+}
+
+static void __init ap83_050_setup(void)
+{
+       ap83_generic_setup();
+       platform_device_register(&ap83_050_spi_device);
+}
+
+static void __init ap83_setup(void)
+{
+       u8 *board_id = (u8 *) KSEG1ADDR(0x1fff1244);
+       unsigned int board_version;
+
+       board_version = (unsigned int)(board_id[0] - '0');
+       board_version += ((unsigned int)(board_id[1] - '0')) * 10;
+
+       printk(KERN_WARNING "Board is AP83-%03u\n", board_version);
+
+       switch (board_version) {
+       case 40:
+               ap83_040_setup();
+               break;
+       case 50:
+               ap83_050_setup();
+               break;
+       default:
+               printk(KERN_WARNING "AP83-%03u board is not yet supported\n",
+                      board_version);
+       }
+}
+
+MIPS_MACHINE(ATH79_MACH_AP83, "AP83", "Atheros AP83", ap83_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
new file mode 100644 (file)
index 0000000..ee4afad
--- /dev/null
@@ -0,0 +1,388 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X machine type definitions
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef _ATH79_MACHTYPE_H
+#define _ATH79_MACHTYPE_H
+
+#include <asm/mips_machine.h>
+
+enum ath79_mach_type {
+       ATH79_MACH_GENERIC_OF = -1,     /* Device tree board */
+       ATH79_MACH_GENERIC = 0,
+       ATH79_MACH_A40,                         /* OpenMesh A40 */
+       ATH79_MACH_A60,                         /* OpenMesh A60 */
+       ATH79_MACH_WI2A_AC200I,                 /* Nokia WI2A-AC200i */
+       ATH79_MACH_ALFA_AP120C,                 /* ALFA Network AP120C board */
+       ATH79_MACH_ALFA_AP96,                   /* ALFA Network AP96 board */
+       ATH79_MACH_ALFA_NX,                     /* ALFA Network N2/N5 board */
+       ATH79_MACH_ALL0258N,                    /* Allnet ALL0258N */
+       ATH79_MACH_ALL0305,                     /* Allnet ALL0305 */
+       ATH79_MACH_ALL0315N,                    /* Allnet ALL0315N */
+       ATH79_MACH_ANTMINER_S1,                 /* Antminer S1 */
+       ATH79_MACH_ANTMINER_S3,                 /* Antminer S3 */
+       ATH79_MACH_ANTROUTER_R1,                /* Antrouter R1 */
+       ATH79_MACH_AP121,                       /* Atheros AP121 reference board */
+       ATH79_MACH_AP121_MINI,                  /* Atheros AP121-MINI reference board */
+       ATH79_MACH_AP121F,                      /* ALFA Network AP121F */
+       ATH79_MACH_AP132,                       /* Atheros AP132 reference board */
+       ATH79_MACH_AP135_020,                   /* Atheros AP135-020 reference board */
+       ATH79_MACH_AP136_010,                   /* Atheros AP136-010 reference board */
+       ATH79_MACH_AP136_020,                   /* Atheros AP136-020 reference board */
+       ATH79_MACH_AP143,                       /* Atheros AP143 reference board */
+       ATH79_MACH_AP147_010,                   /* Atheros AP147-010 reference board */
+       ATH79_MACH_AP152,                       /* Atheros AP152 reference board */
+       ATH79_MACH_AP531B0,                     /* Rockeetech AP531B0 */
+       ATH79_MACH_AP83,                        /* Atheros AP83 */
+       ATH79_MACH_AP90Q,                       /* YunCore AP80Q/AP90Q */
+       ATH79_MACH_AP91_5G,                     /* ALFA Network AP91-5G */
+       ATH79_MACH_AP96,                        /* Atheros AP96 */
+       ATH79_MACH_ARCHER_C25_V1,               /* TP-LINK Archer C25 V1 board */
+       ATH79_MACH_ARCHER_C5,                   /* TP-LINK Archer C5 board */
+       ATH79_MACH_ARCHER_C58_V1,               /* TP-LINK Archer C58 V1 board */
+       ATH79_MACH_ARCHER_C59_V1,               /* TP-LINK Archer C59 V1 board */
+       ATH79_MACH_ARCHER_C59_V2,               /* TP-LINK Archer C59 V2 board */
+       ATH79_MACH_ARCHER_C60_V1,               /* TP-LINK Archer C60 V1 board */
+       ATH79_MACH_ARCHER_C60_V2,               /* TP-LINK Archer C60 V2 board */
+       ATH79_MACH_ARCHER_C7,                   /* TP-LINK Archer C7 board */
+       ATH79_MACH_ARCHER_C7_V2,                /* TP-LINK Archer C7 V2 board */
+       ATH79_MACH_ARCHER_C7_V4,                /* TP-LINK Archer C7 V4 board */
+       ATH79_MACH_ARCHER_C7_V5,                /* TP-LINK Archer C7 V5 board */
+       ATH79_MACH_ARDUINO_YUN,                 /* Yun */
+       ATH79_MACH_AW_NR580,                    /* AzureWave AW-NR580 */
+       ATH79_MACH_BHR_4GRV2,                   /* Buffalo BHR-4GRV2 */
+       ATH79_MACH_BHU_BXU2000N2_A1,            /* BHU BXU2000n-2 A1 */
+       ATH79_MACH_BSB,                         /* Smart Electronics Black Swift board */
+       ATH79_MACH_C55,                         /* AirTight Networks C-55 */
+       ATH79_MACH_C60,                         /* AirTight Networks C-60 */
+       ATH79_MACH_CAP324,                      /* PowerCloud Systems CAP324 */
+       ATH79_MACH_CAP4200AG,                   /* Senao CAP4200AG */
+       ATH79_MACH_CARAMBOLA2,                  /* 8devices Carambola2 */
+       ATH79_MACH_CF_E316N_V2,                 /* COMFAST CF-E316N v2 */
+       ATH79_MACH_CF_E320N_V2,                 /* COMFAST CF-E320N v2 */
+       ATH79_MACH_CF_E355AC,                   /* COMFAST CF-E355AC */
+       ATH79_MACH_CF_E355AC_V2,                /* COMFAST CF-E355AC v2*/
+       ATH79_MACH_CF_E375AC,                   /* COMFAST CF-E375AC */
+       ATH79_MACH_CF_E380AC_V1,                /* COMFAST CF-E380AC v1 */
+       ATH79_MACH_CF_E380AC_V2,                /* COMFAST CF-E380AC v2 */
+       ATH79_MACH_CF_E385AC,                   /* COMFAST CF-E385AC */
+       ATH79_MACH_CF_E520N,                    /* COMFAST CF-E520N */
+       ATH79_MACH_CF_E530N,                    /* COMFAST CF-E530N */
+       ATH79_MACH_CPE210,                      /* TP-LINK CPE210 v1 */
+       ATH79_MACH_CPE210_V2,                   /* TP-LINK CPE210 v2 */
+       ATH79_MACH_CPE210_V3,                   /* TP-LINK CPE210 v3 */
+       ATH79_MACH_CPE505N,                     /* P&W CPE505N */
+       ATH79_MACH_CPE510,                      /* TP-LINK CPE510 */
+       ATH79_MACH_CPE510_V2,                   /* TP-LINK CPE510 v2 */
+       ATH79_MACH_CPE830,                      /* YunCore CPE830 */
+       ATH79_MACH_CPE870,                      /* YunCore CPE870 */
+       ATH79_MACH_CR3000,                      /* PowerCloud Systems CR3000 */
+       ATH79_MACH_CR5000,                      /* PowerCloud Systems CR5000 */
+       ATH79_MACH_DAP_1330_A1,                 /* D-Link DAP-1330 rev. A1 */
+       ATH79_MACH_DAP_2695_A1,                 /* D-Link DAP-2695 rev. A1 */
+       ATH79_MACH_DB120,                       /* Atheros DB120 reference board */
+       ATH79_MACH_DGL_5500_A1,                 /* D-link DGL-5500 rev. A1 */
+       ATH79_MACH_DHP_1565_A1,                 /* D-Link DHP-1565 rev. A1 */
+       ATH79_MACH_DIR_505_A1,                  /* D-Link DIR-505 rev. A1 */
+       ATH79_MACH_DIR_600_A1,                  /* D-Link DIR-600 rev. A1 */
+       ATH79_MACH_DIR_615_C1,                  /* D-Link DIR-615 rev. C1 */
+       ATH79_MACH_DIR_615_E1,                  /* D-Link DIR-615 rev. E1 */
+       ATH79_MACH_DIR_615_E4,                  /* D-Link DIR-615 rev. E4 */
+       ATH79_MACH_DIR_615_I1,                  /* D-Link DIR-615 rev. I1 */
+       ATH79_MACH_DIR_825_B1,                  /* D-Link DIR-825 rev. B1 */
+       ATH79_MACH_DIR_825_C1,                  /* D-Link DIR-825 rev. C1 */
+       ATH79_MACH_DIR_835_A1,                  /* D-Link DIR-835 rev. A1 */
+       ATH79_MACH_DIR_869_A1,                  /* D-Link DIR-869 rev. A1 */
+       ATH79_MACH_DLAN_HOTSPOT,                /* devolo dLAN Hotspot */
+       ATH79_MACH_DLAN_PRO_1200_AC,            /* devolo dLAN pro 1200+ WiFi ac*/
+       ATH79_MACH_DLAN_PRO_500_WP,             /* devolo dLAN pro 500 Wireless+ */
+       ATH79_MACH_DOMYWIFI_DW33D,              /* DomyWifi DW33D */
+       ATH79_MACH_DR342,                       /* Wallys DR342 */
+       ATH79_MACH_DR344,                       /* Wallys DR344 */
+       ATH79_MACH_DR531,                       /* Wallys DR531 */
+       ATH79_MACH_DRAGINO2,                    /* Dragino Version 2 */
+       ATH79_MACH_E1700AC_V2,                  /* Qxwlan E1700AC v2 */
+       ATH79_MACH_E558_V2,                     /* Qxwlan E558 v2 */
+       ATH79_MACH_E600G_V2,                    /* Qxwlan E600G v2 */
+       ATH79_MACH_E600GAC_V2,                  /* Qxwlan E600GAC v2 */
+       ATH79_MACH_E750A_V4,                    /* Qxwlan E750A v4 */
+       ATH79_MACH_E750G_V8,                    /* Qxwlan E750G v8 */
+       ATH79_MACH_EAP120,                      /* TP-LINK EAP120 */
+       ATH79_MACH_EAP300V2,                    /* EnGenius EAP300 v2 */
+       ATH79_MACH_EAP7660D,                    /* Senao EAP7660D */
+       ATH79_MACH_EBR_2310_C1,                 /* D-link EBR-2310 rev. C1 */
+       ATH79_MACH_EL_M150,                     /* EasyLink EL-M150 */
+       ATH79_MACH_EL_MINI,                     /* EasyLink EL-MINI */
+       ATH79_MACH_ENS202EXT,                   /* EnGenius ENS202EXT */
+       ATH79_MACH_EPG5000,                     /* EnGenius EPG5000 */
+       ATH79_MACH_ESR1750,                     /* EnGenius ESR1750 */
+       ATH79_MACH_ESR900,                      /* EnGenius ESR900 */
+       ATH79_MACH_EW_BALIN,                    /* embedded wireless Balin Platform */
+       ATH79_MACH_EW_DORIN,                    /* embedded wireless Dorin Platform */
+       ATH79_MACH_EW_DORIN_ROUTER,             /* embedded wireless Dorin Router Platform */
+       ATH79_MACH_F9K1115V2,                   /* Belkin AC1750DB */
+       ATH79_MACH_FRITZ300E,                   /* AVM FRITZ!WLAN Repeater 300E */
+       ATH79_MACH_FRITZ4020,                   /* AVM FRITZ!Box 4020 */
+       ATH79_MACH_FRITZ450E,                   /* AVM FRITZ!WLAN Repeater 450E */
+       ATH79_MACH_GL_AR150,                    /* GL-AR150 support */
+       ATH79_MACH_GL_AR300,                    /* GL-AR300 */
+       ATH79_MACH_GL_AR300M,                   /* GL-AR300M */
+       ATH79_MACH_GL_AR750,                    /* GL.iNet GL-AR750 */
+       ATH79_MACH_GL_AR750S,                   /* GL.iNet GL-AR750S */
+       ATH79_MACH_GL_DOMINO,                   /* Domino */
+       ATH79_MACH_GL_INET,                     /* GL-CONNECT GL-INET */
+       ATH79_MACH_GL_MIFI,                     /* GL-MIFI support */
+       ATH79_MACH_GL_USB150,                   /* GL.iNet GL-USB150 */
+       ATH79_MACH_GS_MINIBOX_V1,               /* GainStrong MiniBox V1.0 */
+       ATH79_MACH_GS_MINIBOX_V32,              /* Gainstrong MiniBox V3.2 */
+       ATH79_MACH_GS_OOLITE_V1,                /* GainStrong Oolite V1.0 */
+       ATH79_MACH_GS_OOLITE_V5_2,              /* GainStrong Oolite V5.2 */
+       ATH79_MACH_GS_OOLITE_V5_2_DEV,          /* GainStrong Oolite V5.2-Dev */
+       ATH79_MACH_HIVEAP_121,                  /* Aerohive HiveAP-121*/
+       ATH79_MACH_HIWIFI_HC6361,               /* HiWiFi HC6361 */
+       ATH79_MACH_HORNET_UB,                   /* ALFA Networks Hornet-UB */
+       ATH79_MACH_JA76PF,                      /* jjPlus JA76PF */
+       ATH79_MACH_JA76PF2,                     /* jjPlus JA76PF2 */
+       ATH79_MACH_JWAP003,                     /* jjPlus JWAP003 */
+       ATH79_MACH_JWAP230,                     /* jjPlus JWAP230 */
+       ATH79_MACH_KOALA,                       /* OCEDO Koala */
+       ATH79_MACH_LAN_TURTLE,                  /* Hak5 LAN Turtle */
+       ATH79_MACH_LIMA,                        /* 8devices Lima */
+       ATH79_MACH_MC_MAC1200R,                 /* MERCURY MAC1200R */
+       ATH79_MACH_MR12,                        /* Cisco Meraki MR12 */
+       ATH79_MACH_MR16,                        /* Cisco Meraki MR16 */
+       ATH79_MACH_MR1750,                      /* OpenMesh MR1750 */
+       ATH79_MACH_MR1750V2,                    /* OpenMesh MR1750v2 */
+       ATH79_MACH_MR18,                        /* Cisco Meraki MR18 */
+       ATH79_MACH_MR600,                       /* OpenMesh MR600 */
+       ATH79_MACH_MR600V2,                     /* OpenMesh MR600v2 */
+       ATH79_MACH_MR900,                       /* OpenMesh MR900 */
+       ATH79_MACH_MR900v2,                     /* OpenMesh MR900v2 */
+       ATH79_MACH_MYNET_N600,                  /* WD My Net N600 */
+       ATH79_MACH_MYNET_N750,                  /* WD My Net N750 */
+       ATH79_MACH_MYNET_REXT,                  /* WD My Net Wi-Fi Range Extender */
+       ATH79_MACH_MZK_W04NU,                   /* Planex MZK-W04NU */
+       ATH79_MACH_MZK_W300NH,                  /* Planex MZK-W300NH */
+       ATH79_MACH_N5Q,                         /* ALFA Network N5Q */
+       ATH79_MACH_NBG460N,                     /* Zyxel NBG460N/550N/550NH */
+       ATH79_MACH_NBG6616,                     /* Zyxel NBG6616 */
+       ATH79_MACH_NBG6716,                     /* Zyxel NBG6716 */
+       ATH79_MACH_OM2P,                        /* OpenMesh OM2P */
+       ATH79_MACH_OM2Pv2,                      /* OpenMesh OM2Pv2 */
+       ATH79_MACH_OM2Pv4,                      /* OpenMesh OM2Pv4 */
+       ATH79_MACH_OM2P_HS,                     /* OpenMesh OM2P-HS */
+       ATH79_MACH_OM2P_HSv2,                   /* OpenMesh OM2P-HSv2 */
+       ATH79_MACH_OM2P_HSv3,                   /* OpenMesh OM2P-HSv3 */
+       ATH79_MACH_OM2P_HSv4,                   /* OpenMesh OM2P-HSv4 */
+       ATH79_MACH_OM2P_LC,                     /* OpenMesh OM2P-LC */
+       ATH79_MACH_OM5P,                        /* OpenMesh OM5P */
+       ATH79_MACH_OM5P_AC,                     /* OpenMesh OM5P-AC */
+       ATH79_MACH_OM5P_ACv2,                   /* OpenMesh OM5P-ACv2 */
+       ATH79_MACH_OM5P_AN,                     /* OpenMesh OM5P-AN */
+       ATH79_MACH_OMY_G1,                      /* OMYlink OMY-G1 */
+       ATH79_MACH_OMY_X1,                      /* OMYlink OMY-X1 */
+       ATH79_MACH_ONION_OMEGA,                 /* ONION OMEGA */
+       ATH79_MACH_PACKET_SQUIRREL,             /* Hak5 Packet Squirrel */
+       ATH79_MACH_PB42,                        /* Atheros PB42 */
+       ATH79_MACH_PB44,                        /* Atheros PB44 reference board */
+       ATH79_MACH_PQI_AIR_PEN,                 /* PQI Air Pen */
+       ATH79_MACH_QIHOO_C301,                  /* Qihoo 360 C301 */
+       ATH79_MACH_R36A,                        /* ALFA Network R36A */
+       ATH79_MACH_R602N,                       /* P&W R602N */
+       ATH79_MACH_R6100,                       /* NETGEAR R6100 */
+       ATH79_MACH_RAMBUTAN,                    /* 8devices Rambutan */
+       ATH79_MACH_RB_2011G,                    /* Mikrotik RouterBOARD 2011UAS-2HnD */
+       ATH79_MACH_RB_2011L,                    /* Mikrotik RouterBOARD 2011L */
+       ATH79_MACH_RB_2011R5,                   /* Mikrotik RouterBOARD 2011UiAS(-2Hnd) */
+       ATH79_MACH_RB_2011US,                   /* Mikrotik RouterBOARD 2011UAS */
+       ATH79_MACH_RB_411,                      /* MikroTik RouterBOARD 411/411A/411AH */
+       ATH79_MACH_RB_411U,                     /* MikroTik RouterBOARD 411U */
+       ATH79_MACH_RB_433,                      /* MikroTik RouterBOARD 433/433AH */
+       ATH79_MACH_RB_433U,                     /* MikroTik RouterBOARD 433UAH */
+       ATH79_MACH_RB_435G,                     /* MikroTik RouterBOARD 435G */
+       ATH79_MACH_RB_450,                      /* MikroTik RouterBOARD 450 */
+       ATH79_MACH_RB_450G,                     /* MikroTik RouterBOARD 450G */
+       ATH79_MACH_RB_493,                      /* Mikrotik RouterBOARD 493/493AH */
+       ATH79_MACH_RB_493G,                     /* Mikrotik RouterBOARD 493G */
+       ATH79_MACH_RB_711GR100,                 /* Mikrotik RouterBOARD 911/912 boards */
+       ATH79_MACH_RB_750,                      /* MikroTik RouterBOARD 750 */
+       ATH79_MACH_RB_750G_R3,                  /* MikroTik RouterBOARD 750GL */
+       ATH79_MACH_RB_750UPR2,                  /* MikroTik RouterBOARD 750UP r2 */
+       ATH79_MACH_RB_751,                      /* MikroTik RouterBOARD 751 */
+       ATH79_MACH_RB_751G,                     /* Mikrotik RouterBOARD 751G */
+       ATH79_MACH_RB_911L,                     /* Mikrotik RouterBOARD 911-2Hn/911-5Hn boards */
+       ATH79_MACH_RB_922GS,                    /* Mikrotik RouterBOARD 911/922GS boards */
+       ATH79_MACH_RB_931,                      /* MikroTik RouterBOARD 931-2nD */
+       ATH79_MACH_RB_941,                      /* MikroTik RouterBOARD 941-2nD */
+       ATH79_MACH_RB_951G,                     /* Mikrotik RouterBOARD 951G */
+       ATH79_MACH_RB_951U,                     /* Mikrotik RouterBOARD 951Ui-2HnD */
+       ATH79_MACH_RB_952,                      /* MikroTik RouterBOARD 951Ui-2nD / 952Ui-5ac2nD */
+       ATH79_MACH_RB_962,                      /* MikroTik RouterBOARD 962UiGS-5HacT2HnT */
+       ATH79_MACH_RB_CAP,                      /* Mikrotik RouterBOARD cAP2nD */
+       ATH79_MACH_RB_LHG5,                     /* Mikrotik RouterBOARD LHG5 */
+       ATH79_MACH_RB_MAP,                      /* Mikrotik RouterBOARD mAP2nD */
+       ATH79_MACH_RB_MAPL,                     /* Mikrotik RouterBOARD mAP L-2nD */
+       ATH79_MACH_RB_WAP,                      /* Mikrotik RouterBOARD wAP2nD */
+       ATH79_MACH_RB_WAPR,                     /* Mikrotik RouterBOARD wAPR2nD */
+       ATH79_MACH_RB_WAPAC,                    /* Mikrotik RouterBOARD wAPG-5HacT2HnD */
+       ATH79_MACH_RB_SXTLITE2ND,               /* Mikrotik RouterBOARD SXT Lite 2nD */
+       ATH79_MACH_RB_SXTLITE5ND,               /* Mikrotik RouterBOARD SXT Lite 5nD */
+       ATH79_MACH_RE355,                       /* TP-LINK RE355 */
+       ATH79_MACH_RE450,                       /* TP-LINK RE450 */
+       ATH79_MACH_RME_EG200,                   /* eTactica EG200 */
+       ATH79_MACH_RUT9XX,                      /* Teltonika RUT900 series */
+       ATH79_MACH_RW2458N,                     /* Redwave RW2458N */
+       ATH79_MACH_SC1750,                      /* Abicom SC1750 */
+       ATH79_MACH_SC300M,                      /* Abicom SC300M */
+       ATH79_MACH_SC450,                       /* Abicom SC450 */
+       ATH79_MACH_SMART_300,                   /* NC-LINK SMART-300 */
+       ATH79_MACH_SOM9331,                     /* OpenEmbed SOM9331 */
+       ATH79_MACH_SR3200,                      /* YunCore SR3200 */
+       ATH79_MACH_T830,                        /* YunCore T830 */
+       ATH79_MACH_TELLSTICK_ZNET_LITE,         /* TellStick ZNet Lite */
+       ATH79_MACH_TEW_632BRP,                  /* TRENDnet TEW-632BRP */
+       ATH79_MACH_TEW_673GRU,                  /* TRENDnet TEW-673GRU */
+       ATH79_MACH_TEW_712BR,                   /* TRENDnet TEW-712BR */
+       ATH79_MACH_TEW_732BR,                   /* TRENDnet TEW-732BR */
+       ATH79_MACH_TEW_823DRU,                  /* TRENDnet TEW-823DRU */
+       ATH79_MACH_TL_MR10U,                    /* TP-LINK TL-MR10U */
+       ATH79_MACH_TL_MR11U,                    /* TP-LINK TL-MR11U */
+       ATH79_MACH_TL_MR13U,                    /* TP-LINK TL-MR13U */
+       ATH79_MACH_TL_MR3020,                   /* TP-LINK TL-MR3020 */
+       ATH79_MACH_TL_MR3040,                   /* TP-LINK TL-MR3040 */
+       ATH79_MACH_TL_MR3040_V2,                /* TP-LINK TL-MR3040 v2 */
+       ATH79_MACH_TL_MR3220,                   /* TP-LINK TL-MR3220 */
+       ATH79_MACH_TL_MR3220_V2,                /* TP-LINK TL-MR3220 v2 */
+       ATH79_MACH_TL_MR3420,                   /* TP-LINK TL-MR3420 */
+       ATH79_MACH_TL_MR3420_V2,                /* TP-LINK TL-MR3420 v2 */
+       ATH79_MACH_TL_MR6400,                   /* TP-LINK TL-MR6400 */
+       ATH79_MACH_TL_WA701ND_V2,               /* TP-LINK TL-WA701ND v2 */
+       ATH79_MACH_TL_WA7210N_V2,               /* TP-LINK TL-WA7210N v2 */
+       ATH79_MACH_TL_WA750RE,                  /* TP-LINK TL-WA750RE */
+       ATH79_MACH_TL_WA7510N_V1,               /* TP-LINK TL-WA7510N v1 */
+       ATH79_MACH_TL_WA801ND_V2,               /* TP-LINK TL-WA801ND v2 */
+       ATH79_MACH_TL_WA801ND_V3,               /* TP-LINK TL-WA801ND v3 */
+       ATH79_MACH_TL_WA830RE_V2,               /* TP-LINK TL-WA830RE v2 */
+       ATH79_MACH_TL_WA850RE,                  /* TP-LINK TL-WA850RE */
+       ATH79_MACH_TL_WA850RE_V2,               /* TP-LINK TL-WA850RE v2 */
+       ATH79_MACH_TL_WA855RE_V1,               /* TP-LINK TL-WA855RE v1 */
+       ATH79_MACH_TL_WA860RE,                  /* TP-LINK TL-WA860RE */
+       ATH79_MACH_TL_WA901ND,                  /* TP-LINK TL-WA901ND */
+       ATH79_MACH_TL_WA901ND_V2,               /* TP-LINK TL-WA901ND v2 */
+       ATH79_MACH_TL_WA901ND_V3,               /* TP-LINK TL-WA901ND v3 */
+       ATH79_MACH_TL_WA901ND_V4,               /* TP-LINK TL-WA901ND v4 */
+       ATH79_MACH_TL_WA901ND_V5,               /* TP-LINK TL-WA901ND v5 */
+       ATH79_MACH_TL_WDR3320_V2,               /* TP-LINK TL-WDR3320 v2 */
+       ATH79_MACH_TL_WDR3500,                  /* TP-LINK TL-WDR3500 */
+       ATH79_MACH_TL_WDR4300,                  /* TP-LINK TL-WDR4300 */
+       ATH79_MACH_TL_WDR4900_V2,               /* TP-LINK TL-WDR4900 v2 */
+       ATH79_MACH_TL_WDR6500_V2,               /* TP-LINK TL-WDR6500 v2 */
+       ATH79_MACH_TL_WPA8630,                  /* TP-Link TL-WPA8630 */
+       ATH79_MACH_TL_WR1041N_V2,               /* TP-LINK TL-WR1041N v2 */
+       ATH79_MACH_TL_WR1043N_V5,               /* TP-LINK TL-WR1043N v5 */
+       ATH79_MACH_TL_WR1043ND,                 /* TP-LINK TL-WR1043ND */
+       ATH79_MACH_TL_WR1043ND_V2,              /* TP-LINK TL-WR1043ND v2 */
+       ATH79_MACH_TL_WR1043ND_V4,              /* TP-LINK TL-WR1043ND v4 */
+       ATH79_MACH_TL_WR2543N,                  /* TP-LINK TL-WR2543N/ND */
+       ATH79_MACH_TL_WR703N,                   /* TP-LINK TL-WR703N */
+       ATH79_MACH_TL_WR710N,                   /* TP-LINK TL-WR710N */
+       ATH79_MACH_TL_WR720N_V3,                /* TP-LINK TL-WR720N v3/v4 */
+       ATH79_MACH_TL_WR740N_V6,                /* TP-LINK TL-WR740N/ND v6 */
+       ATH79_MACH_TL_WR741ND,                  /* TP-LINK TL-WR741ND */
+       ATH79_MACH_TL_WR741ND_V4,               /* TP-LINK TL-WR741ND v4 */
+       ATH79_MACH_TL_WR802N_V1,                /* TP-LINK TL-WR802N v1 */
+       ATH79_MACH_TL_WR802N_V2,                /* TP-LINK TL-WR802N v2 */
+       ATH79_MACH_TL_WR810N,                   /* TP-LINK TL-WR810N */
+       ATH79_MACH_TL_WR810N_V2,                /* TP-LINK TL-WR810N v2 */
+       ATH79_MACH_TL_WR840N_V2,                /* TP-LINK TL-WR840N v2 */
+       ATH79_MACH_TL_WR840N_V3,                /* TP-LINK TL-WR840N v3 */
+       ATH79_MACH_TL_WR841N_V1,                /* TP-LINK TL-WR841N v1 */
+       ATH79_MACH_TL_WR841N_V11,               /* TP-LINK TL-WR841N/ND v11 */
+       ATH79_MACH_TL_WR841N_V7,                /* TP-LINK TL-WR841N/ND v7 */
+       ATH79_MACH_TL_WR841N_V8,                /* TP-LINK TL-WR841N/ND v8 */
+       ATH79_MACH_TL_WR841N_V9,                /* TP-LINK TL-WR841N/ND v9 */
+       ATH79_MACH_TL_WR842N_V2,                /* TP-LINK TL-WR842N/ND v2 */
+       ATH79_MACH_TL_WR842N_V3,                /* TP-LINK TL-WR842N/ND v3 */
+       ATH79_MACH_TL_WR902AC_V1,               /* TP-LINK TL-WR902AC v1 */
+       ATH79_MACH_TL_WR941ND,                  /* TP-LINK TL-WR941ND */
+       ATH79_MACH_TL_WR941ND_V5,               /* TP-LINK TL-WR941ND v5 */
+       ATH79_MACH_TL_WR941ND_V6,               /* TP-LINK TL-WR941ND v6 */
+       ATH79_MACH_TL_WR940N_V4,                /* TP-LINK TL-WR940N v4 */
+       ATH79_MACH_TL_WR940N_V6,                /* TP-LINK TL-WR940N v6 */
+       ATH79_MACH_TL_WR942N_V1,                /* TP-LINK TL-WR942N v1 */
+       ATH79_MACH_TS_D084,                     /* PISEN TS-D084 */
+       ATH79_MACH_TUBE2H,                      /* Alfa Network Tube2H */
+       ATH79_MACH_UBNT_AIRGW,                  /* Ubiquiti AirGateway */
+       ATH79_MACH_UBNT_AIRGWP,                 /* Ubiquiti AirGateway Pro */
+       ATH79_MACH_UBNT_AIRROUTER,              /* Ubiquiti AirRouter */
+       ATH79_MACH_UBNT_BULLET_M,               /* Ubiquiti Bullet M */
+       ATH79_MACH_UBNT_BULLET_M_XW,            /* Ubiquiti Bullet M XW */
+       ATH79_MACH_UBNT_LBE_M5,                 /* Ubiquiti Litebeam M5 */
+       ATH79_MACH_UBNT_LOCO_M_XW,              /* Ubiquiti Loco M XW */
+       ATH79_MACH_UBNT_LSSR71,                 /* Ubiquiti LS-SR71 */
+       ATH79_MACH_UBNT_LSX,                    /* Ubiquiti LSX */
+       ATH79_MACH_UBNT_NANO_M,                 /* Ubiquiti NanoStation M */
+       ATH79_MACH_UBNT_NANO_M_XW,              /* Ubiquiti NanoStation M XW */
+       ATH79_MACH_UBNT_ROCKET_M,               /* Ubiquiti Rocket M */
+       ATH79_MACH_UBNT_ROCKET_M_TI,            /* Ubiquiti Rocket M TI */
+       ATH79_MACH_UBNT_ROCKET_M_XW,            /* Ubiquiti Rocket M XW */
+       ATH79_MACH_UBNT_RS,                     /* Ubiquiti RouterStation */
+       ATH79_MACH_UBNT_RSPRO,                  /* Ubiquiti RouterStation Pro */
+       ATH79_MACH_UBNT_UAP_PRO,                /* Ubiquiti UniFi AP Pro */
+       ATH79_MACH_UBNT_UNIFI,                  /* Ubiquiti Unifi */
+       ATH79_MACH_UBNT_UNIFIAC_LITE,           /* Ubiquiti Unifi AC LITE/LR/MESH */
+       ATH79_MACH_UBNT_UNIFIAC_PRO,            /* Ubiquiti Unifi AC PRO/MESH PRO */
+       ATH79_MACH_UBNT_UNIFI_OUTDOOR,          /* Ubiquiti UnifiAP Outdoor */
+       ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS,     /* Ubiquiti UnifiAP Outdoor+ */
+       ATH79_MACH_UBNT_XM,                     /* Ubiquiti Networks XM board rev 1.0 */
+       ATH79_MACH_WAM250,                      /* Samsung WAM250 */
+       ATH79_MACH_WBS210,                      /* TP-LINK WBS210 */
+       ATH79_MACH_WBS510,                      /* TP-LINK WBS510 */
+       ATH79_MACH_WEIO,                        /* WeIO board */
+       ATH79_MACH_WHR_G301N,                   /* Buffalo WHR-G301N */
+       ATH79_MACH_WHR_HP_G300N,                /* Buffalo WHR-HP-G300N */
+       ATH79_MACH_WHR_HP_GN,                   /* Buffalo WHR-HP-GN */
+       ATH79_MACH_WIFI_PINEAPPLE_NANO,         /* Hak5 WiFi Pineapple NANO */
+       ATH79_MACH_WLAE_AG300N,                 /* Buffalo WLAE-AG300N */
+       ATH79_MACH_WLR8100,                     /* SITECOM WLR-8100 */
+       ATH79_MACH_WNDAP360,                    /* NETGEAR WNDAP360 */
+       ATH79_MACH_WNDR3700,                    /* NETGEAR WNDR3700/WNDR3800/WNDRMAC */
+       ATH79_MACH_WNDR3700_V4,                 /* NETGEAR WNDR3700v4 */
+       ATH79_MACH_WNDR4300,                    /* NETGEAR WNDR4300 */
+       ATH79_MACH_WNR1000_V2,                  /* NETGEAR WNR1000 v2 */
+       ATH79_MACH_WNR2000,                     /* NETGEAR WNR2000 */
+       ATH79_MACH_WNR2000_V3,                  /* NETGEAR WNR2000 v3 */
+       ATH79_MACH_WNR2000_V4,                  /* NETGEAR WNR2000 v4 */
+       ATH79_MACH_WNR2200,                     /* NETGEAR WNR2200 */
+       ATH79_MACH_WNR612_V2,                   /* NETGEAR WNR612 v2 */
+       ATH79_MACH_WP543,                       /* Compex WP543 */
+       ATH79_MACH_WPE72,                       /* Compex WPE72 */
+       ATH79_MACH_WPJ342,                      /* Compex WPJ342 */
+       ATH79_MACH_WPJ344,                      /* Compex WPJ344 */
+       ATH79_MACH_WPJ531,                      /* Compex WPJ531 */
+       ATH79_MACH_WPJ558,                      /* Compex WPJ558 */
+       ATH79_MACH_WPJ563,                      /* Compex WPJ563 */
+       ATH79_MACH_WPN824N,                     /* NETGEAR WPN824N */
+       ATH79_MACH_WRT160NL,                    /* Linksys WRT160NL */
+       ATH79_MACH_WRT400N,                     /* Linksys WRT400N */
+       ATH79_MACH_WRTNODE2Q,                   /* WRTnode2Q */
+       ATH79_MACH_WZR_450HP2,                  /* Buffalo WZR-450HP2 */
+       ATH79_MACH_WZR_HP_AG300H,               /* Buffalo WZR-HP-AG300H */
+       ATH79_MACH_WZR_HP_G300NH,               /* Buffalo WZR-HP-G300NH */
+       ATH79_MACH_WZR_HP_G300NH2,              /* Buffalo WZR-HP-G300NH2 */
+       ATH79_MACH_WZR_HP_G450H,                /* Buffalo WZR-HP-G450H */
+       ATH79_MACH_XD3200,                      /* YunCore XD3200 */
+       ATH79_MACH_Z1,                          /* Cisco Meraki Z1 */
+       ATH79_MACH_ZBT_WE1526,                  /* Zbtlink ZBT-WE1526 */
+       ATH79_MACH_ZCN_1523H_2,                 /* Zcomax ZCN-1523H-2-xx */
+       ATH79_MACH_ZCN_1523H_5,                 /* Zcomax ZCN-1523H-5-xx */
+};
+
+#endif /* _ATH79_MACHTYPE_H */
diff --git a/target/linux/ar71xx/generic/config-default b/target/linux/ar71xx/generic/config-default
new file mode 100644 (file)
index 0000000..85b58db
--- /dev/null
@@ -0,0 +1,228 @@
+CONFIG_ATH79_DEV_AP9X_PCI=y
+CONFIG_ATH79_DEV_ETH=y
+CONFIG_ATH79_DEV_GPIO_BUTTONS=y
+CONFIG_ATH79_DEV_LEDS_GPIO=y
+CONFIG_ATH79_DEV_M25P80=y
+CONFIG_ATH79_DEV_NFC=y
+CONFIG_ATH79_DEV_SPI=y
+CONFIG_ATH79_DEV_USB=y
+CONFIG_ATH79_DEV_WMAC=y
+CONFIG_ATH79_MACH_A60=y
+CONFIG_ATH79_MACH_ALFA_AP120C=y
+CONFIG_ATH79_MACH_ALFA_AP96=y
+CONFIG_ATH79_MACH_ALFA_NX=y
+CONFIG_ATH79_MACH_ALL0258N=y
+CONFIG_ATH79_MACH_ALL0315N=y
+CONFIG_ATH79_MACH_ANTMINER_S1=y
+CONFIG_ATH79_MACH_ANTMINER_S3=y
+CONFIG_ATH79_MACH_ANTROUTER_R1=y
+CONFIG_ATH79_MACH_AP121=y
+CONFIG_ATH79_MACH_AP121F=y
+CONFIG_ATH79_MACH_AP132=y
+CONFIG_ATH79_MACH_AP136=y
+CONFIG_ATH79_MACH_AP143=y
+CONFIG_ATH79_MACH_AP147=y
+CONFIG_ATH79_MACH_AP152=y
+CONFIG_ATH79_MACH_AP531B0=y
+CONFIG_ATH79_MACH_AP83=y
+CONFIG_ATH79_MACH_AP90Q=y
+CONFIG_ATH79_MACH_AP91_5G=y
+CONFIG_ATH79_MACH_AP96=y
+CONFIG_ATH79_MACH_ARCHER_C25_V1=y
+CONFIG_ATH79_MACH_ARCHER_C58_V1=y
+CONFIG_ATH79_MACH_ARCHER_C59_V1=y
+CONFIG_ATH79_MACH_ARCHER_C60_V1=y
+CONFIG_ATH79_MACH_ARCHER_C60_V2=y
+CONFIG_ATH79_MACH_ARCHER_C7=y
+CONFIG_ATH79_MACH_ARDUINO_YUN=y
+CONFIG_ATH79_MACH_AW_NR580=y
+CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y
+CONFIG_ATH79_MACH_BSB=y
+CONFIG_ATH79_MACH_C55=y
+CONFIG_ATH79_MACH_CAP324=y
+CONFIG_ATH79_MACH_CAP4200AG=y
+CONFIG_ATH79_MACH_CARAMBOLA2=y
+CONFIG_ATH79_MACH_CF_E316N_V2=y
+CONFIG_ATH79_MACH_CF_E320N_V2=y
+CONFIG_ATH79_MACH_CF_E355AC=y
+CONFIG_ATH79_MACH_CF_E375AC=y
+CONFIG_ATH79_MACH_CF_E380AC_V1=y
+CONFIG_ATH79_MACH_CF_E380AC_V2=y
+CONFIG_ATH79_MACH_CF_E520N=y
+CONFIG_ATH79_MACH_CF_E530N=y
+CONFIG_ATH79_MACH_CPE505N=y
+CONFIG_ATH79_MACH_CPE510=y
+CONFIG_ATH79_MACH_CPE830=y
+CONFIG_ATH79_MACH_CPE870=y
+CONFIG_ATH79_MACH_CR3000=y
+CONFIG_ATH79_MACH_CR5000=y
+CONFIG_ATH79_MACH_DAP_1330_A1=y
+CONFIG_ATH79_MACH_DAP_2695_A1=y
+CONFIG_ATH79_MACH_DB120=y
+CONFIG_ATH79_MACH_DGL_5500_A1=y
+CONFIG_ATH79_MACH_DHP_1565_A1=y
+CONFIG_ATH79_MACH_DIR_505_A1=y
+CONFIG_ATH79_MACH_DIR_825_B1=y
+CONFIG_ATH79_MACH_DIR_825_C1=y
+CONFIG_ATH79_MACH_DIR_869_A1=y
+CONFIG_ATH79_MACH_DLAN_HOTSPOT=y
+CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y
+CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y
+CONFIG_ATH79_MACH_DR342=y
+CONFIG_ATH79_MACH_DR344=y
+CONFIG_ATH79_MACH_DR531=y
+CONFIG_ATH79_MACH_DRAGINO2=y
+CONFIG_ATH79_MACH_E1700AC_V2=y
+CONFIG_ATH79_MACH_E2100L=y
+CONFIG_ATH79_MACH_E558_V2=y
+CONFIG_ATH79_MACH_E600G_V2=y
+CONFIG_ATH79_MACH_E750A_V4=y
+CONFIG_ATH79_MACH_E750G_V8=y
+CONFIG_ATH79_MACH_EAP120=y
+CONFIG_ATH79_MACH_EAP300V2=y
+CONFIG_ATH79_MACH_EAP7660D=y
+CONFIG_ATH79_MACH_EL_M150=y
+CONFIG_ATH79_MACH_EL_MINI=y
+CONFIG_ATH79_MACH_EPG5000=y
+CONFIG_ATH79_MACH_ESR1750=y
+CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
+CONFIG_ATH79_MACH_EW_DORIN=y
+CONFIG_ATH79_MACH_FRITZ300E=y
+CONFIG_ATH79_MACH_FRITZ4020=y
+CONFIG_ATH79_MACH_FRITZ450E=y
+CONFIG_ATH79_MACH_GL_AR150=y
+CONFIG_ATH79_MACH_GL_AR300=y
+CONFIG_ATH79_MACH_GL_AR300M=y
+CONFIG_ATH79_MACH_GL_AR750=y
+CONFIG_ATH79_MACH_GL_AR750S=y
+CONFIG_ATH79_MACH_GL_DOMINO=y
+CONFIG_ATH79_MACH_GL_INET=y
+CONFIG_ATH79_MACH_GL_MIFI=y
+CONFIG_ATH79_MACH_GL_USB150=y
+CONFIG_ATH79_MACH_GS_MINIBOX_V32=y
+CONFIG_ATH79_MACH_GS_OOLITE_V1=y
+CONFIG_ATH79_MACH_GS_OOLITE_V5_2=y
+CONFIG_ATH79_MACH_HIWIFI_HC6361=y
+CONFIG_ATH79_MACH_HORNET_UB=y
+CONFIG_ATH79_MACH_JA76PF=y
+CONFIG_ATH79_MACH_JWAP003=y
+CONFIG_ATH79_MACH_JWAP230=y
+CONFIG_ATH79_MACH_KOALA=y
+CONFIG_ATH79_MACH_LAN_TURTLE=y
+CONFIG_ATH79_MACH_LIMA=y
+CONFIG_ATH79_MACH_MC_MAC1200R=y
+CONFIG_ATH79_MACH_MR12=y
+CONFIG_ATH79_MACH_MR16=y
+CONFIG_ATH79_MACH_MR1750=y
+CONFIG_ATH79_MACH_MR600=y
+CONFIG_ATH79_MACH_MR900=y
+CONFIG_ATH79_MACH_MYNET_N600=y
+CONFIG_ATH79_MACH_MYNET_N750=y
+CONFIG_ATH79_MACH_MYNET_REXT=y
+CONFIG_ATH79_MACH_MZK_W04NU=y
+CONFIG_ATH79_MACH_MZK_W300NH=y
+CONFIG_ATH79_MACH_N5Q=y
+CONFIG_ATH79_MACH_NBG6716=y
+CONFIG_ATH79_MACH_OM2P=y
+CONFIG_ATH79_MACH_OM5P=y
+CONFIG_ATH79_MACH_OM5P_AC=y
+CONFIG_ATH79_MACH_OM5P_ACv2=y
+CONFIG_ATH79_MACH_OMY_G1=y
+CONFIG_ATH79_MACH_OMY_X1=y
+CONFIG_ATH79_MACH_ONION_OMEGA=y
+CONFIG_ATH79_MACH_PB42=y
+CONFIG_ATH79_MACH_PB44=y
+CONFIG_ATH79_MACH_PQI_AIR_PEN=y
+CONFIG_ATH79_MACH_QIHOO_C301=y
+CONFIG_ATH79_MACH_R36A=y
+CONFIG_ATH79_MACH_R602N=y
+CONFIG_ATH79_MACH_RE355=y
+CONFIG_ATH79_MACH_RE450=y
+CONFIG_ATH79_MACH_RME_EG200=y
+CONFIG_ATH79_MACH_RUT9XX=y
+CONFIG_ATH79_MACH_RW2458N=y
+CONFIG_ATH79_MACH_SC1750=y
+CONFIG_ATH79_MACH_SC300M=y
+CONFIG_ATH79_MACH_SC450=y
+CONFIG_ATH79_MACH_SMART_300=y
+CONFIG_ATH79_MACH_SOM9331=y
+CONFIG_ATH79_MACH_SR3200=y
+CONFIG_ATH79_MACH_T830=y
+CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE=y
+CONFIG_ATH79_MACH_TEW_673GRU=y
+CONFIG_ATH79_MACH_TEW_732BR=y
+CONFIG_ATH79_MACH_TEW_823DRU=y
+CONFIG_ATH79_MACH_TL_MR3X20=y
+CONFIG_ATH79_MACH_TL_MR6400=y
+CONFIG_ATH79_MACH_TL_WDR3500=y
+CONFIG_ATH79_MACH_TL_WDR4300=y
+CONFIG_ATH79_MACH_TL_WDR6500_V2=y
+CONFIG_ATH79_MACH_TL_WPA8630=y
+CONFIG_ATH79_MACH_TL_WR1043ND=y
+CONFIG_ATH79_MACH_TL_WR1043ND_V2=y
+CONFIG_ATH79_MACH_TL_WR1043ND_V4=y
+CONFIG_ATH79_MACH_TL_WR1043N_V5=y
+CONFIG_ATH79_MACH_TL_WR2543N=y
+CONFIG_ATH79_MACH_TL_WR703N=y
+CONFIG_ATH79_MACH_TL_WR720N_V3=y
+CONFIG_ATH79_MACH_TL_WR810N=y
+CONFIG_ATH79_MACH_TL_WR810N_V2=y
+CONFIG_ATH79_MACH_TL_WR841N_V8=y
+CONFIG_ATH79_MACH_TL_WR841N_V9=y
+CONFIG_ATH79_MACH_TL_WR902AC_V1=y
+CONFIG_ATH79_MACH_TL_WR942N_V1=y
+CONFIG_ATH79_MACH_TS_D084=y
+CONFIG_ATH79_MACH_TUBE2H=y
+CONFIG_ATH79_MACH_UBNT=y
+CONFIG_ATH79_MACH_UBNT_UNIFIAC=y
+CONFIG_ATH79_MACH_UBNT_XM=y
+CONFIG_ATH79_MACH_WAM250=y
+CONFIG_ATH79_MACH_WEIO=y
+CONFIG_ATH79_MACH_WHR_HP_G300N=y
+CONFIG_ATH79_MACH_WIFI_PINEAPPLE_NANO=y
+CONFIG_ATH79_MACH_WLAE_AG300N=y
+CONFIG_ATH79_MACH_WLR8100=y
+CONFIG_ATH79_MACH_WNDAP360=y
+CONFIG_ATH79_MACH_WNDR3700=y
+CONFIG_ATH79_MACH_WNR2200=y
+CONFIG_ATH79_MACH_WP543=y
+CONFIG_ATH79_MACH_WPE72=y
+CONFIG_ATH79_MACH_WPJ342=y
+CONFIG_ATH79_MACH_WPJ344=y
+CONFIG_ATH79_MACH_WPJ531=y
+CONFIG_ATH79_MACH_WPJ558=y
+CONFIG_ATH79_MACH_WPJ563=y
+CONFIG_ATH79_MACH_WRT160NL=y
+CONFIG_ATH79_MACH_WRT400N=y
+CONFIG_ATH79_MACH_WRTNODE2Q=y
+CONFIG_ATH79_MACH_WZR_450HP2=y
+CONFIG_ATH79_MACH_WZR_HP_AG300H=y
+CONFIG_ATH79_MACH_WZR_HP_G300NH=y
+CONFIG_ATH79_MACH_WZR_HP_G300NH2=y
+CONFIG_ATH79_MACH_WZR_HP_G450H=y
+CONFIG_ATH79_MACH_XD3200=y
+CONFIG_ATH79_MACH_ZCN_1523H=y
+CONFIG_ATH79_NVRAM=y
+CONFIG_ATH79_PCI_ATH9K_FIXUP=y
+CONFIG_BLK_MQ_PCI=y
+CONFIG_GPIO_PCA953X=y
+# CONFIG_GPIO_PCA953X_IRQ is not set
+CONFIG_HW_HAS_PCI=y
+# CONFIG_LEDS_WNDR3700_USB is not set
+CONFIG_MYLOADER=y
+CONFIG_PCI=y
+CONFIG_PCI_AR724X=y
+CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_SERIAL_AR933X=y
+CONFIG_SERIAL_AR933X_CONSOLE=y
+CONFIG_SERIAL_AR933X_NR_UARTS=2
+CONFIG_SOC_AR71XX=y
+CONFIG_SOC_AR724X=y
+CONFIG_SOC_AR913X=y
+CONFIG_SOC_AR933X=y
+CONFIG_SOC_AR934X=y
+CONFIG_SOC_QCA953X=y
+CONFIG_SOC_QCA955X=y
+CONFIG_SOC_QCA956X=y
diff --git a/target/linux/ar71xx/image/generic-legacy-devices.mk b/target/linux/ar71xx/image/generic-legacy-devices.mk
new file mode 100644 (file)
index 0000000..7fdd30d
--- /dev/null
@@ -0,0 +1,430 @@
+define LegacyDevice/A60
+   DEVICE_TITLE := OpenMesh A40/A60
+   DEVICE_PACKAGES := om-watchdog kmod-ath10k-ct ath10k-firmware-qca988x-ct \
+       mod-usb-core kmod-usb2
+endef
+LEGACY_DEVICES += A60
+
+define LegacyDevice/ALFANX
+  DEVICE_TITLE := ALFA Network N2/N5 board
+endef
+LEGACY_DEVICES += ALFANX
+
+define LegacyDevice/HORNETUB
+  DEVICE_TITLE := ALFA Network Hornet-UB board (8MB flash, 32MB ram)
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += HORNETUB
+
+define LegacyDevice/TUBE2H8M
+  DEVICE_TITLE := ALFA Network Tube2H board (8MB flash)
+endef
+LEGACY_DEVICES += TUBE2H8M
+
+define LegacyDevice/AP83
+  DEVICE_TITLE := Atheros AP83 reference board
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 \
+         vsc7385-ucode-ap83 vsc7395-ucode-ap83
+endef
+LEGACY_DEVICES += AP83
+
+define LegacyDevice/AP96
+  DEVICE_TITLE := Atheros AP96 reference board
+  DEVICE_PACKAGES := kmod-usb2
+endef
+LEGACY_DEVICES += AP96
+
+define LegacyDevice/WNDAP360
+  DEVICE_TITLE := NETGEAR WNDAP360
+endef
+LEGACY_DEVICES += WNDAP360
+
+define LegacyDevice/ALFAAP120C
+  DEVICE_TITLE := ALFA Network AP120C board
+endef
+LEGACY_DEVICES += ALFAAP120C
+
+define LegacyDevice/ALFAAP96
+  DEVICE_TITLE := ALFA Network AP96 board
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-rtc-pcf2123
+endef
+LEGACY_DEVICES += ALFAAP96
+
+define LegacyDevice/ALL0258N
+  DEVICE_TITLE := Allnet ALL0258N
+  DEVICE_PACKAGES := rssileds
+endef
+LEGACY_DEVICES += ALL0258N
+
+define LegacyDevice/ALL0315N
+  DEVICE_TITLE := Allnet ALL0315N
+  DEVICE_PACKAGES := rssileds
+endef
+LEGACY_DEVICES += ALL0315N
+
+define LegacyDevice/AP121_8M
+  DEVICE_TITLE := Atheros AP121 reference board (8MB flash)
+  DEVICE_PACKAGES := kmod-usb2
+endef
+LEGACY_DEVICES += AP121_8M
+
+define LegacyDevice/AP121_16M
+  DEVICE_TITLE := Atheros AP121 reference board (16MB flash)
+  DEVICE_PACKAGES := kmod-usb2
+endef
+LEGACY_DEVICES += AP121_16M
+
+define LegacyDevice/AP132
+  DEVICE_TITLE := Atheros AP132 reference board
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += AP132
+
+define LegacyDevice/AP135
+  DEVICE_TITLE := Atheros AP135 reference board
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += AP135
+
+define LegacyDevice/AP136_010
+  DEVICE_TITLE := Atheros AP136-010 reference board
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += AP136_010
+
+define LegacyDevice/AP136_020
+  DEVICE_TITLE := Atheros AP136-020 reference board
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += AP136_020
+
+define LegacyDevice/AP143_8M
+  DEVICE_TITLE := Qualcomm Atheros AP143 reference board (8MB flash)
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += AP143_8M
+
+define LegacyDevice/AP143_16M
+  DEVICE_TITLE := Qualcomm Atheros AP143 reference board (16MB flash)
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += AP143_16M
+
+define LegacyDevice/AP147_010
+  DEVICE_TITLE := Qualcomm Atheros AP147-010 reference board
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += AP147_010
+
+define LegacyDevice/AP152_16M
+  DEVICE_TITLE := Qualcomm Atheros AP152 reference board (16MB flash)
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += AP152_16M
+
+define LegacyDevice/BXU2000N2
+  DEVICE_TITLE := BHU BXU2000n-2
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += BXU2000N2
+
+define LegacyDevice/CAP4200AG
+  DEVICE_TITLE := Senao CAP4200AG
+endef
+LEGACY_DEVICES += CAP4200AG
+
+define LegacyDevice/DB120
+  DEVICE_TITLE := Atheros DB120 reference board
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+endef
+LEGACY_DEVICES += DB120
+
+define LegacyDevice/HORNETUBx2
+  DEVICE_TITLE := ALFA Network Hornet-UB-x2 board (16MB flash, 64MB ram)
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += HORNETUBx2
+
+define LegacyDevice/TUBE2H16M
+  DEVICE_TITLE := ALFA Network Tube2H board (16MB flash)
+endef
+LEGACY_DEVICES += TUBE2H16M
+
+define LegacyDevice/DIR505A1
+  DEVICE_TITLE := D-Link DIR-505 rev. A1
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += DIR505A1
+
+define LegacyDevice/DGL5500A1
+  DEVICE_TITLE := D-Link DGL-5500 rev. A1
+  DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct
+endef
+LEGACY_DEVICES += DGL5500A1
+
+define LegacyDevice/TEW823DRU
+  DEVICE_TITLE := TRENDNet TEW-823DRU
+  DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct
+endef
+LEGACY_DEVICES += TEW823DRU
+
+define LegacyDevice/DHP1565A1
+  DEVICE_TITLE := D-Link DHP-1565 rev. A1
+  DEVICE_PACKAGES := kmod-usb2
+endef
+LEGACY_DEVICES += DHP1565A1
+
+define LegacyDevice/DIR825C1
+  DEVICE_TITLE := D-Link DIR-825 rev. C1
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += DIR825C1
+
+define LegacyDevice/DIR835A1
+  DEVICE_TITLE := D-Link DIR-835 rev. A1
+  DEVICE_PACKAGES := kmod-usb2
+endef
+LEGACY_DEVICES += DIR835A1
+
+define LegacyDevice/TEW732BR
+  DEVICE_TITLE := TRENDNet TEW-732BR
+endef
+LEGACY_DEVICES += TEW732BR
+
+define LegacyDevice/WRT160NL
+  DEVICE_TITLE := Linksys WRT160NL
+  DEVICE_PACKAGES := kmod-usb2
+endef
+LEGACY_DEVICES += WRT160NL
+
+define LegacyDevice/MYNETREXT
+  DEVICE_TITLE := Western Digital My Net Wi-Fi Range Extender
+  DEVICE_PACKAGES := rssileds
+endef
+LEGACY_DEVICES += MYNETREXT
+
+define LegacyDevice/DIR825B1
+  DEVICE_TITLE := D-Link DIR-825 rev. B1
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += DIR825B1
+
+define LegacyDevice/TEW673GRU
+  DEVICE_TITLE := TRENDNet TEW-673GRU
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2
+endef
+LEGACY_DEVICES += TEW673GRU
+
+define LegacyDevice/DLRTDEV01
+  DEVICE_TITLE := PowerCloud Systems dlrtdev01 model
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += DLRTDEV01
+
+define LegacyDevice/dLAN_Hotspot
+  DEVICE_TITLE := devolo dLAN Hotspot
+endef
+LEGACY_DEVICES += dLAN_Hotspot
+
+define LegacyDevice/dLAN_pro_500_wp
+  DEVICE_TITLE := devolo dLAN pro 500 Wireless+
+endef
+LEGACY_DEVICES += dLAN_pro_500_wp
+
+define LegacyDevice/dLAN_pro_1200_ac
+  DEVICE_TITLE := devolo dLAN pro 1200+ WiFi ac
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
+endef
+LEGACY_DEVICES += dLAN_pro_1200_ac
+
+define LegacyDevice/ESR900
+  DEVICE_TITLE := EnGenius ESR900
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += ESR900
+
+define LegacyDevice/ESR1750
+  DEVICE_TITLE := EnGenius ESR1750
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage kmod-ath10k-ct ath10k-firmware-qca988x-ct
+endef
+LEGACY_DEVICES += ESR1750
+
+define LegacyDevice/EPG5000
+  DEVICE_TITLE := EnGenius EPG5000
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage kmod-ath10k-ct ath10k-firmware-qca988x-ct
+endef
+LEGACY_DEVICES += EPG5000
+
+define LegacyDevice/WP543_8M
+  DEVICE_TITLE := Compex WP543/WPJ543 (8MB flash)
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2
+endef
+LEGACY_DEVICES += WP543_8M
+
+define LegacyDevice/WP543_16M
+  DEVICE_TITLE := Compex WP543/WPJ543 (16MB flash)
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2
+endef
+LEGACY_DEVICES += WP543_16M
+
+define LegacyDevice/WPE72_8M
+  DEVICE_TITLE := Compex WPE72/WPE72NX (8MB flash)
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2
+endef
+LEGACY_DEVICES += WPE72_8M
+
+define LegacyDevice/WPE72_16M
+  DEVICE_TITLE := Compex WPE72/WPE72NX (16MB flash)
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2
+endef
+LEGACY_DEVICES += WPE72_16M
+
+define LegacyDevice/WNR2200
+  DEVICE_TITLE := NETGEAR WNR2200
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += WNR2200
+
+define LegacyDevice/OM2P
+  DEVICE_TITLE := OpenMesh OM2P/OM2P-HS/OM2P-LC
+  DEVICE_PACKAGES := om-watchdog
+endef
+LEGACY_DEVICES += OM2P
+
+define LegacyDevice/OM5P
+  DEVICE_TITLE := OpenMesh OM5P/OM5P-AN
+  DEVICE_PACKAGES := om-watchdog
+endef
+LEGACY_DEVICES += OM5P
+
+define LegacyDevice/OM5PAC
+  DEVICE_TITLE := OpenMesh OM5P-AC
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct om-watchdog
+endef
+LEGACY_DEVICES += OM5PAC
+
+define LegacyDevice/MR600
+  DEVICE_TITLE := OpenMesh MR600
+  DEVICE_PACKAGES := om-watchdog
+endef
+LEGACY_DEVICES += MR600
+
+define LegacyDevice/MR900
+  DEVICE_TITLE := OpenMesh MR900
+  DEVICE_PACKAGES := om-watchdog
+endef
+LEGACY_DEVICES += MR900
+
+define LegacyDevice/MR1750
+  DEVICE_TITLE := OpenMesh MR1750
+  DEVICE_PACKAGES := om-watchdog kmod-ath10k-ct ath10k-firmware-qca988x-ct
+endef
+LEGACY_DEVICES += MR1750
+
+define LegacyDevice/ALL0305
+  DEVICE_TITLE := Allnet ALL0305
+  DEVICE_PACKAGES := fconfig kmod-ath5k -kmod-ath9k
+endef
+LEGACY_DEVICES += ALL0305
+
+define LegacyDevice/EAP7660D
+  DEVICE_TITLE := Senao EAP7660D
+endef
+LEGACY_DEVICES += EAP7660D
+
+define LegacyDevice/JA76PF
+  DEVICE_TITLE := jjPlus JA76PF
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-hwmon-core kmod-i2c-core kmod-hwmon-lm75
+endef
+LEGACY_DEVICES += JA76PF
+
+define LegacyDevice/JA76PF2
+  DEVICE_TITLE := jjPlus JA76PF2
+endef
+LEGACY_DEVICES += JA76PF2
+
+define LegacyDevice/JWAP003
+  DEVICE_TITLE := jjPlus JWAP003
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2
+endef
+LEGACY_DEVICES += JWAP003
+
+define LegacyDevice/PB42
+  DEVICE_TITLE := Atheros PB42 reference board
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2
+endef
+LEGACY_DEVICES += PB42
+
+define LegacyDevice/PB44
+  DEVICE_TITLE := Atheros PB44 reference board
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 \
+         vsc7385-ucode-pb44 vsc7395-ucode-pb44
+endef
+LEGACY_DEVICES += PB44
+
+define LegacyDevice/MZKW04NU
+  DEVICE_TITLE := Planex MZK-W04NU
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += MZKW04NU
+
+define LegacyDevice/MZKW300NH
+  DEVICE_TITLE := Planex MZK-W300NH
+endef
+LEGACY_DEVICES += MZKW300NH
+
+define LegacyDevice/EAP300V2
+  DEVICE_TITLE := EnGenius EAP300V2
+endef
+LEGACY_DEVICES += EAP300V2
+
+define LegacyDevice/WRT400N
+  DEVICE_TITLE := Linksys WRT400N
+endef
+LEGACY_DEVICES += WRT400N
+
+define LegacyDevice/WZRHPG300NH
+  DEVICE_TITLE := Buffalo WZR-HP-G300NH
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += WZRHPG300NH
+
+define LegacyDevice/WZRHPG300NH2
+  DEVICE_TITLE := Buffalo WZR-HP-G300NH2
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += WZRHPG300NH2
+
+define LegacyDevice/WZRHPAG300H
+  DEVICE_TITLE := Buffalo WZR-HP-AG300H
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += WZRHPAG300H
+
+define LegacyDevice/WZRHPG450H
+  DEVICE_TITLE := Buffalo WZR-HP-G450H
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += WZRHPG450H
+
+define LegacyDevice/WZR600DHP
+  DEVICE_TITLE := Buffalo WZR-600DHP
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += WZR600DHP
+
+define LegacyDevice/WZR450HP2
+  DEVICE_TITLE := Buffalo WZR-450HP2
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport
+endef
+LEGACY_DEVICES += WZR450HP2
+
+define LegacyDevice/ZCN1523H28
+  DEVICE_TITLE := Zcomax ZCN-1523H-2-8
+endef
+LEGACY_DEVICES += ZCN1523H28
+
+define LegacyDevice/ZCN1523H516
+  DEVICE_TITLE := Zcomax ZCN-1523H-5-16
+endef
+LEGACY_DEVICES += ZCN1523H516
diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk
new file mode 100644 (file)
index 0000000..83ba046
--- /dev/null
@@ -0,0 +1,1061 @@
+rootfs_type=$(patsubst squashfs-%,squashfs,$(1))
+
+# $(1): rootfs type.
+# $(2): board name.
+define imgname
+$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(call rootfs_type,$(1))
+endef
+
+define rootfs_align
+$(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1))))))
+endef
+
+define sysupname
+$(call imgname,$(1),$(2))-sysupgrade.bin
+endef
+
+define factoryname
+$(call imgname,$(1),$(2))-factory.bin
+endef
+
+COMMA:=,
+
+define mkcmdline
+$(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3))
+endef
+
+define mtdpartsize
+$(shell sz=`echo '$(2)' | sed -ne 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/p'`; [ -n "$$sz" ] && echo $$(($$sz * 1024)))
+endef
+
+# $(1)      : name of image build method to be used, e.g., AthLzma.
+# $(2)      : name of the build template to be used, e.g. 64k, 64kraw, 128k, etc.
+# $(3)      : name of the profile to be defined.
+# $(4)      : board name.
+# $(5)~$(7) : arguments for $(mkcmdline)
+#              board=$(1) console=$(2),$(3)
+# $(8)~$(14): extra arguments.
+define SingleProfile
+  # $(1): action name, e.g. loader, buildkernel, squashfs, etc.
+  define Image/Build/Profile/$(3)
+       $$(call Image/Build/Template/$(2)/$$(1),$(1),$(4),$$(call mkcmdline,$(5),$(6),$(7)),$(8),$(9),$(10),$(11),$(12),$(13),$(14))
+  endef
+endef
+
+LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
+
+VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
+UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
+
+# $(1): input file.
+# $(2): output file.
+# $(3): extra arguments for lzma.
+define CompressLzma
+  $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(3) $(2)
+endef
+
+define PatchKernel
+       cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1)
+       $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))"
+endef
+
+define PatchKernel/initramfs
+       $(call PatchKernel,$(1),$(2),-initramfs)
+       cp $(KDIR_TMP)/vmlinux-initramfs-$(1) $(call imgname,initramfs,$(1)).bin
+endef
+
+# $(1): board name.
+# $(2): kernel command line.
+# $(3): extra argumetns for lzma.
+# $(4): name suffix, e.g. "-initramfs".
+define PatchKernelLzma
+       cp $(KDIR)/vmlinux$(4) $(KDIR_TMP)/vmlinux$(4)-$(1)
+       $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(4)-$(1) "$(strip $(2))"
+       $(call CompressLzma,$(KDIR_TMP)/vmlinux$(4)-$(1),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(3))
+endef
+
+define PatchKernelGzip
+       cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1)
+       $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))"
+       gzip -9n -c $(KDIR_TMP)/vmlinux$(3)-$(1) > $(KDIR_TMP)/vmlinux$(3)-$(1).bin.gz
+endef
+
+ifneq ($(SUBTARGET),mikrotik)
+# $(1): compression method of the data.
+# $(2): extra arguments.
+# $(3): input data file.
+# $(4): output file.
+define MkuImage
+       mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \
+               -e 0x80060000 -n 'MIPS $(VERSION_DIST) Linux-$(LINUX_VERSION)' \
+               -d $(3) $(4)
+endef
+
+# $(1): board name.
+# $(2): kernel command line.
+# $(3): extra arguments for lzma.
+# $(4): name suffix, e.g. "-initramfs".
+# $(5): extra arguments for mkimage.
+define MkuImageLzma
+       $(call PatchKernelLzma,$(1),$(2),$(3),$(4))
+       $(call MkuImage,lzma,$(5),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(KDIR_TMP)/vmlinux$(4)-$(1).uImage)
+endef
+
+define MkuImageLzma/initramfs
+       $(call PatchKernelLzma,$(1),$(2),$(3),-initramfs)
+       $(call MkuImage,lzma,$(4),$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.lzma,$(call imgname,initramfs,$(1))-uImage.bin)
+endef
+
+define MkuImageGzip
+       $(call PatchKernelGzip,$(1),$(2))
+       $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-$(1).bin.gz,$(KDIR_TMP)/vmlinux-$(1).uImage)
+endef
+
+define MkuImageGzip/initramfs
+       $(call PatchKernelGzip,$(1),$(2),-initramfs)
+       $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.gz,$(call imgname,initramfs,$(1))-uImage.bin)
+endef
+
+define MkuImageOKLI
+       $(call MkuImage,lzma,-M 0x4f4b4c49,$(KDIR)/vmlinux.bin.lzma,$(KDIR_TMP)/vmlinux-$(1).okli)
+endef
+endif
+
+# $(1): name of the 1st file.
+# $(2): size limit of the 1st file if it is greater than 262144, or
+#       the erase size of the flash if it is greater than zero and less
+#       than 262144
+# $(3): name of the 2nd file.
+# $(4): size limit of the 2nd file if $(2) is greater than 262144, otherwise
+#       it is the size limit of the output file
+# $(5): name of the output file.
+# $(6): padding size.
+define CatFiles
+       if [ $(2) -eq 0 ]; then \
+               filename="$(3)"; fstype=$${filename##*\.}; \
+               case "$${fstype}" in \
+               *) bs=`stat -c%s $(1)`;; \
+               esac; \
+               ( dd if=$(1) bs=$${bs} conv=sync;  cat $(3) ) > $(5); \
+               if [ -n "$(6)" ]; then \
+                       case "$${fstype}" in \
+                       squashfs*) \
+                               padjffs2 $(5) $(6); \
+                               ;; \
+                       esac; \
+               fi; \
+               if [ `stat -c%s $(5)` -gt $(4) ]; then \
+                       echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \
+                       rm -f $(5); \
+               fi; \
+       else if [ $(2) -gt 262144 ]; then \
+               if [ `stat -c%s "$(1)"` -gt $(2) ]; then \
+                       echo "Warning: $(1) is too big (> $(2) bytes)" >&2; \
+               else if [ `stat -c%s $(3)` -gt $(4) ]; then \
+                       echo "Warning: $(3) is too big (> $(4) bytes)" >&2; \
+               else \
+                       ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
+               fi; fi; \
+       else \
+               ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
+               if [ `stat -c%s $(5)` -gt $(4) ]; then \
+                       echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \
+                       rm -f $(5); \
+               fi; \
+       fi; fi
+endef
+
+# $(1): rootfs type.
+# $(2): board name.
+# $(3): kernel image size limit.
+# $(4): rootfs image size limit.
+# $(5): padding argument for padjffs2.
+Sysupgrade/KR=$(call CatFiles,$(2),$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(5)))
+Sysupgrade/KRuImage=$(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(2)),$(5))
+Sysupgrade/RKuImage=$(call CatFiles,$(KDIR)/root.$(1),$(4),$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(call sysupname,$(1),$(2)))
+
+# $(1): ubinize ini file
+# $(2): working directory
+# $(3): output file
+# $(4): physical erase block size
+# $(5): minimum I/O unit size
+# $(6): custom options
+define ubinize
+       $(CP) $(1) $(2)
+       ( cd $(2); $(STAGING_DIR_HOST)/bin/ubinize -o $(3) -p $(4) -m $(5) $(6) $(1))
+endef
+
+#
+# Embed lzma-compressed kernel inside lzma-loader.
+#
+# $(1), suffix of output filename, e.g. generic, lowercase board name, etc.
+# $(2), suffix of target file to build, e.g. bin, gz, elf
+# $(3), kernel command line to pass from lzma-loader to kernel
+# $(4), unused here
+# $(5), suffix of kernel filename, e.g. -initramfs, or empty
+define Image/BuildLoader
+       -rm -rf $(KDIR)/lzma-loader
+       $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)"\
+               LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
+               LOADER_DATA="$(KDIR)/vmlinux$(5).bin.lzma" BOARD="$(1)" \
+               compile loader.$(2)
+       -$(if $(5),$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2))
+endef
+
+#
+# Build lzma-loader alone which will search for lzma-compressed kernel identified by
+# uImage header with magic "OKLI" at boot time.
+#
+# $(4), offset into the flash space to start searching uImage magic "OKLI".
+# $(5), size of search range starting at $(4).  With 0 as the value, uImage
+#      header is expected to be at precisely $(4)
+define Image/BuildLoaderAlone
+       -rm -rf $(KDIR)/lzma-loader
+       $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)" \
+               LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
+               BOARD="$(1)" FLASH_OFFS=$(4) FLASH_MAX=$(5) \
+               compile loader.$(2)
+endef
+
+define Build/Clean
+       $(LOADER_MAKE) clean
+endef
+
+alfa_ap120c_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,13312k(rootfs),1536k(kernel),1152k(unknown)ro,64k(art)ro;spi0.1:-(unknown)
+alfa_ap96_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13312k(rootfs),2048k(kernel),512k(caldata)ro,15360k@0x80000(firmware)
+alfa_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
+alfa_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,15936k(firmware),64k(nvram),64k(art)ro
+all0258n_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),6272k(firmware),1536k(failsafe),64k(art)ro
+all0315n_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env),13568k(firmware),2048k(failsafe),256k(art)ro
+ap83_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,4096k(rootfs),3648k(kernel),64k(art)ro,7744k@0x60000(firmware)
+ap96_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1728k(kernel),64k(art)ro,7872k@0x40000(firmware)
+ap121_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
+ap121_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,10944k(rootfs),4992k(kernel),64k(nvram),64k(art)ro,15936k@0x50000(firmware)
+ap132_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art)ro,7808k@0x50000(firmware)
+ap135_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
+ap136_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(mib0),64k(art)ro,7744k@0x50000(firmware)
+ap143_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1472k(kernel),64k(art)ro,7744k@0x50000(firmware)
+ap143_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
+ap147_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
+ap152_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
+bxu2000n2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),8448k(rootfs),6016k(user),64k(cfg),64k(oem),64k(art)ro
+cameo_ap81_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,3840k(firmware),64k(art)ro
+cameo_ap91_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3712k(firmware),64k(mac)ro,64k(art)ro
+cameo_ap99_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3520k(firmware),64k(mac)ro,192k(lp)ro,64k(art)ro
+cameo_ap121_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,192k(language)ro,3648k(firmware)
+cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,256k(language)ro,7680k@0x80000(firmware)
+cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
+cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
+cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
+cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art)ro,13632k@0xa0000(firmware)
+eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
+db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
+dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
+dlan_hotspot_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(Config1)ro,64k(Config2)ro,7872k@0x40000(firmware),64k(art)ro
+dlan_pro_500_wp_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(Config1)ro,64k(Config2)ro,7680k@0x70000(firmware),64k(art)ro
+dlan_pro_1200_ac_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(Config1)ro,64k(Config2)ro,15872k@0x70000(firmware),64k(art)ro
+cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f0000(caldata_copy)
+cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmware),64k(caldata)ro,64k@0x660000(caldata_orig),6208k@0x50000(firmware_orig)
+esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x40000(firmware)
+esr1750_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x40000(firmware)
+epg5000_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x40000(firmware)
+f9k1115v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),14464k(rootfs),1408k(kernel),64k(nvram)ro,64k(envram)ro,64k(art)ro,15872k@0x50000(firmware)
+dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,640k(certs),960k(unknown)ro,64k@0x7f0000(caldata_copy)
+dlrtdev_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7168k(firmware),640k(certs),64k(caldata)ro,64k@0x660000(caldata_orig),6208k@0x50000(firmware_orig)
+planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro
+whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
+wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),64k(nvram)ro,64k(art)ro
+wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
+wnr2000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro
+wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro
+wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro
+r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata)ro,256k(caldata-backup),512k(config),512k(pot),2048k(kernel),122240k(ubi),25600k@0x1a0000(firmware),2048k(language),3072k(traffic_meter)
+tew823dru_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
+wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata)ro,512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved)
+zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x50000(firmware)
+mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro
+zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k@0x0(zyxel_rfsd),2048k@0x200000(romd),1024k@0x400000(header),2048k@0x500000(kernel),125952k@0x500000(firmware),-@0x700000(ubi)
+
+define Image/BuildKernel
+       cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
+       cp $(KDIR)/vmlinux $(VMLINUX).bin
+       dd if=$(KDIR)/vmlinux.bin.lzma of=$(VMLINUX).lzma bs=65536 conv=sync
+       $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin)
+       cp $(KDIR)/loader-generic.elf $(VMLINUX)-lzma.elf
+       -mkdir -p $(KDIR_TMP)
+endef
+
+define Image/BuildKernel/Initramfs
+       cp $(KDIR)/vmlinux-initramfs.elf $(VMLINUX)-initramfs.elf
+       cp $(KDIR)/vmlinux-initramfs $(VMLINUX)-initramfs.bin
+       dd if=$(KDIR)/vmlinux-initramfs.bin.lzma of=$(VMLINUX)-initramfs.lzma bs=65536 conv=sync
+       $(call MkuImage,lzma,,$(KDIR)/vmlinux-initramfs.bin.lzma,$(UIMAGE)-initramfs-lzma.bin)
+       cp $(KDIR)/loader-generic-initramfs.elf $(VMLINUX)-initramfs-lzma.elf
+       $(call Image/Build/Initramfs)
+endef
+
+Image/Build/WRT400N/buildkernel=$(call MkuImageLzma,$(2),$(3))
+
+define Image/Build/WRT400N
+       $(call Sysupgrade/KRuImage,$(1),$(2),1310720,6488064)
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               wrt400n $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/root.$(1) $(call factoryname,$(1),$(2)); \
+       fi
+endef
+
+
+define Image/Build/CameoAP94/buildkernel
+       $(call MkuImageLzma,$(2),$(3) $(4))
+       $(call MkuImageLzma,$(2)-fat,$(3) $(5))
+endef
+
+define Image/Build/CameoAP94
+       $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+       $(eval fwsize_fat=$(call mtdpartsize,firmware,$(5)))
+       $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               ( \
+                       dd if=$(call sysupname,$(1),$(2)); \
+                       echo -n "$(6)"; \
+               ) > $(call imgname,$(1),$(2))-backup-loader.bin; \
+               if [ `stat -c%s $(call sysupname,$(1),$(2))` -gt 4194304 ]; then \
+                       echo "Warning: $(call sysupname,$(1),$(2)) is too big" >&2; \
+               else \
+                       ( \
+                               dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \
+                               echo -n "$(7)"; \
+                       ) > $(call factoryname,$(1),$(2)); \
+               fi; \
+       fi
+       $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2)-fat.uImage,0,$(KDIR)/root.$(1),$$(($(fwsize_fat)-4*64*1024)),$(KDIR_TMP)/$(2)-fat.bin,64)
+       if [ -e "$(KDIR_TMP)/$(2)-fat.bin" ]; then \
+               echo -n "" > $(KDIR_TMP)/$(2)-fat.dummy; \
+               sh $(TOPDIR)/scripts/combined-image.sh \
+                       "$(KDIR_TMP)/$(2)-fat.bin" \
+                       "$(KDIR_TMP)/$(2)-fat.dummy" \
+                       $(call sysupname,$(1),$(2)-fat); \
+       fi
+endef
+
+define Image/Build/WZRHP
+       $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(3)-4*$(4)*1024)),$(4))
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               ( \
+                       echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
+                       dd if=$(call sysupname,$(1),$(2)); \
+               ) > $(call imgname,$(1),$(2))-tftp.bin; \
+               buffalo-enc -p $(5) -v 1.99 \
+                       -i $(call sysupname,$(1),$(2)) \
+                       -o $(KDIR_TMP)/$(2).enc; \
+               buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
+                       -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
+                       -i $(KDIR_TMP)/$(2).enc \
+                       -o $(call factoryname,$(1),$(2)); \
+       fi
+endef
+
+Image/Build/WZRHP64K/buildkernel=$(call MkuImageLzma,$(2),$(3))
+Image/Build/WZRHP64K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+Image/Build/WZRHP64K=$(call Image/Build/WZRHP,$(1),$(2),33095680,64,$(4))
+
+Image/Build/WZRHP128K/buildkernel=$(call MkuImageLzma,$(2),$(3))
+Image/Build/WZRHP128K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+Image/Build/WZRHP128K=$(call Image/Build/WZRHP,$(1),$(2),33030144,128,$(4))
+
+
+Image/Build/WHRHPG300N/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/WHRHPG300N/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+
+define Image/Build/WHRHPG300N
+       $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+       $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               ( \
+                       echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
+                       dd if=$(call sysupname,$(1),$(2)); \
+               ) > $(call imgname,$(1),$(2))-tftp.bin; \
+               buffalo-enc -p $(5) -v 1.99 \
+                       -i $(call sysupname,$(1),$(2)) \
+                       -o $(KDIR_TMP)/$(2).enc; \
+               buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
+                       -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
+                       -i $(KDIR_TMP)/$(2).enc \
+                       -o $(call factoryname,$(1),$(2)); \
+       fi
+endef
+
+
+define Image/Build/Cameo
+       $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+       $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               factory_size=$$(($(fwsize) - $(6))); \
+               ( \
+                       dd if=$(call sysupname,$(1),$(2)) bs=$${factory_size} conv=sync; \
+                       echo -n $(5); \
+               ) > $(call factoryname,$(1),$(2)); \
+       fi
+endef
+
+Image/Build/CameoAP81/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap81_mtdlayout))
+Image/Build/CameoAP81=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap81_mtdlayout),$(4),65536)
+Image/Build/CameoAP81/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap81_mtdlayout))
+
+Image/Build/CameoAP91/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap91_mtdlayout))
+Image/Build/CameoAP91=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap91_mtdlayout),$(4),65536)
+Image/Build/CameoAP91/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap91_mtdlayout))
+
+Image/Build/CameoAP99/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap99_mtdlayout))
+Image/Build/CameoAP99=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap99_mtdlayout),$(4),65536)
+Image/Build/CameoAP99/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap99_mtdlayout))
+
+Image/Build/CameoAP123_4M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
+Image/Build/CameoAP123_4M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap123_mtdlayout_4M),$(4),26)
+Image/Build/CameoAP123_4M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
+
+Image/Build/CameoAP135/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/CameoAP135=$(call Image/Build/Cameo,$(1),$(2),$(3),$(4),$(5),26)
+Image/Build/CameoAP135/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+
+Image/Build/CameoDB120/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout))
+Image/Build/CameoDB120=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout),$(4),26)
+Image/Build/CameoDB120/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout))
+
+Image/Build/CameoDB120_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout_8M))
+Image/Build/CameoDB120_8M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout_8M),$(4),26)
+Image/Build/CameoDB120_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout_8M))
+
+define Image/Build/CameoHornet
+       $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+       $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               for r in $(7); do \
+                       [ -n "$$r" ] && dashr="-$$r" || dashr=; \
+                       [ -z "$$r" ] && r="DEF"; \
+                       mkcameofw -M HORNET -R "$$r" -S $(5) -V $(6) -c \
+                               -K $(8) -I $(fwsize) \
+                               -k "$(call sysupname,$(1),$(2))" \
+                               -o $(call imgname,$(1),$(2))-factory$$dashr.bin; \
+                       true; \
+               done; \
+       fi
+endef
+
+Image/Build/CameoAP121/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout))
+Image/Build/CameoAP121=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout),$(4),$(5),$(6),0xe0000)
+Image/Build/CameoAP121/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout))
+
+Image/Build/CameoAP121_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
+Image/Build/CameoAP121_8M=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout_8M),$(4),$(5),$(6),0x100000)
+Image/Build/CameoAP121_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
+
+define Image/Build/dLAN
+       $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+       $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
+       $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
+       $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
+endef
+
+Image/Build/dLANLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/dLANLzma=$(call Image/Build/dLAN,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
+Image/Build/dLANLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+
+define Image/Build/Ath
+       $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+       $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
+       $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
+       $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
+endef
+
+Image/Build/AthGzip/buildkernel=$(call MkuImageGzip,$(2),$(3) $(4))
+Image/Build/AthGzip=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
+Image/Build/AthGzip/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(4))
+
+Image/Build/AthLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/AthLzma=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
+Image/Build/AthLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+
+
+Image/Build/Belkin/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/Belkin/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+
+define Image/Build/Belkin
+       $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+       $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
+       $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
+       $(call Sysupgrade/RKuImage,$(1),$(2),$(kernsize),$(rootsize))
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               edimax_fw_header -m $(5) -v "$(shell echo -n $(VERSION_DIST)$(REVISION) | cut -c -13)" \
+                       -n "uImage" \
+                       -i $(KDIR_TMP)/vmlinux-$(2).uImage \
+                       -o $(KDIR_TMP)/$(2)-uImage; \
+               edimax_fw_header -m $(5) -v "$(shell echo -n $(VERSION_DIST)$(REVISION) | cut -c -13)" \
+                       -n "rootfs" \
+                       -i $(KDIR)/root.$(1) \
+                       -o $(KDIR_TMP)/$(2)-rootfs; \
+               ( \
+                       dd if=$(KDIR_TMP)/$(2)-rootfs; \
+                       dd if=$(KDIR_TMP)/$(2)-uImage; \
+               ) > "$(call factoryname,$(1),$(2))"; \
+       fi
+endef
+
+define Image/Build/EnGenius
+       $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+       $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
+       $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
+       $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               mksenaofw -e $(call sysupname,$(1),$(2)) \
+                       -o $(call imgname,$(1),$(2))-factory.dlf \
+                       -r 0x101 -p $(7) -t 2; \
+       fi
+endef
+
+Image/Build/EnGenius/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/EnGenius/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+
+
+Image/Build/PB4X/buildkernel=$(call PatchKernelLzma,$(2),$(3))
+
+define Image/Build/PB4X
+       dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
+          of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync
+       dd if=$(KDIR)/root.$(1) \
+          of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync
+       -sh $(TOPDIR)/scripts/combined-image.sh \
+               "$(call imgname,kernel,$(2)).bin" \
+               "$(call imgname,$(1),$(2)-rootfs).bin" \
+               $(call sysupname,$(1),$(2))
+endef
+
+
+Image/Build/MyLoader/buildkernel=$(call PatchKernelLzma,$(2),$(3))
+Image/Build/MyLoader/initramfs=$(call PatchKernel/initramfs,$(2),$(3))
+
+define Image/Build/MyLoader
+       $(eval fwsize=$(shell echo $$(($(4)-0x30000-4*64*1024))))
+       $(eval fwimage=$(KDIR_TMP)/$(2)-$(5)-firmware.bin)
+       $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).bin.lzma,65536,$(KDIR)/root.$(1),$(fwsize),$(fwimage))
+       if [ -e "$(fwimage)" ]; then \
+               $(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) -s $(4) -v \
+                       -p0x00030000:0:al:0x80060000:firmware:$(fwimage) \
+                       $(call imgname,$(1),$(2))-$(5)-factory.img; \
+               echo -n "" > $(KDIR_TMP)/empty.bin; \
+               sh $(TOPDIR)/scripts/combined-image.sh \
+                       $(fwimage) $(KDIR_TMP)/empty.bin \
+                       $(call imgname,$(1),$(2))-$(5)-sysupgrade.bin; \
+       fi
+endef
+
+Image/Build/Planex/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(planex_mtdlayout))
+Image/Build/Planex/loader=$(call Image/BuildLoaderAlone,$(1),gz,$(2) $(planex_mtdlayout),0x52000,0)
+
+define Image/Build/Planex/buildkernel
+       [ -e "$(KDIR)/loader-$(2).gz" ]
+       $(call MkuImageOKLI,$(2))
+       ( \
+               dd if=$(KDIR)/loader-$(2).gz bs=8128 count=1 conv=sync; \
+               dd if=$(KDIR_TMP)/vmlinux-$(2).okli; \
+       ) > $(KDIR_TMP)/kernel-$(2).bin
+       $(call MkuImage,gzip,,$(KDIR_TMP)/kernel-$(2).bin,$(KDIR_TMP)/vmlinux-$(2).uImage)
+endef
+
+define Image/Build/Planex
+       $(eval fwsize=$(call mtdpartsize,firmware,$(planex_mtdlayout)))
+       $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               $(STAGING_DIR_HOST)/bin/mkplanexfw \
+                       -B $(2) \
+                       -v 2.00.00 \
+                       -i $(call sysupname,$(1),$(2)) \
+                       -o $(call factoryname,$(1),$(2)); \
+       fi
+endef
+
+
+Image/Build/ALFA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/ALFA/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+
+define Image/Build/ALFA
+       $(call Sysupgrade/RKuImage,$(1),$(2),$(5),$(6))
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               rm -rf $(KDIR)/$(1); \
+               mkdir -p $(KDIR)/$(1); \
+               cd $(KDIR)/$(1); \
+               cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/$(1)/$(7); \
+               cp $(KDIR)/root.$(1) $(KDIR)/$(1)/$(8); \
+               $(TAR) c \
+                       $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+                       -C $(KDIR)/$(1) $(7) $(8) \
+                               | gzip -9nc > $(call factoryname,$(1),$(2)); \
+               ( \
+                       echo WRM7222C | dd bs=32 count=1 conv=sync; \
+                       echo -ne '\xfe'; \
+               ) >> $(call factoryname,$(1),$(2)); \
+       fi
+endef
+
+
+Image/Build/Senao/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/Senao/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+
+define Image/Build/Senao
+       mkdir -p $(KDIR_TMP)/$(2)/
+       touch $(KDIR_TMP)/$(2)/FWINFO-OpenWrt-$(REVISION)-$(2)
+       -$(CP) ./$(2)/* $(KDIR_TMP)/$(2)/
+       dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
+               of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-uImage-lzma.bin bs=64k conv=sync
+       dd if=$(KDIR)/root.$(1) \
+               of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-root.$(1) bs=64k conv=sync
+       ( \
+               cd $(KDIR_TMP)/$(2)/;  \
+               $(TAR) -c \
+                       $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
+                       * | gzip -9nc > $(call factoryname,$(1),$(2)) \
+       )
+       -rm -rf $(KDIR_TMP)/$(2)/
+       -sh $(TOPDIR)/scripts/combined-image.sh \
+               $(KDIR_TMP)/vmlinux-$(2).uImage \
+               $(KDIR)/root.$(1) \
+               $(call sysupname,$(1),$(2))
+endef
+
+define Image/Build/CyberTAN
+       echo -n '' > $(KDIR_TMP)/empty.bin
+       -$(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp \
+               -f $(KDIR_TMP)/vmlinux-$(2).uImage -F $(KDIR_TMP)/empty.bin \
+               -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1) && \
+       $(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) \
+               -i $(KDIR)/image.tmp \
+               -o $(call sysupname,$(1),$(2))
+       -$(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp -f $(KDIR_TMP)/vmlinux-$(2).uImage \
+               -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1) && \
+       $(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) -g \
+               -i $(KDIR)/image.tmp \
+               -o $(call factoryname,$(1),$(2))
+       -rm $(KDIR)/image.tmp
+endef
+
+Image/Build/CyberTANGZIP/loader=$(call Image/BuildLoader,$(1),gz,$(2),0x80060000)
+Image/Build/CyberTANGZIP/buildkernel=$(call MkuImage,gzip,,$(KDIR)/loader-$(2).gz,$(KDIR_TMP)/vmlinux-$(2).uImage)
+Image/Build/CyberTANGZIP=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
+
+Image/Build/CyberTANLZMA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/CyberTANLZMA=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
+
+
+Image/Build/Netgear/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
+
+define Image/Build/Netgear/buildkernel
+       $(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
+       -rm -rf $(KDIR_TMP)/$(2)
+       mkdir -p $(KDIR_TMP)/$(2)/image
+       cat $(KDIR_TMP)/vmlinux-$(2).uImage > $(KDIR_TMP)/$(2)/image/uImage
+       $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
+               $(KDIR_TMP)/$(2) $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1 \
+               -noappend -root-owned -be -b 65536 \
+               $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
+       ( \
+               cat $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1; \
+               dd if=/dev/zero bs=1k count=1 \
+       ) > $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2
+       mkimage -A mips -O linux -T filesystem -C none -M $(5) \
+               -a 0xbf070000 -e 0xbf070000 \
+               -n 'MIPS $(VERSION_DIST) Linux-$(LINUX_VERSION)' \
+               -d $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2 \
+               $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs
+endef
+
+define Image/Build/Netgear
+       $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+       $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage.squashfs,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
+       if [ -e $(call sysupname,$(1),$(2)) ]; then \
+               for r in $(7) ; do \
+                       [ -n "$$r" ] && dashr="-$$r" || dashr= ; \
+                       $(STAGING_DIR_HOST)/bin/mkdniimg \
+                               -B $(6) -v $(VERSION_DIST).$(REVISION) -r "$$r" $(8) \
+                               -i $(call sysupname,$(1),$(2)) \
+                               -o $(call imgname,$(1),$(2))-factory$$dashr.img; \
+               done; \
+       fi
+       if [ "$2" = "wnr2000" ]; then \
+               dd if=$(KDIR)/root.$(1) \
+                       of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
+       fi
+endef
+
+
+Image/Build/NetgearLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
+Image/Build/NetgearLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
+
+define Image/Build/NetgearLzma
+       $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+       $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
+endef
+
+
+Image/Build/NetgearNAND/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
+
+# $(1): (empty)
+# $(2): Board name (small caps)
+# $(3): Kernel board specific cmdline
+# $(4): Kernel mtdparts definition
+# $(5): U-Boot magic
+define Image/Build/NetgearNAND/buildkernel
+       $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
+       $(call PatchKernelLzma,$(2),$(3) $(4),-d20)
+       dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
+               of=$(KDIR_TMP)/vmlinux-$(2).bin.tmp \
+               bs=$$(($(kernelsize)-131072-2*64-1)) \
+               count=1 conv=sync
+       $(call MkuImage,lzma,-M $(5),$(KDIR_TMP)/vmlinux-$(2).bin.tmp,$(KDIR_TMP)/vmlinux-$(2).uImage)
+       echo -ne '\xff' >> $(KDIR_TMP)/vmlinux-$(2).uImage
+       # create a fake rootfs image
+       dd if=/dev/zero of=$(KDIR_TMP)/fakeroot-$(2) bs=131072 count=1
+       mkimage -A mips -O linux -T filesystem -C none \
+               -a 0xbf070000 -e 0xbf070000 \
+               -n 'MIPS $(VERSION_DIST) fakeroot' \
+               -d $(KDIR_TMP)/fakeroot-$(2) \
+               -M $(5) \
+               $(KDIR_TMP)/fakeroot-$(2).uImage
+       # append the fake rootfs image to the kernel, it will reside in the last
+       # erase block of the kernel partition
+       cat $(KDIR_TMP)/fakeroot-$(2).uImage >> $(KDIR_TMP)/vmlinux-$(2).uImage
+endef
+
+
+# $(1): rootfs image suffix
+# $(2): Board name (small caps)
+# $(3): Kernel board specific cmdline
+# $(4): Kernel mtdparts definition
+# $(5): U-Boot magic
+# $(6): Board name (upper caps)
+# $(7): firmware region code (not used yet)
+# $(8): DNI Hardware version
+# $(9): suffix of the configuration file for ubinize
+define Image/Build/NetgearNAND
+       $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
+       $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
+       $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
+       $(CP) $(KDIR)/root.squashfs-raw $(KDIR_TMP)/root.squashfs
+       echo -ne '\xde\xad\xc0\xde' > $(KDIR_TMP)/jffs2.eof
+       $(call ubinize,ubinize-$(9).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
+       ( \
+               dd if=$(KDIR_TMP)/vmlinux-$(2).uImage; \
+               dd if=$(KDIR_TMP)/$(2)-root.ubi \
+       ) > $(imageraw)
+       $(STAGING_DIR_HOST)/bin/mkdniimg \
+               -B $(6) -v $(VERSION_DIST).$(REVISION) -r "$$r" $(8) \
+               -i $(imageraw) \
+               -o $(call imgname,ubi,$(2))-factory.img
+
+       $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/vmlinux-$(2).uImage)
+endef
+
+ZYXEL_UBOOT = $(KDIR)/u-boot-nbg460n_550n_550nh.bin
+ZYXEL_UBOOT_BIN = $(wildcard $(BIN_DIR)/u-boot-nbg460n_550n_550nh/u-boot.bin)
+
+Image/Build/ZyXEL/buildkernel=$(call MkuImageLzma,$(2),$(3))
+
+define Image/Build/ZyXEL
+       $(call Sysupgrade/KRuImage,$(1),$(2),917504,2752512)
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               if [ ! -f $(ZYXEL_UBOOT) ]; then \
+                       echo "Warning: $(ZYXEL_UBOOT) not found" >&2; \
+               else \
+                       $(STAGING_DIR_HOST)/bin/mkzynfw \
+                               -B $(4) \
+                               -b $(ZYXEL_UBOOT) \
+                               -r $(call sysupname,$(1),$(2)):0x10000 \
+                               -o $(call factoryname,$(1),$(2)); \
+       fi; fi
+endef
+
+# attention: only zlib compression is allowed for the boot fs
+define Image/Build/ZyXELNAND/buildkernel
+       $(eval kernelsize=$(call mtdpartsize,kernel,$(5)))
+       $(call MkuImageLzma,$(2),$(3) $(5) $(6))
+       mkdir -p $(KDIR_TMP)/$(2)/image/boot
+       cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR_TMP)/$(2)/image/boot/vmlinux.lzma.uImage
+       $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
+               --pad=$(kernelsize) --big-endian --squash-uids -v -e 128KiB -q -f -n -x lzma -x rtime \
+               -o $(KDIR_TMP)/$(2)-kernel.jffs2 \
+               -d $(KDIR_TMP)/$(2)/image \
+               2>&1 1>/dev/null | awk '/^.+$$/'
+       -rm -rf $(KDIR_TMP)/$(2)
+endef
+
+define Image/Build/ZyXELNAND
+       if [ "$(1)" != "squashfs" ]; then \
+               echo Only squashfs is supported; \
+               return 0; \
+       fi
+       $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
+       $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
+       $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
+       $(CP) $(KDIR)/root.$(1) $(KDIR_TMP)/ubi_root.img
+       $(call ubinize,ubinize-$(2).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
+       ( \
+               dd if=$(KDIR_TMP)/$(2)-kernel.jffs2; \
+               dd if=$(KDIR_TMP)/$(2)-root.ubi \
+       ) > $(imageraw)
+       dd if=$(imageraw) of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.bin \
+               bs=128k conv=sync
+       $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/$(2)-kernel.jffs2)
+endef
+
+
+Image/Build/OpenMesh/buildkernel=$(call MkuImageLzma,$(2))
+Image/Build/OpenMesh/initramfs=$(call MkuImageLzma/initramfs,$(2),)
+
+define Image/Build/OpenMesh
+       -sh $(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
+               "$(4)" \
+               "$(BUILD_DIR)/fwupgrade.cfg-$(4)" \
+               "$(KDIR_TMP)/vmlinux-$(2).uImage" \
+               "$(KDIR)/root.$(1)"
+       -sh $(TOPDIR)/scripts/combined-ext-image.sh \
+               "$(4)" "$(call factoryname,$(1),$(2))" \
+               "$(BUILD_DIR)/fwupgrade.cfg-$(4)" "fwupgrade.cfg" \
+               "$(KDIR_TMP)/vmlinux-$(2).uImage" "kernel" \
+               "$(KDIR)/root.$(1)" "rootfs"
+       if [ -e "$(call factoryname,$(1),$(2))" ]; then \
+               cp "$(call factoryname,$(1),$(2))" "$(call sysupname,$(1),$(2))"; \
+       fi
+endef
+
+
+Image/Build/Zcomax/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/Zcomax/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+
+define Image/Build/Zcomax
+       $(call Sysupgrade/RKuImage,$(1),$(2),1507328,6356992)
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               $(STAGING_DIR_HOST)/bin/mkzcfw \
+                       -B $(2) \
+                       -k $(KDIR_TMP)/vmlinux-$(2).uImage \
+                       -r $(KDIR)/root.$(1) \
+                       -o $(call imgname,$(1),$(2))-factory.img; \
+       fi
+endef
+
+
+# $(1): template name to be defined.
+# $(2): squashfs suffix to be used.
+define BuildTemplate
+  # $(1)     : name of build method.
+  # $(2)     : board name.
+  # $(3)     : kernel command line.
+  # $(4)~$(8): extra arguments.
+  define Image/Build/Template/$(1)/initramfs
+    $$(call Image/Build/$$(1)/initramfs,initramfs,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
+  endef
+  define Image/Build/Template/$(1)/loader
+    $$(call Image/Build/$$(1)/loader,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
+  endef
+  define Image/Build/Template/$(1)/buildkernel
+    $$(call Image/Build/$$(1)/buildkernel,,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
+  endef
+  define Image/Build/Template/$(1)/squashfs
+    $$(call Image/Build/$$(1),squashfs$(2),$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
+  endef
+endef
+
+$(eval $(call BuildTemplate,squashfs-only))
+$(eval $(call BuildTemplate,64k,-64k))
+$(eval $(call BuildTemplate,64kraw,-raw))
+$(eval $(call BuildTemplate,64kraw-nojffs,-raw))
+$(eval $(call BuildTemplate,128k))
+$(eval $(call BuildTemplate,128kraw,-raw))
+$(eval $(call BuildTemplate,256k))
+$(eval $(call BuildTemplate,all))
+
+ifeq ($(SUBTARGET),generic)
+$(eval $(call SingleProfile,ALFA,64k,ALFANX,alfa-nx,ALFA-NX,ttyS0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,vmlinux.gz.uImage,pb9x-2.6.31-jffs2))
+$(eval $(call SingleProfile,ALFA,64k,HORNETUB,hornet-ub,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel_image,rootfs_image))
+$(eval $(call SingleProfile,ALFA,64k,TUBE2H8M,tube2h-8M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel.image,rootfs.image))
+
+$(eval $(call SingleProfile,AthGzip,64k,AP96,ap96,AP96,ttyS0,115200,$$(ap96_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthGzip,64k,WNDAP360,wndap360,WNDAP360,ttyS0,9600,$$(wndap360_mtdlayout),KRuImage,65536))
+
+$(eval $(call SingleProfile,AthLzma,64k,ALFAAP120C,alfa-ap120c,ALFA-AP120C,ttyS0,115200,$$(alfa_ap120c_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,ALFAAP96,alfa-ap96,ALFA-AP96,ttyS0,115200,$$(alfa_ap96_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,ALL0258N,all0258n,ALL0258N,ttyS0,115200,$$(all0258n_mtdlayout),KRuImage,65536))
+$(eval $(call SingleProfile,AthLzma,256k,ALL0315N,all0315n,ALL0315N,ttyS0,115200,$$(all0315n_mtdlayout),KRuImage,262144))
+$(eval $(call SingleProfile,AthGzip,64k,AP83,ap83,AP83,ttyS0,115200,$$(ap83_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP121_8M,ap121-8M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_8M),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP121_16M,ap121-16M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_16M),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP132,ap132,AP132,ttyS0,115200,$$(ap132_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP135,ap135-020,AP135-020,ttyS0,115200,$$(ap135_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP136_010,ap136-010,AP136-010,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP136_020,ap136-020,AP136-020,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(ap143_mtdlayout_8M),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,AP152_16M,ap152-16M,AP152,ttyS0,115200,$$(ap152_mtdlayout_16M),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
+$(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
+$(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
+$(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
+
+$(eval $(call SingleProfile,CameoAP121_8M,64kraw-nojffs,DIR505A1,dir-505-a1,DIR-505-A1,ttyATH0,115200,"HORNET-PACKET-DIR505A1-3",1.99.99,""))
+
+$(eval $(call SingleProfile,CameoAP135,64kraw,DGL5500A1,dgl-5500-a1,DGL-5500-A1,ttyS0,115200,$$(dgl_5500_mtdlayout),"00AP135AR9558-RT-130508-00"))
+$(eval $(call SingleProfile,CameoAP135,64kraw,TEW823DRU,tew-823dru,TEW-823DRU,ttyS0,115200,$$(tew823dru_mtdlayout) mem=256M,"00AP135AR9558-RT-131129-00"))
+
+$(eval $(call SingleProfile,CameoDB120,64kraw,DHP1565A1,dhp-1565-a1,DHP-1565-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
+$(eval $(call SingleProfile,CameoDB120,64kraw,DIR825C1,dir-825-c1,DIR-825-C1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
+$(eval $(call SingleProfile,CameoDB120,64kraw,DIR835A1,dir-835-a1,DIR-835-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
+
+$(eval $(call SingleProfile,CameoDB120_8M,64kraw,TEW732BR,tew-732br,TEW-732BR,ttyS0,115200,"00DB120AR9341-RT-120906-NA"))
+
+$(eval $(call SingleProfile,CyberTANGZIP,64k,E2100L,e2100l,E2100L,ttyS0,115200,,1.00.01))
+$(eval $(call SingleProfile,CyberTANGZIP,64k,WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,,1.00.01))
+
+$(eval $(call SingleProfile,CyberTANLZMA,64k,MYNETREXT,mynet-rext,MYNET-REXT,ttyS0,115200,$$(mynet_rext_mtdlayout) root=31:2,1.00.01))
+
+$(eval $(call SingleProfile,CameoAP94,64kraw,DIR825B1,dir-825-b1,DIR-825-B1,ttyS0,115200,$$(cameo_ap94_mtdlayout),$$(cameo_ap94_mtdlayout_fat),01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
+$(eval $(call SingleProfile,CameoAP94,64kraw,TEW673GRU,tew-673gru,TEW-673GRU,ttyS0,115200,$$(cameo_ap94_mtdlayout),$$(cameo_ap94_mtdlayout_fat),01AP94-AR7161-RT-080619-01,00AP94-AR7161-RT-080619-01))
+$(eval $(call SingleProfile,CameoAP94,64kraw,DLRTDEV01,dlrtdev01,DIR-825-B1,ttyS0,115200,$$(dlrtdev_mtdlayout),$$(dlrtdev_mtdlayout_fat),01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
+
+$(eval $(call SingleProfile,dLANLzma,64k,dLAN_Hotspot,dlan-hotspot,dLAN-Hotspot,ttyATH0,115200,$$(dlan_hotspot_mtdlayout) mem=64M,KRuImage,65536))
+$(eval $(call SingleProfile,dLANLzma,64k,dLAN_pro_500_wp,dlan-pro-500-wp,dLAN-pro-500-wp,ttyS0,115200,$$(dlan_pro_500_wp_mtdlayout) mem=128M,KRuImage,65536))
+$(eval $(call SingleProfile,dLANLzma,64k,dLAN_pro_1200_ac,dlan-pro-1200-ac,dLAN-pro-1200-ac,ttyS0,115200,$$(dlan_pro_1200_ac_mtdlayout) mem=128M,KRuImage,65536))
+
+$(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e))
+$(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
+$(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71))
+
+$(eval $(call SingleProfile,MyLoader,64k,WP543_8M,wp543,,ttyS0,115200,0x800000,8M))
+$(eval $(call SingleProfile,MyLoader,64k,WP543_16M,wp543,,ttyS0,115200,0x1000000,16M))
+$(eval $(call SingleProfile,MyLoader,64k,WPE72_8M,wpe72,,ttyS0,115200,0x800000,8M))
+$(eval $(call SingleProfile,MyLoader,64k,WPE72_16M,wpe72,,ttyS0,115200,0x1000000,16M))
+
+$(eval $(call SingleProfile,Netgear,64kraw,WNR2200,wnr2200,WNR2200,ttyS0,115200,$$(wnr2200_mtdlayout),0x32323030,wnr2200,"" NA,))
+
+$(eval $(call SingleProfile,OpenMesh,squashfs-only,A60,a60,,,,A60))
+$(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P))
+$(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P))
+$(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5PAC,om5pac,,,,OM5PAC))
+$(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600))
+$(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900))
+$(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750))
+
+$(eval $(call SingleProfile,PB4X,128k,ALL0305,all0305,ALL0305,ttyS0,115200))
+$(eval $(call SingleProfile,PB4X,128k,EAP7660D,eap7660d,EAP7660D,ttyS0,115200))
+$(eval $(call SingleProfile,PB4X,64k,JA76PF,ja76pf,JA76PF,ttyS0,115200))
+$(eval $(call SingleProfile,PB4X,64k,JA76PF2,ja76pf2,JA76PF2,ttyS0,115200))
+$(eval $(call SingleProfile,PB4X,64k,JWAP003,jwap003,JWAP003,ttyS0,115200))
+$(eval $(call SingleProfile,PB4X,64k,PB42,pb42,PB42,ttyS0,115200))
+$(eval $(call SingleProfile,PB4X,64k,PB44,pb44,PB44,ttyS0,115200))
+
+$(eval $(call SingleProfile,Planex,64kraw,MZKW04NU,mzk-w04nu,MZK-W04NU,ttyS0,115200))
+$(eval $(call SingleProfile,Planex,64kraw,MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0,115200))
+
+$(eval $(call SingleProfile,Senao,squashfs-only,EAP300V2,eap300v2,EAP300V2,ttyS0,115200,$$(eap300v2_mtdlayout)))
+
+$(eval $(call SingleProfile,WRT400N,64k,WRT400N,wrt400n,WRT400N,ttyS0,115200))
+
+$(eval $(call SingleProfile,WZRHP128K,128kraw,WZRHPG300NH,wzr-hp-g300nh,WZR-HP-G300NH,ttyS0,115200,WZR-HP-G300NH))
+$(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG300NH2,wzr-hp-g300nh2,WZR-HP-G300NH2,ttyS0,115200,WZR-HP-G300NH2))
+$(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPAG300H,wzr-hp-ag300h,WZR-HP-AG300H,ttyS0,115200,WZR-HP-AG300H))
+$(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG450H,wzr-hp-g450h,WZR-HP-G450H,ttyS0,115200,WZR-HP-AG450H))
+$(eval $(call SingleProfile,WZRHP64K,64kraw,WZR600DHP,wzr-600dhp,WZR-HP-AG300H,ttyS0,115200,WZR-600DHP))
+$(eval $(call SingleProfile,WZRHP64K,64kraw,WZR450HP2,wzr-450hp2,WZR-450HP2,ttyS0,115200,WZR-450HP2))
+
+$(eval $(call SingleProfile,Zcomax,64k,ZCN1523H28,zcn-1523h-2-8,ZCN-1523H-2,ttyS0,115200,$$(zcn1523h_mtdlayout)))
+$(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,ttyS0,115200,$$(zcn1523h_mtdlayout)))
+
+endif # ifeq ($(SUBTARGET),generic)
+
+
+ifeq ($(SUBTARGET),tiny)
+
+$(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC))
+
+$(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00"))
+$(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02"))
+$(eval $(call SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01"))
+
+$(eval $(call SingleProfile,CameoAP99,64kraw,EBR2310C1,ebr-2310-c1,EBR-2310-C1,ttyS0,115200,"AP91-AR7240-RT-090223-03"))
+$(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00"))
+$(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05"))
+
+$(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00"))
+$(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00"))
+
+$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03"))
+$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
+$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00"))
+$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05"))
+$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
+
+$(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3",1.99,""))
+$(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,DIR601B1,dir-601-b1,TEW-712BR,ttyATH0,115200,"HORNET-RT-DIR601B1-3",2.99.99,"" "NA"))
+
+$(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M))
+$(eval $(call SingleProfile,MyLoader,64k,WPE72_4M,wpe72,,ttyS0,115200,0x400000,4M))
+
+$(eval $(call SingleProfile,Netgear,64kraw,WNR2000V3,wnr2000v3,WNR2000V3,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303033,WNR2000V3,"" NA,-H 29763551+04+32))
+$(eval $(call SingleProfile,NetgearLzma,64kraw,WNR2000V4,wnr2000v4,WNR2000V4,ttyS0,115200,$$(wnr2000v4_mtdlayout),0x32303034,WNR2000V4,"" NA,))
+$(eval $(call SingleProfile,Netgear,64kraw,WNR2000,wnr2000,WNR2000,ttyS0,115200,$$(wnr2000_mtdlayout),0x32303031,WNR2000,"" NA,))
+$(eval $(call SingleProfile,Netgear,64kraw,REALWNR612V2,wnr612v2,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,WNR612V2,"",))
+$(eval $(call SingleProfile,Netgear,64kraw,N150R,n150r,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,N150R,"",))
+$(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303031,WNR1000V2,"",))
+$(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",))
+$(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31313030,WPN824N,"" NA,))
+
+$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
+$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N))
+$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN))
+$(eval $(call SingleProfile,WHRHPG300N,64kraw,WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N))
+
+$(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N))
+
+endif # ifeq ($(SUBTARGET),tiny)
+
+
+ifeq ($(SUBTARGET),nand)
+
+$(eval $(call SingleProfile,NetgearNAND,64k,WNDR3700V4,wndr3700v4,WNDR3700_V4,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR3700v4,"",-H 29763948+128+128,wndr4300))
+$(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300V1,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3,wndr4300))
+$(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6100_mtdlayout),0x36303030,R6100,"",-H 29764434+0+128+128+2x2+2x2,wndr4300))
+
+$(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,NBG6716,$$(zyx_nbg6716_mtdlayout),mem=256M))
+
+endif # ifeq ($(SUBTARGET),nand)
+
+define Image/Build/squashfs
+       cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
+       cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-64k
+       $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-64k 64
+       $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
+       dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
+endef
+
+define Image/Prepare
+       $(if $(wildcard $(ZYXEL_UBOOT_BIN)),cp $(ZYXEL_UBOOT_BIN) $(ZYXEL_UBOOT))
+       $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+       $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
+       $(call Image/BuildLoader,generic,elf,,,-initramfs)
+endif
+       $(call Image/BuildLoader,generic,elf)
+endef
+
+define Image/Prepare/Profile
+       $(call Image/Build/Profile/$(1),loader)
+endef
+
+define Image/Build/Profile
+       $(call Image/Build/Profile/$(1),buildkernel)
+       $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Image/Build/Profile/$(1),initramfs))
+       $(call Image/Build/Profile/$(1),$(2))
+endef
+
+# $(1): filesystem type.
+define Image/Build
+       $(call Image/Build/$(call rootfs_type,$(1)),$(1))
+endef