diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2011-06-20 13:26:13 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-12-07 17:02:47 -0500 |
commit | 7e0dde175e5c06c31624e7fb88975eee683d6894 (patch) | |
tree | fadd9013f22dfdf56ac8e694468e35f6b694053f /arch/mips/ath79 | |
parent | 13051c5cc3dd2600afe980049eb566b9b6a4afda (diff) |
MIPS: ath79: Add initial support for the Atheros AP121 reference board
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: Kathy Giori <kgiori@qca.qualcomm.com>
Cc: "Luis R. Rodriguez" <rodrigue@qca.qualcomm.com>
Patchwork: https://patchwork.linux-mips.org/patch/2531/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/ath79')
-rw-r--r-- | arch/mips/ath79/Kconfig | 11 | ||||
-rw-r--r-- | arch/mips/ath79/Makefile | 1 | ||||
-rw-r--r-- | arch/mips/ath79/mach-ap121.c | 88 | ||||
-rw-r--r-- | arch/mips/ath79/machtypes.h | 1 |
4 files changed, 101 insertions, 0 deletions
diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig index c3680c83a102..4a7e0e871e90 100644 --- a/arch/mips/ath79/Kconfig +++ b/arch/mips/ath79/Kconfig | |||
@@ -2,6 +2,17 @@ if ATH79 | |||
2 | 2 | ||
3 | menu "Atheros AR71XX/AR724X/AR913X machine selection" | 3 | menu "Atheros AR71XX/AR724X/AR913X machine selection" |
4 | 4 | ||
5 | config ATH79_MACH_AP121 | ||
6 | bool "Atheros AP121 reference board" | ||
7 | select SOC_AR933X | ||
8 | select ATH79_DEV_GPIO_BUTTONS | ||
9 | select ATH79_DEV_LEDS_GPIO | ||
10 | select ATH79_DEV_SPI | ||
11 | select ATH79_DEV_USB | ||
12 | help | ||
13 | Say 'Y' here if you want your kernel to support the | ||
14 | Atheros AP121 reference board. | ||
15 | |||
5 | config ATH79_MACH_AP81 | 16 | config ATH79_MACH_AP81 |
6 | bool "Atheros AP81 reference board" | 17 | bool "Atheros AP81 reference board" |
7 | select SOC_AR913X | 18 | select SOC_AR913X |
diff --git a/arch/mips/ath79/Makefile b/arch/mips/ath79/Makefile index 57188b61b9ae..8933d18fd0f0 100644 --- a/arch/mips/ath79/Makefile +++ b/arch/mips/ath79/Makefile | |||
@@ -25,5 +25,6 @@ obj-$(CONFIG_ATH79_DEV_USB) += dev-usb.o | |||
25 | # | 25 | # |
26 | # Machines | 26 | # Machines |
27 | # | 27 | # |
28 | obj-$(CONFIG_ATH79_MACH_AP121) += mach-ap121.o | ||
28 | obj-$(CONFIG_ATH79_MACH_AP81) += mach-ap81.o | 29 | obj-$(CONFIG_ATH79_MACH_AP81) += mach-ap81.o |
29 | obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o | 30 | obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o |
diff --git a/arch/mips/ath79/mach-ap121.c b/arch/mips/ath79/mach-ap121.c new file mode 100644 index 000000000000..353af55fe94d --- /dev/null +++ b/arch/mips/ath79/mach-ap121.c | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | * Atheros AP121 board support | ||
3 | * | ||
4 | * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org> | ||
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 "machtypes.h" | ||
12 | #include "dev-gpio-buttons.h" | ||
13 | #include "dev-leds-gpio.h" | ||
14 | #include "dev-spi.h" | ||
15 | #include "dev-usb.h" | ||
16 | |||
17 | #define AP121_GPIO_LED_WLAN 0 | ||
18 | #define AP121_GPIO_LED_USB 1 | ||
19 | |||
20 | #define AP121_GPIO_BTN_JUMPSTART 11 | ||
21 | #define AP121_GPIO_BTN_RESET 12 | ||
22 | |||
23 | #define AP121_KEYS_POLL_INTERVAL 20 /* msecs */ | ||
24 | #define AP121_KEYS_DEBOUNCE_INTERVAL (3 * AP121_KEYS_POLL_INTERVAL) | ||
25 | |||
26 | #define AP121_CAL_DATA_ADDR 0x1fff1000 | ||
27 | |||
28 | static struct gpio_led ap121_leds_gpio[] __initdata = { | ||
29 | { | ||
30 | .name = "ap121:green:usb", | ||
31 | .gpio = AP121_GPIO_LED_USB, | ||
32 | .active_low = 0, | ||
33 | }, | ||
34 | { | ||
35 | .name = "ap121:green:wlan", | ||
36 | .gpio = AP121_GPIO_LED_WLAN, | ||
37 | .active_low = 0, | ||
38 | }, | ||
39 | }; | ||
40 | |||
41 | static struct gpio_keys_button ap121_gpio_keys[] __initdata = { | ||
42 | { | ||
43 | .desc = "jumpstart button", | ||
44 | .type = EV_KEY, | ||
45 | .code = KEY_WPS_BUTTON, | ||
46 | .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL, | ||
47 | .gpio = AP121_GPIO_BTN_JUMPSTART, | ||
48 | .active_low = 1, | ||
49 | }, | ||
50 | { | ||
51 | .desc = "reset button", | ||
52 | .type = EV_KEY, | ||
53 | .code = KEY_RESTART, | ||
54 | .debounce_interval = AP121_KEYS_DEBOUNCE_INTERVAL, | ||
55 | .gpio = AP121_GPIO_BTN_RESET, | ||
56 | .active_low = 1, | ||
57 | } | ||
58 | }; | ||
59 | |||
60 | static struct spi_board_info ap121_spi_info[] = { | ||
61 | { | ||
62 | .bus_num = 0, | ||
63 | .chip_select = 0, | ||
64 | .max_speed_hz = 25000000, | ||
65 | .modalias = "mx25l1606e", | ||
66 | } | ||
67 | }; | ||
68 | |||
69 | static struct ath79_spi_platform_data ap121_spi_data = { | ||
70 | .bus_num = 0, | ||
71 | .num_chipselect = 1, | ||
72 | }; | ||
73 | |||
74 | static void __init ap121_setup(void) | ||
75 | { | ||
76 | ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_leds_gpio), | ||
77 | ap121_leds_gpio); | ||
78 | ath79_register_gpio_keys_polled(-1, AP121_KEYS_POLL_INTERVAL, | ||
79 | ARRAY_SIZE(ap121_gpio_keys), | ||
80 | ap121_gpio_keys); | ||
81 | |||
82 | ath79_register_spi(&ap121_spi_data, ap121_spi_info, | ||
83 | ARRAY_SIZE(ap121_spi_info)); | ||
84 | ath79_register_usb(); | ||
85 | } | ||
86 | |||
87 | MIPS_MACHINE(ATH79_MACH_AP121, "AP121", "Atheros AP121 reference board", | ||
88 | ap121_setup); | ||
diff --git a/arch/mips/ath79/machtypes.h b/arch/mips/ath79/machtypes.h index 3940fe470b2d..6e28d51c93d5 100644 --- a/arch/mips/ath79/machtypes.h +++ b/arch/mips/ath79/machtypes.h | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | enum ath79_mach_type { | 17 | enum ath79_mach_type { |
18 | ATH79_MACH_GENERIC = 0, | 18 | ATH79_MACH_GENERIC = 0, |
19 | ATH79_MACH_AP121, /* Atheros AP121 reference board */ | ||
19 | ATH79_MACH_AP81, /* Atheros AP81 reference board */ | 20 | ATH79_MACH_AP81, /* Atheros AP81 reference board */ |
20 | ATH79_MACH_PB44, /* Atheros PB44 reference board */ | 21 | ATH79_MACH_PB44, /* Atheros PB44 reference board */ |
21 | }; | 22 | }; |