[ar71xx] aw-nr580: add support for the PCI slot
[openwrt.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-aw-nr580.c
1 /*
2 * AzureWave AW-NR580 board support
3 *
4 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
6 *
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.
10 */
11
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>
18
19 #include <asm/mips_machine.h>
20 #include <asm/mach-ar71xx/ar71xx.h>
21 #include <asm/mach-ar71xx/pci.h>
22
23 #include "devices.h"
24
25 #define AW_NR580_GPIO_BTN_WPS 3
26 #define AW_NR580_GPIO_BTN_RESET 11
27
28 #define AW_NR580_BUTTONS_POLL_INTERVAL 20
29
30 static struct spi_board_info aw_nr580_spi_info[] = {
31 {
32 .bus_num = 0,
33 .chip_select = 0,
34 .max_speed_hz = 25000000,
35 .modalias = "m25p80",
36 }
37 };
38
39 static struct gpio_button aw_nr580_gpio_buttons[] __initdata = {
40 {
41 .desc = "reset",
42 .type = EV_KEY,
43 .code = BTN_0,
44 .threshold = 5,
45 .gpio = AW_NR580_GPIO_BTN_RESET,
46 .active_low = 1,
47 }, {
48 .desc = "wps",
49 .type = EV_KEY,
50 .code = BTN_1,
51 .threshold = 5,
52 .gpio = AW_NR580_GPIO_BTN_WPS,
53 .active_low = 1,
54 }
55 };
56
57 static struct ar71xx_pci_irq aw_nr580_pci_irqs[] __initdata = {
58 {
59 .slot = 1,
60 .pin = 1,
61 .irq = AR71XX_PCI_IRQ_DEV1,
62 }
63 };
64
65
66 static void __init aw_nr580_setup(void)
67 {
68 ar71xx_add_device_mdio(0x0);
69
70 ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
71 ar71xx_eth0_data.phy_mask = 0xf;
72 ar71xx_eth0_data.speed = SPEED_100;
73 ar71xx_eth0_data.duplex = DUPLEX_FULL;
74
75 ar71xx_add_device_eth(0);
76
77 ar71xx_pci_init(ARRAY_SIZE(aw_nr580_pci_irqs), aw_nr580_pci_irqs);
78
79 ar71xx_add_device_spi(NULL, aw_nr580_spi_info,
80 ARRAY_SIZE(aw_nr580_spi_info));
81
82 ar71xx_add_device_gpio_buttons(-1, AW_NR580_BUTTONS_POLL_INTERVAL,
83 ARRAY_SIZE(aw_nr580_gpio_buttons),
84 aw_nr580_gpio_buttons);
85 }
86
87 MIPS_MACHINE(AR71XX_MACH_AW_NR580, "AzureWave AW-NR580", aw_nr580_setup);
This page took 0.054861 seconds and 5 git commands to generate.