2 * Atheros AP83 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/input.h>
14 #include <linux/spi/spi.h>
15 #include <linux/spi/spi_gpio.h>
17 #include <asm/mips_machine.h>
18 #include <asm/mach-ar71xx/ar71xx.h>
22 #define AP83_GPIO_LED_WLAN 6
23 #define AP83_GPIO_LED_POWER 14
24 #define AP83_GPIO_LED_JUMPSTART 15
25 #define AP83_GPIO_BTN_JUMPSTART 12
26 #define AP83_GPIO_BTN_RESET 21
28 #define AP83_GPIO_VSC7385_CS 1
29 #define AP83_GPIO_VSC7385_MISO 3
30 #define AP83_GPIO_VSC7385_MOSI 16
31 #define AP83_GPIO_VSC7385_SCK 17
33 static struct gpio_led ap83_leds_gpio
[] __initdata
= {
35 .name
= "ap83:green:jumpstart",
36 .gpio
= AP83_GPIO_LED_JUMPSTART
,
39 .name
= "ap83:green:power",
40 .gpio
= AP83_GPIO_LED_POWER
,
43 .name
= "ap83:green:wlan",
44 .gpio
= AP83_GPIO_LED_WLAN
,
49 static struct gpio_button ap83_gpio_buttons
[] __initdata
= {
55 .gpio
= AP83_GPIO_BTN_RESET
,
62 .gpio
= AP83_GPIO_BTN_JUMPSTART
,
67 static struct spi_gpio_platform_data ap83_spi_data
= {
68 .miso
= AP83_GPIO_VSC7385_MISO
,
69 .mosi
= AP83_GPIO_VSC7385_MOSI
,
70 .sck
= AP83_GPIO_VSC7385_SCK
,
74 static struct platform_device ap83_spi_device
= {
78 .platform_data
= &ap83_spi_data
,
82 static void __init
ap83_setup(void)
84 ar71xx_add_device_mdio(0xfffffffe);
86 ar71xx_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_RGMII
;
87 ar71xx_eth0_data
.phy_mask
= 0x1;
89 ar71xx_add_device_eth(0);
91 ar71xx_eth1_data
.phy_if_mode
= PHY_INTERFACE_MODE_RGMII
;
92 ar71xx_eth1_data
.phy_mask
= 0x0;
93 ar71xx_eth1_data
.speed
= SPEED_1000
;
94 ar71xx_eth1_data
.duplex
= DUPLEX_FULL
;
96 ar71xx_add_device_eth(1);
98 ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio
),
101 ar71xx_add_device_gpio_buttons(-1, 20, ARRAY_SIZE(ap83_gpio_buttons
),
104 ar71xx_add_device_usb();
106 ar91xx_add_device_wmac();
108 platform_device_register(&ap83_spi_device
);
111 MIPS_MACHINE(AR71XX_MACH_AP83
, "Atheros AP83", ap83_setup
);