2 * TP-LINK TL-WR741ND board support
4 * Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
11 #include <asm/mach-ar71xx/ar71xx.h>
15 #include "dev-m25p80.h"
16 #include "dev-ap91-pci.h"
17 #include "dev-gpio-buttons.h"
18 #include "dev-leds-gpio.h"
20 #define TL_WR741ND_GPIO_LED_QSS 0
21 #define TL_WR741ND_GPIO_LED_SYSTEM 1
23 #define TL_WR741ND_GPIO_BTN_RESET 11
24 #define TL_WR741ND_GPIO_BTN_QSS 12
26 #define TL_WR741ND_KEYS_POLL_INTERVAL 20 /* msecs */
27 #define TL_WR741ND_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR741ND_KEYS_POLL_INTERVAL)
29 static const char *tl_wr741nd_part_probes
[] = {
34 static struct flash_platform_data tl_wr741nd_flash_data
= {
35 .part_probes
= tl_wr741nd_part_probes
,
38 static struct gpio_led tl_wr741nd_leds_gpio
[] __initdata
= {
40 .name
= "tp-link:green:system",
41 .gpio
= TL_WR741ND_GPIO_LED_SYSTEM
,
44 .name
= "tp-link:green:qss",
45 .gpio
= TL_WR741ND_GPIO_LED_QSS
,
50 static struct gpio_keys_button tl_wr741nd_gpio_keys
[] __initdata
= {
55 .debounce_interval
= TL_WR741ND_KEYS_DEBOUNCE_INTERVAL
,
56 .gpio
= TL_WR741ND_GPIO_BTN_RESET
,
61 .code
= KEY_WPS_BUTTON
,
62 .debounce_interval
= TL_WR741ND_KEYS_DEBOUNCE_INTERVAL
,
63 .gpio
= TL_WR741ND_GPIO_BTN_QSS
,
68 static void __init
tl_wr741nd_setup(void)
70 u8
*mac
= (u8
*) KSEG1ADDR(0x1f01fc00);
71 u8
*ee
= (u8
*) KSEG1ADDR(0x1fff1000);
73 ar71xx_add_device_m25p80(&tl_wr741nd_flash_data
);
75 ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr741nd_leds_gpio
),
76 tl_wr741nd_leds_gpio
);
78 ar71xx_register_gpio_keys_polled(-1, TL_WR741ND_KEYS_POLL_INTERVAL
,
79 ARRAY_SIZE(tl_wr741nd_gpio_keys
),
80 tl_wr741nd_gpio_keys
);
82 ar71xx_init_mac(ar71xx_eth0_data
.mac_addr
, mac
, 1);
83 ar71xx_init_mac(ar71xx_eth1_data
.mac_addr
, mac
, -1);
85 ar71xx_add_device_mdio(0, 0x0);
88 ar71xx_add_device_eth(1);
91 ar71xx_add_device_eth(0);
93 ap91_pci_setup_wmac_led_pin(1);
95 ap91_pci_init(ee
, mac
);
97 MIPS_MACHINE(AR71XX_MACH_TL_WR741ND
, "TL-WR741ND", "TP-LINK TL-WR741ND",