2 * Compex WP543/WPJ543 board support
4 * Copyright (C) 2008-2012 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 <asm/mach-ath79/ar71xx_regs.h>
13 #include <asm/mach-ath79/ath79.h>
16 #include "dev-gpio-buttons.h"
17 #include "dev-leds-gpio.h"
18 #include "dev-m25p80.h"
20 #include "machtypes.h"
23 #define WP543_GPIO_SW6 2
24 #define WP543_GPIO_LED_1 3
25 #define WP543_GPIO_LED_2 4
26 #define WP543_GPIO_LED_WLAN 5
27 #define WP543_GPIO_LED_CONN 6
28 #define WP543_GPIO_LED_DIAG 7
29 #define WP543_GPIO_SW4 8
31 #define WP543_KEYS_POLL_INTERVAL 20 /* msecs */
32 #define WP543_KEYS_DEBOUNCE_INTERVAL (3 * WP543_KEYS_POLL_INTERVAL)
34 static struct gpio_led wp543_leds_gpio[] __initdata = {
36 .name = "wp543:green:led1",
37 .gpio = WP543_GPIO_LED_1,
40 .name = "wp543:green:led2",
41 .gpio = WP543_GPIO_LED_2,
44 .name = "wp543:green:wlan",
45 .gpio = WP543_GPIO_LED_WLAN,
48 .name = "wp543:green:conn",
49 .gpio = WP543_GPIO_LED_CONN,
52 .name = "wp543:green:diag",
53 .gpio = WP543_GPIO_LED_DIAG,
58 static struct gpio_keys_button wp543_gpio_keys[] __initdata = {
63 .debounce_interval = WP543_KEYS_DEBOUNCE_INTERVAL,
64 .gpio = WP543_GPIO_SW6,
70 .debounce_interval = WP543_KEYS_DEBOUNCE_INTERVAL,
71 .gpio = WP543_GPIO_SW4,
76 static const char *wp543_part_probes[] = {
81 static struct flash_platform_data wp543_flash_data = {
82 .part_probes = wp543_part_probes,
85 static void __init wp543_setup(void)
87 ath79_register_m25p80(&wp543_flash_data);
89 ath79_register_mdio(0, 0xfffffff0);
91 ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
92 ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
93 ath79_eth0_data.phy_mask = 0x0f;
94 ath79_eth0_data.reset_bit = AR71XX_RESET_GE0_MAC |
96 ath79_register_eth(0);
101 ath79_register_leds_gpio(-1, ARRAY_SIZE(wp543_leds_gpio),
104 ath79_register_gpio_keys_polled(-1, WP543_KEYS_POLL_INTERVAL,
105 ARRAY_SIZE(wp543_gpio_keys),
109 MIPS_MACHINE(ATH79_MACH_WP543, "WP543", "Compex WP543", wp543_setup);