diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-02-01 15:50:42 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2013-02-01 15:50:42 +0000 |
commit | 8837d3a49b41666a02b14a8911df502f3a60550e (patch) | |
tree | 2f4175c6811f2bdaa99e07918841df82633f2b0c /target/linux/ar71xx/files | |
parent | 150bb9d0b1a1fd865796c005dbdbae5fa8f7f489 (diff) | |
download | upstream-8837d3a49b41666a02b14a8911df502f3a60550e.tar.gz upstream-8837d3a49b41666a02b14a8911df502f3a60550e.tar.bz2 upstream-8837d3a49b41666a02b14a8911df502f3a60550e.zip |
ar71xx: add kernel support for the OpenMesh MR600v2
Signed-off-by: Marek Lindner <marek@open-mesh.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 35428
Diffstat (limited to 'target/linux/ar71xx/files')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ath79/mach-mr600.c | 75 |
1 files changed, 69 insertions, 6 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr600.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr600.c index f47aad3783..8e3f6dac51 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr600.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr600.c @@ -35,8 +35,17 @@ #include "machtypes.h" #define MR600_GPIO_LED_WLAN58 12 -#define MR600_GPIO_LED_WPS 13 -#define MR600_GPIO_LED_POWER 14 +#define MR600_GPIO_LED_WPS 13 +#define MR600_GPIO_LED_POWER 14 + +#define MR600V2_GPIO_LED_WLAN58_RED 12 +#define MR600V2_GPIO_LED_WPS 13 +#define MR600V2_GPIO_LED_POWER 14 +#define MR600V2_GPIO_LED_WLAN24_GREEN 18 +#define MR600V2_GPIO_LED_WLAN24_YELLOW 19 +#define MR600V2_GPIO_LED_WLAN24_RED 20 +#define MR600V2_GPIO_LED_WLAN58_GREEN 21 +#define MR600V2_GPIO_LED_WLAN58_YELLOW 22 #define MR600_GPIO_BTN_RESET 17 @@ -65,6 +74,49 @@ static struct gpio_led mr600_leds_gpio[] __initdata = { }, }; +static struct gpio_led mr600v2_leds_gpio[] __initdata = { + { + .name = "mr600:blue:power", + .gpio = MR600V2_GPIO_LED_POWER, + .active_low = 1, + }, + { + .name = "mr600:blue:wps", + .gpio = MR600V2_GPIO_LED_WPS, + .active_low = 1, + }, + { + .name = "mr600:red:wlan24", + .gpio = MR600V2_GPIO_LED_WLAN24_RED, + .active_low = 1, + }, + { + .name = "mr600:yellow:wlan24", + .gpio = MR600V2_GPIO_LED_WLAN24_YELLOW, + .active_low = 1, + }, + { + .name = "mr600:green:wlan24", + .gpio = MR600V2_GPIO_LED_WLAN24_GREEN, + .active_low = 1, + }, + { + .name = "mr600:red:wlan58", + .gpio = MR600V2_GPIO_LED_WLAN58_RED, + .active_low = 1, + }, + { + .name = "mr600:yellow:wlan58", + .gpio = MR600V2_GPIO_LED_WLAN58_YELLOW, + .active_low = 1, + }, + { + .name = "mr600:green:wlan58", + .gpio = MR600V2_GPIO_LED_WLAN58_GREEN, + .active_low = 1, + }, +}; + static struct gpio_keys_button mr600_gpio_keys[] __initdata = { { .desc = "Reset button", @@ -76,15 +128,14 @@ static struct gpio_keys_button mr600_gpio_keys[] __initdata = { }, }; -static void __init mr600_setup(void) +static void __init mr600_base_setup(unsigned num_leds, struct gpio_led *leds) { - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); + u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); u8 mac[6]; ath79_register_m25p80(NULL); - ath79_register_leds_gpio(-1, ARRAY_SIZE(mr600_leds_gpio), - mr600_leds_gpio); + ath79_register_leds_gpio(-1, num_leds, leds); ath79_register_gpio_keys_polled(-1, MR600_KEYS_POLL_INTERVAL, ARRAY_SIZE(mr600_gpio_keys), mr600_gpio_keys); @@ -110,4 +161,16 @@ static void __init mr600_setup(void) ath79_register_eth(0); } +static void __init mr600_setup(void) +{ + mr600_base_setup(ARRAY_SIZE(mr600_leds_gpio), mr600_leds_gpio); +} + MIPS_MACHINE(ATH79_MACH_MR600, "MR600", "OpenMesh MR600", mr600_setup); + +static void __init mr600v2_setup(void) +{ + mr600_base_setup(ARRAY_SIZE(mr600v2_leds_gpio), mr600v2_leds_gpio); +} + +MIPS_MACHINE(ATH79_MACH_MR600V2, "MR600v2", "OpenMesh MR600v2", mr600v2_setup); |