ar71xx: add support for Compex WPE72/WPE72NX
[openwrt.git] / target / linux / ar71xx / files-3.2 / arch / mips / ath79 / mach-wpe72.c
1 /*
2 * Compex WPE72 board support
3 *
4 * Copyright (C) 2012 Johnathan Boyce<jon.boyce@globalreach.eu.com>
5 *
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.
9 */
10
11 #include<asm/mach-ath79/ath79.h>
12
13 #include "dev-eth.h"
14 #include "dev-gpio-buttons.h"
15 #include "dev-leds-gpio.h"
16 #include "dev-m25p80.h"
17 #include "dev-usb.h"
18 #include "machtypes.h"
19 #include "pci.h"
20
21 #define WPE72_GPIO_RESET 12
22 #define WPE72_GPIO_LED_DIAG 13
23 #define WPE72_GPIO_LED_1 14
24 #define WPE72_GPIO_LED_2 15
25 #define WPE72_GPIO_LED_3 16
26 #define WPE72_GPIO_LED_4 17
27
28 #define WPE72_KEYS_POLL_INTERVAL 20 /* msecs */
29 #define WPE72_KEYS_DEBOUNCE_INTERVAL (3 * WPE72_KEYS_POLL_INTERVAL)
30
31 static struct gpio_led wpe72_leds_gpio[] __initdata = {
32 {
33 .name = "wpe72:green:led1",
34 .gpio = WPE72_GPIO_LED_1,
35 .active_low = 1,
36 }, {
37 .name = "wpe72:green:led2",
38 .gpio = WPE72_GPIO_LED_2,
39 .active_low = 1,
40 }, {
41 .name = "wpe72:green:led3",
42 .gpio = WPE72_GPIO_LED_3,
43 .active_low = 1,
44 }, {
45 .name = "wpe72:green:led4",
46 .gpio = WPE72_GPIO_LED_4,
47 .active_low = 1,
48 }, {
49 .name = "wpe72:green:diag",
50 .gpio = WPE72_GPIO_LED_DIAG,
51 .active_low = 1,
52 }
53 };
54
55 static struct gpio_keys_button wpe72_gpio_keys[] __initdata = {
56 {
57 .desc = "reset",
58 .type = EV_KEY,
59 .code = KEY_RESTART,
60 .debounce_interval = WPE72_KEYS_DEBOUNCE_INTERVAL,
61 .gpio = WPE72_GPIO_RESET,
62 }
63 };
64
65 static const char *wpe72_part_probes[] = {
66 "MyLoader",
67 NULL,
68 };
69
70 static struct flash_platform_data wpe72_flash_data = {
71 .part_probes = wpe72_part_probes,
72 };
73
74 static void __init wpe72_setup(void)
75 {
76 ath79_register_m25p80(&wpe72_flash_data);
77 ath79_register_mdio(0, 0x0);
78
79 ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
80 ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 1);
81
82 ath79_register_eth(0);
83 ath79_register_eth(1);
84
85 ath79_register_usb();
86 ath79_register_pci();
87
88 ath79_register_leds_gpio(-1, ARRAY_SIZE(wpe72_leds_gpio),
89 wpe72_leds_gpio);
90
91 ath79_register_gpio_keys_polled(-1, WPE72_KEYS_POLL_INTERVAL,
92 ARRAY_SIZE(wpe72_gpio_keys),
93 wpe72_gpio_keys);
94 }
95
96 MIPS_MACHINE(ATH79_MACH_WPE72, "WPE72", "Compex WPE72", wpe72_setup);
This page took 0.050113 seconds and 5 git commands to generate.