2 * TP-LINK TL-WA901N/ND v1, TL-WA7510N v1 board support
4 * Copyright (C) 2009-2012 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2010 Pieter Hollants <pieter@hollants.com>
6 * Copyright (C) 2012 Stefan Helmert <helst_listen@aol.de>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
13 #include <asm/mach-ath79/ar71xx_regs.h>
14 #include <asm/mach-ath79/ath79.h>
17 #include "dev-ap9x-pci.h"
19 #include "dev-gpio-buttons.h"
20 #include "dev-leds-gpio.h"
21 #include "dev-m25p80.h"
22 #include "machtypes.h"
25 #define TL_WA901ND_GPIO_LED_QSS 0
26 #define TL_WA901ND_GPIO_LED_SYSTEM 1
27 #define TL_WA901ND_GPIO_LED_LAN 13
29 #define TL_WA901ND_GPIO_BTN_RESET 11
30 #define TL_WA901ND_GPIO_BTN_QSS 12
32 #define TL_WA901ND_KEYS_POLL_INTERVAL 20 /* msecs */
33 #define TL_WA901ND_KEYS_DEBOUNCE_INTERVAL (3 * TL_WA901ND_KEYS_POLL_INTERVAL)
35 static const char *tl_wa901nd_part_probes[] = {
40 static struct flash_platform_data tl_wa901nd_flash_data = {
41 .part_probes = tl_wa901nd_part_probes,
44 static struct gpio_led tl_wa901nd_leds_gpio[] __initdata = {
46 .name = "tp-link:green:lan",
47 .gpio = TL_WA901ND_GPIO_LED_LAN,
50 .name = "tp-link:green:system",
51 .gpio = TL_WA901ND_GPIO_LED_SYSTEM,
54 .name = "tp-link:green:qss",
55 .gpio = TL_WA901ND_GPIO_LED_QSS,
60 static struct gpio_keys_button tl_wa901nd_gpio_keys[] __initdata = {
65 .debounce_interval = TL_WA901ND_KEYS_DEBOUNCE_INTERVAL,
66 .gpio = TL_WA901ND_GPIO_BTN_RESET,
71 .code = KEY_WPS_BUTTON,
72 .debounce_interval = TL_WA901ND_KEYS_DEBOUNCE_INTERVAL,
73 .gpio = TL_WA901ND_GPIO_BTN_QSS,
78 static void __init common_setup(void)
80 u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
83 * ath79_eth0 would be the WAN port, but is not connected.
84 * ath79_eth1 connects to the internal switch chip, however
85 * we have a single LAN port only.
87 ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
88 ath79_register_mdio(0, 0x0);
89 ath79_register_eth(1);
91 ath79_register_m25p80(&tl_wa901nd_flash_data);
94 static void __init tl_wa901nd_setup(void)
96 u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
97 u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
99 ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
100 AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
101 AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
102 AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
103 AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
107 ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wa901nd_leds_gpio),
108 tl_wa901nd_leds_gpio);
110 ath79_register_gpio_keys_polled(-1, TL_WA901ND_KEYS_POLL_INTERVAL,
111 ARRAY_SIZE(tl_wa901nd_gpio_keys),
112 tl_wa901nd_gpio_keys);
114 ap91_pci_init(ee, mac);
117 MIPS_MACHINE(ATH79_MACH_TL_WA901ND, "TL-WA901ND", "TP-LINK TL-WA901ND",
120 static void __init tl_wa7510n_v1_setup(void)
123 ath79_register_pci();
126 MIPS_MACHINE(ATH79_MACH_TL_WA7510N_V1, "TL-WA7510N", "TP-LINK TL-WA7510N v1",
127 tl_wa7510n_v1_setup);