2 * AzureWave AW-NR580 board support
4 * Copyright (C) 2008-2012 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published
9 * by the Free Software Foundation.
12 #include <asm/mach-ath79/ath79.h>
15 #include "dev-m25p80.h"
16 #include "dev-gpio-buttons.h"
17 #include "dev-leds-gpio.h"
18 #include "machtypes.h"
21 #define AW_NR580_GPIO_LED_READY_RED 0
22 #define AW_NR580_GPIO_LED_WLAN 1
23 #define AW_NR580_GPIO_LED_READY_GREEN 2
24 #define AW_NR580_GPIO_LED_WPS_GREEN 4
25 #define AW_NR580_GPIO_LED_WPS_AMBER 5
27 #define AW_NR580_GPIO_BTN_WPS 3
28 #define AW_NR580_GPIO_BTN_RESET 11
30 #define AW_NR580_KEYS_POLL_INTERVAL 20 /* msecs */
31 #define AW_NR580_KEYS_DEBOUNCE_INTERVAL (3 * AW_NR580_KEYS_POLL_INTERVAL)
33 static struct gpio_led aw_nr580_leds_gpio
[] __initdata
= {
35 .name
= "aw-nr580:red:ready",
36 .gpio
= AW_NR580_GPIO_LED_READY_RED
,
39 .name
= "aw-nr580:green:ready",
40 .gpio
= AW_NR580_GPIO_LED_READY_GREEN
,
43 .name
= "aw-nr580:green:wps",
44 .gpio
= AW_NR580_GPIO_LED_WPS_GREEN
,
47 .name
= "aw-nr580:amber:wps",
48 .gpio
= AW_NR580_GPIO_LED_WPS_AMBER
,
51 .name
= "aw-nr580:green:wlan",
52 .gpio
= AW_NR580_GPIO_LED_WLAN
,
57 static struct gpio_keys_button aw_nr580_gpio_keys
[] __initdata
= {
62 .debounce_interval
= AW_NR580_KEYS_DEBOUNCE_INTERVAL
,
63 .gpio
= AW_NR580_GPIO_BTN_RESET
,
68 .code
= KEY_WPS_BUTTON
,
69 .debounce_interval
= AW_NR580_KEYS_DEBOUNCE_INTERVAL
,
70 .gpio
= AW_NR580_GPIO_BTN_WPS
,
75 static const char *aw_nr580_part_probes
[] = {
80 static struct flash_platform_data aw_nr580_flash_data
= {
81 .part_probes
= aw_nr580_part_probes
,
84 static void __init
aw_nr580_setup(void)
86 ath79_register_mdio(0, 0x0);
88 ath79_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_MII
;
89 ath79_eth0_data
.speed
= SPEED_100
;
90 ath79_eth0_data
.duplex
= DUPLEX_FULL
;
92 ath79_register_eth(0);
96 ath79_register_m25p80(&aw_nr580_flash_data
);
98 ath79_register_leds_gpio(-1, ARRAY_SIZE(aw_nr580_leds_gpio
),
101 ath79_register_gpio_keys_polled(-1, AW_NR580_KEYS_POLL_INTERVAL
,
102 ARRAY_SIZE(aw_nr580_gpio_keys
),
106 MIPS_MACHINE(ATH79_MACH_AW_NR580
, "AW-NR580", "AzureWave AW-NR580",