Skip to content

Commit

Permalink
Merge pull request coolsnowwolf#179 from imbrolla/master
Browse files Browse the repository at this point in the history
add tl-6500 v6,wr941 v7,wr842 v9,wr882 v1
  • Loading branch information
coolsnowwolf authored Nov 15, 2017
2 parents 4cef749 + 1de9ee7 commit 3de0449
Show file tree
Hide file tree
Showing 15 changed files with 726 additions and 12 deletions.
10 changes: 10 additions & 0 deletions target/linux/ar71xx/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ tl-wdr4900-v2)
ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy1tpt"
;;
tl-wdr6500-v2|\
tl-wdr6500-v6|\
tl-wr741nd)
ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02"
Expand All @@ -744,6 +745,7 @@ tl-wpa8630)
tl-wr740n-v6|\
tl-wr841n-v9|\
tl-wr841n-v11|\
tl-wr842n-v9|\
tl-wr842n-v3)
ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
Expand All @@ -753,6 +755,7 @@ tl-wr842n-v3)
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"

case "$board" in
tl-wr842n-v9|\
tl-wr842n-v3)
ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1"
;;
Expand Down Expand Up @@ -812,6 +815,13 @@ tl-wr2543n)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:green:wlan2g" "phy0tpt"
ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1"
;;
tl-wr882n-v1)
ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
;;
tube2h)
ucidef_set_led_netdev "lan" "LAN" "alfa:blue:lan" "eth0"
ucidef_set_rssimon "wlan0" "200000" "1"
Expand Down
3 changes: 3 additions & 0 deletions target/linux/ar71xx/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ ar71xx_setup_interfaces()
tl-wr841n-v11|\
tl-wr841n-v9|\
tl-wr842n-v3|\
tl-wr842n-v9|\
tl-wr882n-v1|\
whr-g301n|\
whr-hp-g300n|\
whr-hp-gn|\
Expand Down Expand Up @@ -311,6 +313,7 @@ ar71xx_setup_interfaces()
r6100|\
smart-300|\
tl-wdr6500-v2|\
tl-wdr6500-v6|\
tl-wr940n-v4|\
tl-wr941nd-v6|\
wnr1000-v2|\
Expand Down
5 changes: 5 additions & 0 deletions target/linux/ar71xx/base-files/etc/diag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ get_status_led() {
tl-wa830re-v2|\
tl-wr842n-v2|\
tl-wr842n-v3|\
tl-wr842n-v9|\
tl-wr941nd|\
tl-wr941n-v7|\
tl-wr941nd-v5)
Expand All @@ -437,9 +438,13 @@ get_status_led() {
tl-wr841n-v9)
status_led="tp-link:green:qss"
;;
tl-wr882n-v1)
status_led="tp-link:white:status"
;;
tl-wr2543n)
status_led="tp-link:green:wps"
;;
tl-wdr6500-v6|\
tl-wdr6500-v2)
status_led="tp-link:white:system"
;;
Expand Down
12 changes: 12 additions & 0 deletions target/linux/ar71xx/base-files/lib/ar71xx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ tplink_board_detect() {
"65000002")
model="TP-Link TL-WDR6500"
;;
"65000006")
model="TP-Link TL-WDR6500"
;;
"721000"*)
model="TP-Link TL-WA7210N"
;;
Expand Down Expand Up @@ -1112,6 +1115,9 @@ ar71xx_board_detect() {
*"TL-WDR6500 v2")
name="tl-wdr6500-v2"
;;
*"TL-WDR6500 v6")
name="tl-wdr6500-v6"
;;
*"TL-WPA8630")
name="tl-wpa8630"
;;
Expand Down Expand Up @@ -1184,6 +1190,12 @@ ar71xx_board_detect() {
*"TL-WR842N/ND v3")
name="tl-wr842n-v3"
;;
*"TL-WR842N/ND v9")
name="tl-wr842n-v9"
;;
*"TL-WR882N v1")
name="tl-wr882n-v1"
;;
*"TL-WR902AC v1")
name="tl-wr902ac-v1"
;;
Expand Down
5 changes: 5 additions & 0 deletions target/linux/ar71xx/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ platform_check_image() {
tl-wdr4300|\
tl-wdr4900-v2|\
tl-wdr6500-v2|\
tl-wdr6500-v6|\
tl-wpa8630|\
tl-wr1041n-v2|\
tl-wr1043nd-v2|\
Expand All @@ -451,6 +452,8 @@ platform_check_image() {
tl-wr841n-v9|\
tl-wr842n-v2|\
tl-wr842n-v3|\
tl-wr842n-v9|\
tl-wr882n-v1|\
tl-wr902ac-v1|\
tl-wr941nd-v5|\
tl-wr941nd-v6|\
Expand All @@ -460,6 +463,8 @@ platform_check_image() {
local magic_ver="0100"

case "$board" in
tl-wdr6500-v6|\
tl-wdr3320-v2|\
tl-wdr6500-v2)
magic_ver="0200"
;;
Expand Down
2 changes: 2 additions & 0 deletions target/linux/ar71xx/config-4.4
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ CONFIG_ATH79_MACH_TL_WDR3320_V2=y
CONFIG_ATH79_MACH_TL_WDR3500=y
CONFIG_ATH79_MACH_TL_WDR4300=y
CONFIG_ATH79_MACH_TL_WDR6500_V2=y
CONFIG_ATH79_MACH_TL_WDR6500_V6=y
CONFIG_ATH79_MACH_TL_WPA8630=y
CONFIG_ATH79_MACH_TL_WR1041N_V2=y
CONFIG_ATH79_MACH_TL_WR1043ND=y
Expand All @@ -213,6 +214,7 @@ CONFIG_ATH79_MACH_TL_WR840N_V2=y
CONFIG_ATH79_MACH_TL_WR841N_V1=y
CONFIG_ATH79_MACH_TL_WR841N_V8=y
CONFIG_ATH79_MACH_TL_WR841N_V9=y
CONFIG_ATH79_MACH_TL_WR882N_V1=y
CONFIG_ATH79_MACH_TL_WR902AC_V1=y
CONFIG_ATH79_MACH_TL_WR940N_V4=y
CONFIG_ATH79_MACH_TL_WR941ND=y
Expand Down
2 changes: 2 additions & 0 deletions target/linux/ar71xx/config-4.9
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ CONFIG_ATH79_MACH_TL_WDR3320_V2=y
CONFIG_ATH79_MACH_TL_WDR3500=y
CONFIG_ATH79_MACH_TL_WDR4300=y
CONFIG_ATH79_MACH_TL_WDR6500_V2=y
CONFIG_ATH79_MACH_TL_WDR6500_V6=y
CONFIG_ATH79_MACH_TL_WPA8630=y
CONFIG_ATH79_MACH_TL_WR1041N_V2=y
CONFIG_ATH79_MACH_TL_WR1043ND=y
Expand All @@ -211,6 +212,7 @@ CONFIG_ATH79_MACH_TL_WR840N_V2=y
CONFIG_ATH79_MACH_TL_WR841N_V1=y
CONFIG_ATH79_MACH_TL_WR841N_V8=y
CONFIG_ATH79_MACH_TL_WR841N_V9=y
CONFIG_ATH79_MACH_TL_WR882N_V1=y
CONFIG_ATH79_MACH_TL_WR902AC_V1=y
CONFIG_ATH79_MACH_TL_WR940N_V4=y
CONFIG_ATH79_MACH_TL_WR941ND=y
Expand Down
41 changes: 31 additions & 10 deletions target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
config ATH79_MACH_TL_WR941N_V7
bool "TP-LINK TL-WR941N v7 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_A60
bool "OpenMesh A40/A60 board support"
select SOC_QCA955X
Expand Down Expand Up @@ -1635,6 +1625,17 @@ config ATH79_MACH_TL_WDR6500_V2
select ATH79_DEV_USB
select ATH79_DEV_WMAC

config ATH79_MACH_TL_WDR6500_V6
bool "TP-LINK TL-WDR6500 v6 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
Expand Down Expand Up @@ -1738,6 +1739,16 @@ config ATH79_MACH_TL_WR841N_V9
select ATH79_DEV_USB
select ATH79_DEV_WMAC

config ATH79_MACH_TL_WR882N_V1
bool "TP-LINK TL-WR882N 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_WMAC
select ATH79_DEV_USB

config ATH79_MACH_TL_WR902AC_V1
bool "TP-LINK TL-WR902AC v1 support"
select SOC_QCA953X
Expand Down Expand Up @@ -1768,6 +1779,16 @@ config ATH79_MACH_TL_WR941ND_V6
select ATH79_DEV_M25P80
select ATH79_DEV_WMAC

config ATH79_MACH_TL_WR941N_V7
bool "TP-LINK TL-WR941N v7 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_WR940N_V4
bool "TP-LINK TL-WR940N v4 support"
select SOC_QCA956X
Expand Down
2 changes: 2 additions & 0 deletions target/linux/ar71xx/files/arch/mips/ath79/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ 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_WDR6500_V6) += mach-tl-wdr6500-v6.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
Expand All @@ -220,6 +221,7 @@ 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_WR882N_V1) += mach-tl-wr882n-v1.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
Expand Down
113 changes: 113 additions & 0 deletions target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
* TP-LINK TL-WDR6500 v6
*
*/
#include <linux/pci.h>
#include <linux/gpio.h>
#include <linux/platform_device.h>
#include <asm/mach-ath79/ath79.h>
#include <asm/mach-ath79/ar71xx_regs.h>
#include "common.h"
#include "dev-eth.h"
#include "dev-ap9x-pci.h"
#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#include "dev-m25p80.h"
#include "dev-usb.h"
#include "dev-wmac.h"
#include "machtypes.h"
#include "pci.h"
#define TL_WDR6500_V6_GPIO_LED_SYS 21
#define TL_WDR6500_V6_GPIO_LED_WAN 18
#define TL_WDR6500_V6_GPIO_LED_LAN1 17
#define TL_WDR6500_V6_GPIO_LED_LAN2 16
#define TL_WDR6500_V6_GPIO_LED_LAN3 15
#define TL_WDR6500_V6_GPIO_LED_LAN4 14
#define TL_WDR6500_V6_GPIO_BTN_RESET 1
#define TL_WDR6500_V6_KEYS_POLL_INTERVAL 20 /* msecs */
#define TL_WDR6500_V6_KEYS_DEBOUNCE_INTERVAL (3 * TL_WDR6500_V6_KEYS_POLL_INTERVAL)
#define TL_WDR6500_V6_WMAC_CALDATA_OFFSET 0x1000
#define TL_WDR6500_V6_PCIE_CALDATA_OFFSET 0x5000
static const char *tl_wdr6500_v6_part_probes[] = {
"tp-link-64k",
NULL,
};
static struct flash_platform_data tl_wdr6500_v6_flash_data = {
.part_probes = tl_wdr6500_v6_part_probes,
};
static struct gpio_led tl_wdr6500_v6_leds_gpio[] __initdata = {
{
.name = "tp-link:green:lan1",
.gpio = TL_WDR6500_V6_GPIO_LED_LAN1,
.active_low = 1,
}, {
.name = "tp-link:green:lan2",
.gpio = TL_WDR6500_V6_GPIO_LED_LAN2,
.active_low = 1,
}, {
.name = "tp-link:green:lan3",
.gpio = TL_WDR6500_V6_GPIO_LED_LAN3,
.active_low = 1,
}, {
.name = "tp-link:green:lan4",
.gpio = TL_WDR6500_V6_GPIO_LED_LAN4,
.active_low = 1,
}, {
.name = "tp-link:green:wan",
.gpio = TL_WDR6500_V6_GPIO_LED_WAN,
.active_low = 1,
}, {
.name = "tp-link:white:system",
.gpio = TL_WDR6500_V6_GPIO_LED_SYS,
.active_low = 0,
},
};
static struct gpio_keys_button tl_wdr6500_v6_gpio_keys[] __initdata = {
{
.desc = "Reset button",
.type = EV_KEY,
.code = KEY_RESTART,
.debounce_interval = TL_WDR6500_V6_KEYS_DEBOUNCE_INTERVAL,
.gpio = TL_WDR6500_V6_GPIO_BTN_RESET,
.active_low = 1,
}
};
static void __init tl_ap151_setup(void)
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f00fc00);
u8 *ee = (u8 *) KSEG1ADDR(0x1fff0000);
u8 tmpmac[ETH_ALEN];
ath79_register_usb();
ath79_register_m25p80(&tl_wdr6500_v6_flash_data);
ath79_setup_ar933x_phy4_switch(false, false);
ath79_register_mdio(1, 0x0);
/* WAN */
ath79_switch_data.phy4_mii_en = 1;
ath79_switch_data.phy_poll_mask = BIT(4);
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ath79_eth0_data.phy_mask = BIT(4);
ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
ath79_register_eth(0);
/* LAN */
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
ath79_eth1_data.duplex = DUPLEX_FULL;
ath79_eth1_data.speed = SPEED_1000;
ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
ath79_register_eth(1);
ath79_init_mac(tmpmac, mac, -1);
ath79_register_wmac(ee + TL_WDR6500_V6_WMAC_CALDATA_OFFSET, tmpmac);
ath79_register_pci();
ath79_register_usb();
}
static void __init tl_wdr6500_v6_setup(void)
{
tl_ap151_setup();
ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wdr6500_v6_leds_gpio),
tl_wdr6500_v6_leds_gpio);
ath79_register_gpio_keys_polled(1, TL_WDR6500_V6_KEYS_POLL_INTERVAL,
ARRAY_SIZE(tl_wdr6500_v6_gpio_keys),
tl_wdr6500_v6_gpio_keys);
}
MIPS_MACHINE(ATH79_MACH_TL_WDR6500_V6, "TL-WDR6500-v6", "TP-LINK TL-WDR6500 v6",
tl_wdr6500_v6_setup);
Loading

0 comments on commit 3de0449

Please sign in to comment.