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>
15 #include <asm/mips_machine.h>
16 #include <asm/mach-ar71xx/ar71xx.h>
17 #include <asm/mach-ar71xx/pci.h>
21 #define AP83_GPIO_LED_WLAN 6
22 #define AP83_GPIO_LED_POWER 14
23 #define AP83_GPIO_LED_JUMPSTART 15
24 #define AP83_GPIO_BTN_JUMPSTART 12
25 #define AP83_GPIO_BTN_RESET 21
27 static struct gpio_led ap83_leds_gpio
[] __initdata
= {
29 .name
= "ap83:green:jumpstart",
30 .gpio
= AP83_GPIO_LED_JUMPSTART
,
33 .name
= "ap83:green:power",
34 .gpio
= AP83_GPIO_LED_POWER
,
37 .name
= "ap83:green:wlan",
38 .gpio
= AP83_GPIO_LED_WLAN
,
43 static struct gpio_button ap83_gpio_buttons
[] __initdata
= {
49 .gpio
= AP83_GPIO_BTN_RESET
,
56 .gpio
= AP83_GPIO_BTN_JUMPSTART
,
61 static void __init
ap83_setup(void)
63 ar71xx_add_device_mdio(0xfffffffe);
65 ar71xx_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_RGMII
;
66 ar71xx_eth0_data
.phy_mask
= 0x1;
68 ar71xx_add_device_eth(0);
70 ar71xx_eth1_data
.phy_if_mode
= PHY_INTERFACE_MODE_RGMII
;
71 ar71xx_eth1_data
.phy_mask
= 0x0;
72 ar71xx_eth1_data
.speed
= SPEED_1000
;
73 ar71xx_eth1_data
.duplex
= DUPLEX_FULL
;
75 ar71xx_add_device_eth(1);
77 ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio
),
80 ar71xx_add_device_gpio_buttons(-1, 20, ARRAY_SIZE(ap83_gpio_buttons
),
83 ar71xx_add_device_usb();
85 ar91xx_add_device_wmac();
88 MIPS_MACHINE(AR71XX_MACH_AP83
, "Atheros AP83", ap83_setup
);