Added support for the TP-LINK TL-WA830RE v1 Range Extender. Basically a
clone of the WA901ND v1 support. The hardware ID 0x08300010 is strange
but correct. It is the same as in the original TP-LINK firmware. The
button and the LED on the front panel is named Range Extender. Patch was
successfully tested on my hardware (v1).
Signed-off-by: Ronald Hecht <[email protected]>
Index: target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa830re.c
===================================================================
--- target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa830re.c
(revision 0)
+++ target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa830re.c
(revision 0)
@@ -0,0 +1,112 @@
+/*
+ * TP-LINK TL-WA830RE v1 board support
+ *
+ * Copyright (C) 2009-2012 Gabor Juhos <[email protected]>
+ * Copyright (C) 2010 Pieter Hollants <[email protected]>
+ * Copyright (C) 2012 Stefan Helmert <[email protected]>
+ * Copyright (C) 2013 Ronald Hecht <[email protected]>
+ *
+ * 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 <asm/mach-ath79/ar71xx_regs.h>
+#include <asm/mach-ath79/ath79.h>
+
+#include "common.h"
+#include "dev-ap9x-pci.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "machtypes.h"
+#include "pci.h"
+
+#define TL_WA830RE_GPIO_LED_RE 0 /* Range Extender */
+#define TL_WA830RE_GPIO_LED_SYSTEM 1
+#define TL_WA830RE_GPIO_LED_LAN 13
+
+#define TL_WA830RE_GPIO_BTN_RESET 11
+#define TL_WA830RE_GPIO_BTN_RE 12 /* Range Extender */
+
+#define TL_WA830RE_KEYS_POLL_INTERVAL 20 /* msecs */
+#define TL_WA830RE_KEYS_DEBOUNCE_INTERVAL (3 *
TL_WA830RE_KEYS_POLL_INTERVAL)
+
+static const char *tl_wa830re_part_probes[] = {
+ "tp-link",
+ NULL,
+};
+
+static struct flash_platform_data tl_wa830re_flash_data = {
+ .part_probes = tl_wa830re_part_probes,
+};
+
+static struct gpio_led tl_wa830re_leds_gpio[] __initdata = {
+ {
+ .name = "tp-link:green:lan",
+ .gpio = TL_WA830RE_GPIO_LED_LAN,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:system",
+ .gpio = TL_WA830RE_GPIO_LED_SYSTEM,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:re",
+ .gpio = TL_WA830RE_GPIO_LED_RE,
+ .active_low = 1,
+ }
+};
+
+static struct gpio_keys_button tl_wa830re_gpio_keys[] __initdata = {
+ {
+ .desc = "reset",
+ .type = EV_KEY,
+ .code = KEY_RESTART,
+ .debounce_interval = TL_WA830RE_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = TL_WA830RE_GPIO_BTN_RESET,
+ .active_low = 1,
+ }, {
+ .desc = "re",
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
+ .debounce_interval = TL_WA830RE_KEYS_DEBOUNCE_INTERVAL,
+ .gpio = TL_WA830RE_GPIO_BTN_RE,
+ .active_low = 1,
+ }
+};
+
+static void __init tl_wa830re_setup(void)
+{
+ u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+ ath79_register_m25p80(&tl_wa830re_flash_data);
+
+ ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+ AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+ AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+ AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+ AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wa830re_leds_gpio),
+ tl_wa830re_leds_gpio);
+
+ ath79_register_gpio_keys_polled(-1, TL_WA830RE_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wa830re_gpio_keys),
+ tl_wa830re_gpio_keys);
+
+ /*
+ * ath79_eth0 would be the WAN port, but is not connected.
+ * ath79_eth1 connects to the internal switch chip, however
+ * we have a single LAN port only.
+ */
+ ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
+ ath79_register_mdio(0, 0x0);
+ ath79_register_eth(1);
+
+ ap91_pci_init(ee, mac);
+}
+
+MIPS_MACHINE(ATH79_MACH_TL_WA830RE, "TL-WA830RE", "TP-LINK TL-WA830RE",
+ tl_wa830re_setup);
Index: target/linux/ar71xx/image/Makefile
===================================================================
--- target/linux/ar71xx/image/Makefile (revision 35576)
+++ target/linux/ar71xx/image/Makefile (working copy)
@@ -900,6 +900,7 @@
$(eval $(call
SingleProfile,TPLINK,$(fs_64kraw),TLWA701,tl-wa701n-v1,TL-WA901ND,ttyS0,115200,0x07010001,1,4M))
$(eval $(call
SingleProfile,TPLINK,$(fs_64kraw),TLWA7510NV1,tl-wa7510n,TL-WA7510N,ttyS0,115200,0x75100001,1,4M))
$(eval $(call
SingleProfile,TPLINK,$(fs_64kraw),TLWA801NV1,tl-wa801nd-v1,TL-WA901ND,ttyS0,115200,0x08010001,1,4M))
+$(eval $(call
SingleProfile,TPLINK,$(fs_64kraw),TLWA830RV1,tl-wa830re-v1,TL-WA830RE,ttyS0,115200,0x08300010,1,4M))
$(eval $(call
SingleProfile,TPLINK,$(fs_64kraw),TLWA901NV1,tl-wa901nd-v1,TL-WA901ND,ttyS0,115200,0x09010001,1,4M))
$(eval $(call
SingleProfile,TPLINK,$(fs_64kraw),TLWA901NV2,tl-wa901nd-v2,TL-WA901ND-v2,ttyS0,115200,0x09010002,1,4M))
$(eval $(call
SingleProfile,TPLINK,$(fs_64kraw),TLWR740NV1,tl-wr740n-v1,TL-WR741ND,ttyS0,115200,0x07400001,1,4M))
@@ -972,6 +973,7 @@
$(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY))
$(eval $(call MultiProfile,TLMR3220,TLMR3220V1 TLMR3220V2))
$(eval $(call MultiProfile,TLWA801,TLWA801NV1))
+$(eval $(call MultiProfile,TLWA830,TLWA830RV1))
$(eval $(call MultiProfile,TLWA901,TLWA901NV1 TLWA901NV2))
$(eval $(call MultiProfile,TLWA7510,TLWA7510NV1))
$(eval $(call MultiProfile,TLWR740,TLWR740NV1 TLWR740NV3 TLWR740NV4))
Index: target/linux/ar71xx/base-files/lib/ar71xx.sh
===================================================================
--- target/linux/ar71xx/base-files/lib/ar71xx.sh (revision 35576)
+++ target/linux/ar71xx/base-files/lib/ar71xx.sh (working copy)
@@ -90,6 +90,9 @@
"080100"*)
model="TP-Link TL-WA801N/ND"
;;
+ "083000"*)
+ model="TP-Link TL-WA830RE"
+ ;;
"084100"*)
model="TP-Link TL-WR841N/ND"
;;
@@ -375,6 +378,9 @@
*TL-WA7510N)
name="tl-wa7510n"
;;
+ *TL-WA830RE)
+ name="tl-wa830re"
+ ;;
*TL-WA901ND)
name="tl-wa901nd"
;;
Index: target/linux/ar71xx/base-files/lib/upgrade/platform.sh
===================================================================
--- target/linux/ar71xx/base-files/lib/upgrade/platform.sh (revision
35576)
+++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh (working copy)
@@ -159,6 +159,7 @@
tl-mr3220-v2 | \
tl-mr3420 | \
tl-wa7510n | \
+ tl-wa830re | \
tl-wa901nd | \
tl-wa901nd-v2 | \
tl-wdr3500 | \
Index: target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
===================================================================
--- target/linux/ar71xx/base-files/etc/uci-defaults/01_leds (revision
35576)
+++ target/linux/ar71xx/base-files/etc/uci-defaults/01_leds (working
copy)
@@ -130,6 +130,10 @@
ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1"
;;
+tl-wa830re)
+ ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
+ ;;
+
tl-wa901nd)
ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
;;
Index: target/linux/ar71xx/base-files/etc/uci-defaults/02_network
===================================================================
--- target/linux/ar71xx/base-files/etc/uci-defaults/02_network
(revision 35576)
+++ target/linux/ar71xx/base-files/etc/uci-defaults/02_network
(working copy)
@@ -199,6 +199,7 @@
tl-mr11u |\
tl-mr3020 |\
tl-mr3040 |\
+tl-wa830re |\
tl-wa901nd |\
tl-wa901nd-v2 |\
tl-wr703n |\
Index: target/linux/ar71xx/base-files/etc/diag.sh
===================================================================
--- target/linux/ar71xx/base-files/etc/diag.sh (revision 35576)
+++ target/linux/ar71xx/base-files/etc/diag.sh (working copy)
@@ -141,6 +141,7 @@
tl-mr3220 | \
tl-mr3220-v2 | \
tl-mr3420 | \
+ tl-wa830re | \
tl-wa901nd | \
tl-wa901nd-v2 | \
tl-wr1041n-v2 | \
Index: target/linux/ar71xx/config-3.7
===================================================================
--- target/linux/ar71xx/config-3.7 (revision 35576)
+++ target/linux/ar71xx/config-3.7 (working copy)
@@ -63,6 +63,7 @@
CONFIG_ATH79_MACH_TL_MR11U=y
CONFIG_ATH79_MACH_TL_MR3020=y
CONFIG_ATH79_MACH_TL_MR3X20=y
+CONFIG_ATH79_MACH_TL_WA830RE=y
CONFIG_ATH79_MACH_TL_WA901ND=y
CONFIG_ATH79_MACH_TL_WA901ND_V2=y
CONFIG_ATH79_MACH_TL_WDR3500=y
Index: target/linux/ar71xx/generic/profiles/tp-link.mk
===================================================================
--- target/linux/ar71xx/generic/profiles/tp-link.mk (revision 35576)
+++ target/linux/ar71xx/generic/profiles/tp-link.mk (working copy)
@@ -103,6 +103,16 @@
$(eval $(call Profile,TLWA801))
+define Profile/TLWA830
+ NAME:=TP-LINK TL-WA830RE
+ PACKAGES:=
+endef
+
+define Profile/TLWA830/Description
+ Package set optimized for the TP-LINK TL-WA830RE.
+endef
+$(eval $(call Profile,TLWA830))
+
define Profile/TLWA901
NAME:=TP-LINK TL-WA901N/ND
PACKAGES:=
Index: target/linux/ar71xx/patches-3.7/615-MIPS-ath79-WA830RE-support.patch
===================================================================
---
target/linux/ar71xx/patches-3.7/615-MIPS-ath79-WA830RE-support.patch
(revision 0)
+++
target/linux/ar71xx/patches-3.7/615-MIPS-ath79-WA830RE-support.patch
(revision 0)
@@ -0,0 +1,44 @@
+Index: linux-3.7.6/arch/mips/ath79/Kconfig
+===================================================================
+--- linux-3.7.6.orig/arch/mips/ath79/Kconfig
++++ linux-3.7.6/arch/mips/ath79/Kconfig
+@@ -496,6 +496,15 @@ config ATH79_MACH_TL_MR3X20
+ select ATH79_DEV_M25P80
+ select ATH79_DEV_USB
+
++config ATH79_MACH_TL_WA830RE
++ bool "TP-LINK TL-WA830RE 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
+ bool "TP-LINK TL-WA901ND/TL-WA7510N support"
+ select SOC_AR724X
+Index: linux-3.7.6/arch/mips/ath79/machtypes.h
+===================================================================
+--- linux-3.7.6.orig/arch/mips/ath79/machtypes.h
++++ linux-3.7.6/arch/mips/ath79/machtypes.h
+@@ -83,6 +83,7 @@ enum ath79_mach_type {
+ ATH79_MACH_TL_MR3220_V2, /* TP-LINK TL-MR3220 v2 */
+ ATH79_MACH_TL_MR3420, /* TP-LINK TL-MR3420 */
+ ATH79_MACH_TL_WA7510N_V1, /* TP-LINK TL-WA7510N v1*/
++ ATH79_MACH_TL_WA830RE, /* TP-LINK TL-WA830RE */
+ ATH79_MACH_TL_WA901ND, /* TP-LINK TL-WA901ND */
+ ATH79_MACH_TL_WA901ND_V2, /* TP-LINK TL-WA901ND v2 */
+ ATH79_MACH_TL_WDR3500, /* TP-LINK TL-WDR3500 */
+Index: linux-3.7.6/arch/mips/ath79/Makefile
+===================================================================
+--- linux-3.7.6.orig/arch/mips/ath79/Makefile
++++ linux-3.7.6/arch/mips/ath79/Makefile
+@@ -79,6 +79,7 @@ obj-$(CONFIG_ATH79_MACH_TEW_712BR) += ma
+ obj-$(CONFIG_ATH79_MACH_TL_MR11U) += mach-tl-mr11u.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_WA830RE) += mach-tl-wa830re.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_WDR3500) += mach-tl-wdr3500.o
Index: tools/firmware-utils/src/mktplinkfw.c
===================================================================
--- tools/firmware-utils/src/mktplinkfw.c (revision 35576)
+++ tools/firmware-utils/src/mktplinkfw.c (working copy)
@@ -37,6 +37,8 @@
#define HWID_TL_WA701N_V1 0x07010001
#define HWID_TL_WA7510N_V1 0x75100001
#define HWID_TL_WA801ND_V1 0x08010001
+#define HWID_TL_WA830RE_V1 0x08300010
+#define HWID_TL_WA830RE_V2 0x08300002
#define HWID_TL_WA901ND_V1 0x09010001
#define HWID_TL_WA901ND_V2 0x09010002
#define HWID_TL_WR703N_V1 0x07030101
@@ -217,6 +219,16 @@
.hw_rev = 1,
.layout_id = "4M",
}, {
+ .id = "TL-WA830REv1",
+ .hw_id = HWID_TL_WA830RE_V1,
+ .hw_rev = 1,
+ .layout_id = "4M",
+ }, {
+ .id = "TL-WA830REv2",
+ .hw_id = HWID_TL_WA830RE_V2,
+ .hw_rev = 1,
+ .layout_id = "4M",
+ }, {
.id = "TL-WA901NDv1",
.hw_id = HWID_TL_WA901ND_V1,
.hw_rev = 1,
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel