2 * AzureWave AW-NR580 board support
4 * Copyright (C) 2008-2009 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 <linux/platform_device.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <linux/spi/spi.h>
16 #include <linux/spi/flash.h>
17 #include <linux/input.h>
19 #include <asm/mips_machine.h>
20 #include <asm/mach-ar71xx/ar71xx.h>
21 #include <asm/mach-ar71xx/pci.h>
25 #define AW_NR580_GPIO_LED_READY_RED 0
26 #define AW_NR580_GPIO_LED_WLAN 1
27 #define AW_NR580_GPIO_LED_READY_GREEN 2
28 #define AW_NR580_GPIO_LED_WPS_GREEN 4
29 #define AW_NR580_GPIO_LED_WPS_AMBER 5
31 #define AW_NR580_GPIO_BTN_WPS 3
32 #define AW_NR580_GPIO_BTN_RESET 11
34 #define AW_NR580_BUTTONS_POLL_INTERVAL 20
36 static struct spi_board_info aw_nr580_spi_info
[] = {
40 .max_speed_hz
= 25000000,
45 static struct gpio_led aw_nr580_leds_gpio
[] __initdata
= {
47 .name
= "aw-nr580:red:ready",
48 .gpio
= AW_NR580_GPIO_LED_READY_RED
,
51 .name
= "aw-nr580:green:ready",
52 .gpio
= AW_NR580_GPIO_LED_READY_GREEN
,
55 .name
= "aw-nr580:green:wps",
56 .gpio
= AW_NR580_GPIO_LED_WPS_GREEN
,
59 .name
= "aw-nr580:amber:wps",
60 .gpio
= AW_NR580_GPIO_LED_WPS_AMBER
,
63 .name
= "aw-nr580:green:wlan",
64 .gpio
= AW_NR580_GPIO_LED_WLAN
,
69 static struct gpio_button aw_nr580_gpio_buttons
[] __initdata
= {
75 .gpio
= AW_NR580_GPIO_BTN_RESET
,
82 .gpio
= AW_NR580_GPIO_BTN_WPS
,
87 static struct ar71xx_pci_irq aw_nr580_pci_irqs
[] __initdata
= {
91 .irq
= AR71XX_PCI_IRQ_DEV1
,
95 static void __init
aw_nr580_setup(void)
97 ar71xx_add_device_mdio(0x0);
99 ar71xx_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_MII
;
100 ar71xx_eth0_data
.phy_mask
= 0xf;
101 ar71xx_eth0_data
.speed
= SPEED_100
;
102 ar71xx_eth0_data
.duplex
= DUPLEX_FULL
;
104 ar71xx_add_device_eth(0);
106 ar71xx_pci_init(ARRAY_SIZE(aw_nr580_pci_irqs
), aw_nr580_pci_irqs
);
108 ar71xx_add_device_spi(NULL
, aw_nr580_spi_info
,
109 ARRAY_SIZE(aw_nr580_spi_info
));
111 ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(aw_nr580_leds_gpio
),
114 ar71xx_add_device_gpio_buttons(-1, AW_NR580_BUTTONS_POLL_INTERVAL
,
115 ARRAY_SIZE(aw_nr580_gpio_buttons
),
116 aw_nr580_gpio_buttons
);
119 MIPS_MACHINE(AR71XX_MACH_AW_NR580
, "AzureWave AW-NR580", aw_nr580_setup
);