[OpenWrt-Devel] [PATCH v2] [ar71xx] Add support for TL-WA830RE v1

2013-02-24 Thread Ronald Hecht

Added support for the TP-LINK TL-WA830RE v1 Range Extender. Based on the 
WA901ND v1 support. Hardware IDs checked against original firmware. Patch was 
successfully tested on hardware.

Signed-off-by: Ronald Hecht ronald.he...@gmx.de
Index: target/linux/ar71xx/image/Makefile
===
--- target/linux/ar71xx/image/Makefile  (revision 35759)
+++ 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,0x7511,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-WA901ND,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,0x0741,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 35759)
+++ 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
;;
Index: target/linux/ar71xx/generic/profiles/tp-link.mk
===
--- target/linux/ar71xx/generic/profiles/tp-link.mk (revision 35759)
+++ target/linux/ar71xx/generic/profiles/tp-link.mk (working copy)
@@ -102,7 +102,17 @@
 endef
 $(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: tools/firmware-utils/src/mktplinkfw.c
===
--- tools/firmware-utils/src/mktplinkfw.c   (revision 35759)
+++ tools/firmware-utils/src/mktplinkfw.c   (working copy)
@@ -37,6 +37,8 @@
 #define HWID_TL_WA701N_V1  0x07010001
 #define HWID_TL_WA7510N_V1 0x7511
 #define HWID_TL_WA801ND_V1 0x08010001
+#define HWID_TL_WA830RE_V1 0x08300010
+#define HWID_TL_WA830RE_V2 0x0832
 #define HWID_TL_WA901ND_V1 0x09010001
 #define HWID_TL_WA901ND_V2 0x09010002
 #define HWID_TL_WDR4900_V1 0x4901
@@ -224,6 +226,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
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] [ar71xx] Add support for TL-WA830RE v1

2013-02-14 Thread Ronald Hecht
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 ronald.he...@gmx.de
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 juh...@openwrt.org
+ *  Copyright (C) 2010 Pieter Hollants pie...@hollants.com
+ *  Copyright (C) 2012 Stefan Helmert helst_lis...@aol.de
+ *  Copyright (C) 2013 Ronald Hecht ronald.he...@gmx.de
+ *
+ *  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_RE0/* Range Extender */
+#define TL_WA830RE_GPIO_LED_SYSTEM1
+#define TL_WA830RE_GPIO_LED_LAN13
+
+#define TL_WA830RE_GPIO_BTN_RESET11
+#define TL_WA830RE_GPIO_BTN_RE12/* Range Extender */
+
+#define TL_WA830RE_KEYS_POLL_INTERVAL20/* 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,0x7511,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