2 * Atheros AP113 board support
4 * Copyright (C) 2011 Florian Fainelli <florian@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
12 #include "dev-gpio-buttons.h"
13 #include "dev-leds-gpio.h"
14 #include "dev-m25p80.h"
17 #include "machtypes.h"
19 #define AP113_GPIO_LED_USB 0
20 #define AP113_GPIO_LED_STATUS 1
21 #define AP113_GPIO_LED_ST 11
23 #define AP113_GPIO_BTN_JUMPSTART 12
25 #define AP113_KEYS_POLL_INTERVAL 20 /* msecs */
26 #define AP113_KEYS_DEBOUNCE_INTERVAL (3 * AP113_KEYS_POLL_INTERVAL)
28 static struct gpio_led ap113_leds_gpio
[] __initdata
= {
30 .name
= "ap113:green:usb",
31 .gpio
= AP113_GPIO_LED_USB
,
35 .name
= "ap113:green:status",
36 .gpio
= AP113_GPIO_LED_STATUS
,
40 .name
= "ap113:green:st",
41 .gpio
= AP113_GPIO_LED_ST
,
46 static struct gpio_keys_button ap113_gpio_keys
[] __initdata
= {
48 .desc
= "jumpstart button",
50 .code
= KEY_WPS_BUTTON
,
51 .debounce_interval
= AP113_KEYS_DEBOUNCE_INTERVAL
,
52 .gpio
= AP113_GPIO_BTN_JUMPSTART
,
57 static void __init
ap113_setup(void)
59 u8
*mac
= (u8
*) KSEG1ADDR(0x1fff0000);
61 ath79_register_m25p80(NULL
);
63 ath79_register_mdio(0, ~BIT(0));
64 ath79_init_mac(ath79_eth0_data
.mac_addr
, mac
, 0);
65 ath79_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_RGMII
;
66 ath79_eth0_data
.speed
= SPEED_1000
;
67 ath79_eth0_data
.duplex
= DUPLEX_FULL
;
68 ath79_eth0_data
.phy_mask
= BIT(0);
70 ath79_register_eth(0);
72 ath79_register_gpio_keys_polled(-1, AP113_KEYS_POLL_INTERVAL
,
73 ARRAY_SIZE(ap113_gpio_keys
),
75 ath79_register_leds_gpio(-1, ARRAY_SIZE(ap113_leds_gpio
),
83 MIPS_MACHINE(ATH79_MACH_AP113
, "AP113", "Atheros AP113",