2 * NETGEAR WNR2000v3/WNR612v2/WNR1000v2/WPN824N board support
4 * Copyright (C) 2015 Hartmut Knaack <knaack.h@gmx.de>
5 * Copyright (C) 2013 Mathieu Olivari <mathieu.olivari@gmail.com>
6 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
7 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
8 * Copyright (C) 2008-2009 Andy Boyett <agb@openwrt.org>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License version 2 as published
12 * by the Free Software Foundation.
15 #include <linux/mtd/mtd.h>
16 #include <linux/mtd/partitions.h>
17 #include <linux/kernel.h> /* for max() macro */
18 #include <linux/platform_device.h> /* PLATFORM_DEVID_AUTO is defined here */
20 #include <asm/mach-ath79/ath79.h>
21 #include <asm/mach-ath79/ar71xx_regs.h> /* needed to disable switch LEDs */
22 #include "common.h" /* needed to disable switch LEDs */
24 #include "dev-ap9x-pci.h"
26 #include "dev-gpio-buttons.h"
27 #include "dev-leds-gpio.h"
28 #include "dev-m25p80.h"
29 #include "machtypes.h"
31 /* WNR2000v3 - connected through AR7241 */
32 #define WNR2000V3_GPIO_LED_WAN_GREEN 0
33 #define WNR2000V3_GPIO_LED_LAN1_AMBER 1
34 #define WNR2000V3_GPIO_LED_LAN2_AMBER 6
35 #define WNR2000V3_GPIO_LED_WPS_GREEN 7
36 #define WNR2000V3_GPIO_LED_LAN3_AMBER 8
37 #define WNR2000V3_GPIO_BTN_WPS 11
38 #define WNR2000V3_GPIO_LED_LAN4_AMBER 12
39 #define WNR2000V3_GPIO_LED_LAN1_GREEN 13
40 #define WNR2000V3_GPIO_LED_LAN2_GREEN 14
41 #define WNR2000V3_GPIO_LED_LAN3_GREEN 15
42 #define WNR2000V3_GPIO_LED_LAN4_GREEN 16
43 #define WNR2000V3_GPIO_LED_WAN_AMBER 17
45 /* WNR2000v3 - connected through AR9287 */
46 #define WNR2000V3_GPIO_WMAC_LED_WLAN_BLUE 1
47 #define WNR2000V3_GPIO_WMAC_LED_TEST_AMBER 2
48 #define WNR2000V3_GPIO_WMAC_LED_POWER_GREEN 3
49 #define WNR2000V3_GPIO_WMAC_BTN_RESET 8
50 #define WNR2000V3_GPIO_WMAC_BTN_RFKILL 9
52 /* WNR612v2 - connected through AR7241 */
53 #define WNR612V2_GPIO_LED_POWER_GREEN 11
54 #define WNR612V2_GPIO_LED_LAN1_GREEN 13
55 #define WNR612V2_GPIO_LED_LAN2_GREEN 14
56 #define WNR612V2_GPIO_LED_WAN_GREEN 17
58 /* WNR612v2 - connected through AR9285 */
59 #define WNR612V2_GPIO_WMAC_LED_WLAN_GREEN 1
60 #define WNR612V2_GPIO_WMAC_BTN_RESET 7
62 /* WNR1000v2 - connected through AR7240 */
63 #define WNR1000V2_GPIO_LED_WAN_AMBER 0
64 #define WNR1000V2_GPIO_LED_TEST_AMBER 1
65 #define WNR1000V2_GPIO_LED_LAN1_AMBER 6 /* AR724X_GPIO_FUNC_JTAG_DISABLE */
66 #define WNR1000V2_GPIO_LED_LAN2_AMBER 7 /* AR724X_GPIO_FUNC_JTAG_DISABLE */
67 #define WNR1000V2_GPIO_LED_LAN3_AMBER 8 /* AR724X_GPIO_FUNC_JTAG_DISABLE */
68 #define WNR1000V2_GPIO_LED_POWER_GREEN 11
69 #define WNR1000V2_GPIO_LED_LAN4_AMBER 12
70 #define WNR1000V2_GPIO_LED_LAN1_GREEN 13 /* AR724X_..._ETH_SWITCH_LED0 */
71 #define WNR1000V2_GPIO_LED_LAN2_GREEN 14 /* AR724X_..._ETH_SWITCH_LED1 */
72 #define WNR1000V2_GPIO_LED_LAN3_GREEN 15 /* AR724X_..._ETH_SWITCH_LED2 */
73 #define WNR1000V2_GPIO_LED_LAN4_GREEN 16 /* AR724X_..._ETH_SWITCH_LED3 */
74 #define WNR1000V2_GPIO_LED_WAN_GREEN 17 /* AR724X_..._ETH_SWITCH_LED4 */
76 /* WNR1000v2 - connected through AR9285 */
77 #define WNR1000V2_GPIO_WMAC_LED_WLAN_BLUE 1
78 #define WNR1000V2_GPIO_WMAC_LED_WPS_GREEN 5
79 #define WNR1000V2_GPIO_WMAC_BTN_WPS 6
80 #define WNR1000V2_GPIO_WMAC_BTN_RESET 7
81 #define WNR1000V2_GPIO_WMAC_BTN_RFKILL 8
83 /* Connected through AR7240 */
84 #define WPN824N_GPIO_LED_WAN_AMBER 0
85 #define WPN824N_GPIO_LED_STATUS_AMBER 1
86 #define WPN824N_GPIO_LED_LAN1_AMBER 6 /* AR724X_GPIO_FUNC_JTAG_DISABLE */
87 #define WPN824N_GPIO_LED_LAN2_AMBER 7 /* AR724X_GPIO_FUNC_JTAG_DISABLE */
88 #define WPN824N_GPIO_LED_LAN3_AMBER 8 /* AR724X_GPIO_FUNC_JTAG_DISABLE */
89 #define WPN824N_GPIO_LED_LAN4_AMBER 12
90 #define WPN824N_GPIO_LED_LAN1_GREEN 13
91 #define WPN824N_GPIO_LED_LAN2_GREEN 14
92 #define WPN824N_GPIO_LED_LAN3_GREEN 15 /* AR724X_GPIO_FUNC_CLK_OBS3_EN */
93 #define WPN824N_GPIO_LED_LAN4_GREEN 16
94 #define WPN824N_GPIO_LED_WAN_GREEN 17
96 /* Connected through AR9285 */
97 #define WPN824N_WGPIO_LED_PWR_GREEN 0
98 #define WPN824N_WGPIO_LED_WLAN_BLUE 1
99 #define WPN824N_WGPIO_LED_WPS1_BLUE 5
100 #define WPN824N_WGPIO_LED_WPS2_BLUE 9
101 #define WPN824N_WGPIO_LED_TEST_AMBER 10
102 #define WPN824N_WGPIO_BTN_PUSH 6 /* currently unused */
103 #define WPN824N_WGPIO_BTN_RESET 7 /* currently unused */
104 #define WPN824N_WGPIO_BTN_WLAN 8 /* currently unused */
106 #define WNR2000V3_KEYS_POLL_INTERVAL 20 /* msecs */
107 #define WNR2000V3_KEYS_DEBOUNCE_INTERVAL (3 * WNR2000V3_KEYS_POLL_INTERVAL)
109 /* ART offsets for: WNR2000v3, WNR612v2, WNR1000v2 */
110 #define WNR2000V3_MAC0_OFFSET 0
111 #define WNR2000V3_MAC1_OFFSET 6
112 #define WNR2000V3_PCIE_CALDATA_OFFSET 0x1000
113 #define WNR2000V3_WMAC_OFFSET 0x108c /* wireless MAC is inside ART */
115 static struct gpio_led wnr2000v3_leds_gpio
[] __initdata
= {
117 .name
= "netgear:green:wan",
118 .gpio
= WNR2000V3_GPIO_LED_WAN_GREEN
,
121 .name
= "netgear:amber:lan1",
122 .gpio
= WNR2000V3_GPIO_LED_LAN1_AMBER
,
125 .name
= "netgear:amber:lan2",
126 .gpio
= WNR2000V3_GPIO_LED_LAN2_AMBER
,
129 .name
= "netgear:amber:lan3",
130 .gpio
= WNR2000V3_GPIO_LED_LAN3_AMBER
,
133 .name
= "netgear:amber:lan4",
134 .gpio
= WNR2000V3_GPIO_LED_LAN4_AMBER
,
137 .name
= "netgear:green:wps",
138 .gpio
= WNR2000V3_GPIO_LED_WPS_GREEN
,
141 .name
= "netgear:green:lan1",
142 .gpio
= WNR2000V3_GPIO_LED_LAN1_GREEN
,
145 .name
= "netgear:green:lan2",
146 .gpio
= WNR2000V3_GPIO_LED_LAN2_GREEN
,
149 .name
= "netgear:green:lan3",
150 .gpio
= WNR2000V3_GPIO_LED_LAN3_GREEN
,
153 .name
= "netgear:green:lan4",
154 .gpio
= WNR2000V3_GPIO_LED_LAN4_GREEN
,
157 .name
= "netgear:amber:wan",
158 .gpio
= WNR2000V3_GPIO_LED_WAN_AMBER
,
163 static struct gpio_led wnr2000v3_wmac_leds_gpio
[] = {
165 .name
= "netgear:green:power",
166 .gpio
= WNR2000V3_GPIO_WMAC_LED_POWER_GREEN
,
168 .default_state
= LEDS_GPIO_DEFSTATE_ON
,
170 .name
= "netgear:amber:test",
171 .gpio
= WNR2000V3_GPIO_WMAC_LED_TEST_AMBER
,
176 /* Blue WLAN LED for: WNR2000v3, WNR1000v2, WPN824N */
177 static const char *wnr2000v3_wmac_led_name
= "netgear:blue:wlan";
179 static struct gpio_led wnr612v2_leds_gpio
[] __initdata
= {
181 .name
= "netgear:green:power",
182 .gpio
= WNR612V2_GPIO_LED_POWER_GREEN
,
185 .name
= "netgear:green:lan1",
186 .gpio
= WNR612V2_GPIO_LED_LAN1_GREEN
,
189 .name
= "netgear:green:lan2",
190 .gpio
= WNR612V2_GPIO_LED_LAN2_GREEN
,
193 .name
= "netgear:green:wan",
194 .gpio
= WNR612V2_GPIO_LED_WAN_GREEN
,
199 static const char *wnr612v2_wmac_led_name
= "netgear:green:wlan";
201 static struct gpio_led wnr1000v2_leds_gpio
[] __initdata
= {
203 .name
= "netgear:amber:lan1",
204 .gpio
= WNR1000V2_GPIO_LED_LAN1_AMBER
,
207 .name
= "netgear:amber:lan2",
208 .gpio
= WNR1000V2_GPIO_LED_LAN2_AMBER
,
211 .name
= "netgear:amber:lan3",
212 .gpio
= WNR1000V2_GPIO_LED_LAN3_AMBER
,
215 .name
= "netgear:amber:lan4",
216 .gpio
= WNR1000V2_GPIO_LED_LAN4_AMBER
,
219 .name
= "netgear:amber:test",
220 .gpio
= WNR1000V2_GPIO_LED_TEST_AMBER
,
223 .name
= "netgear:amber:wan",
224 .gpio
= WNR1000V2_GPIO_LED_WAN_AMBER
,
227 .name
= "netgear:green:lan1",
228 .gpio
= WNR1000V2_GPIO_LED_LAN1_GREEN
,
231 .name
= "netgear:green:lan2",
232 .gpio
= WNR1000V2_GPIO_LED_LAN2_GREEN
,
235 .name
= "netgear:green:lan3",
236 .gpio
= WNR1000V2_GPIO_LED_LAN3_GREEN
,
239 .name
= "netgear:green:lan4",
240 .gpio
= WNR1000V2_GPIO_LED_LAN4_GREEN
,
243 .name
= "netgear:green:power",
244 .gpio
= WNR1000V2_GPIO_LED_POWER_GREEN
,
247 .name
= "netgear:green:wan",
248 .gpio
= WNR1000V2_GPIO_LED_WAN_GREEN
,
253 static struct gpio_led wnr1000v2_wmac_leds_gpio
[] = {
255 .name
= "netgear:green:wps",
256 .gpio
= WNR1000V2_GPIO_WMAC_LED_WPS_GREEN
,
261 static struct gpio_led wpn824n_leds_gpio
[] __initdata
= {
263 .name
= "netgear:amber:wan",
264 .gpio
= WPN824N_GPIO_LED_WAN_AMBER
,
267 .name
= "netgear:amber:status",
268 .gpio
= WPN824N_GPIO_LED_STATUS_AMBER
,
271 .name
= "netgear:amber:lan1",
272 .gpio
= WPN824N_GPIO_LED_LAN1_AMBER
,
275 .name
= "netgear:amber:lan2",
276 .gpio
= WPN824N_GPIO_LED_LAN2_AMBER
,
279 .name
= "netgear:amber:lan3",
280 .gpio
= WPN824N_GPIO_LED_LAN3_AMBER
,
283 .name
= "netgear:amber:lan4",
284 .gpio
= WPN824N_GPIO_LED_LAN4_AMBER
,
287 .name
= "netgear:green:lan1",
288 .gpio
= WPN824N_GPIO_LED_LAN1_GREEN
,
291 .name
= "netgear:green:lan2",
292 .gpio
= WPN824N_GPIO_LED_LAN2_GREEN
,
295 .name
= "netgear:green:lan3",
296 .gpio
= WPN824N_GPIO_LED_LAN3_GREEN
,
299 .name
= "netgear:green:lan4",
300 .gpio
= WPN824N_GPIO_LED_LAN4_GREEN
,
303 .name
= "netgear:green:wan",
304 .gpio
= WPN824N_GPIO_LED_WAN_GREEN
,
309 static struct gpio_led wpn824n_wmac_leds_gpio
[] = {
311 .name
= "netgear:green:power",
312 .gpio
= WPN824N_WGPIO_LED_PWR_GREEN
,
315 .name
= "netgear:blue:wps1",
316 .gpio
= WPN824N_WGPIO_LED_WPS1_BLUE
,
319 .name
= "netgear:blue:wps2",
320 .gpio
= WPN824N_WGPIO_LED_WPS2_BLUE
,
323 .name
= "netgear:amber:test",
324 .gpio
= WPN824N_WGPIO_LED_TEST_AMBER
,
329 static struct gpio_keys_button wnr2000v3_keys_gpio
[] __initdata
= {
333 .code
= KEY_WPS_BUTTON
,
334 .debounce_interval
= WNR2000V3_KEYS_DEBOUNCE_INTERVAL
,
335 .gpio
= WNR2000V3_GPIO_BTN_WPS
,
340 static struct gpio_keys_button wnr2000v3_wmac_keys_gpio
[] = {
345 .debounce_interval
= WNR2000V3_KEYS_DEBOUNCE_INTERVAL
,
346 .gpio
= WNR2000V3_GPIO_WMAC_BTN_RESET
,
352 .debounce_interval
= WNR2000V3_KEYS_DEBOUNCE_INTERVAL
,
353 .gpio
= WNR2000V3_GPIO_WMAC_BTN_RFKILL
,
358 static struct gpio_keys_button wnr612v2_wmac_keys_gpio
[] = {
363 .debounce_interval
= WNR2000V3_KEYS_DEBOUNCE_INTERVAL
,
364 .gpio
= WNR612V2_GPIO_WMAC_BTN_RESET
,
369 static struct gpio_keys_button wnr1000v2_wmac_keys_gpio
[] = {
374 .debounce_interval
= WNR2000V3_KEYS_DEBOUNCE_INTERVAL
,
375 .gpio
= WNR1000V2_GPIO_WMAC_BTN_RESET
,
381 .debounce_interval
= WNR2000V3_KEYS_DEBOUNCE_INTERVAL
,
382 .gpio
= WNR1000V2_GPIO_WMAC_BTN_RFKILL
,
387 .code
= KEY_WPS_BUTTON
,
388 .debounce_interval
= WNR2000V3_KEYS_DEBOUNCE_INTERVAL
,
389 .gpio
= WNR1000V2_GPIO_WMAC_BTN_WPS
,
395 * For WNR2000v3 ART flash area used for WLAN MAC is usually empty (0xff)
396 * so ath9k driver uses random MAC instead each time module is loaded.
397 * To fix that, assign permanent WLAN MAC equal to ethN's MAC plus 1,
398 * so network interfaces get sequential addresses.
399 * If ART wireless MAC address field has been filled by user, use it.
401 static void __init
wnr_get_wmac(u8
*wmac_gen_addr
, int mac0_art_offset
,
402 int mac1_art_offset
, int wmac_art_offset
)
404 u8
*art
= (u8
*) KSEG1ADDR(0x1fff0000);
405 u8
*eth0_mac_addr
= (u8
*) (art
+ mac0_art_offset
);
406 u8
*eth1_mac_addr
= (u8
*) (art
+ mac1_art_offset
);
407 u8
*wlan_mac_addr
= (u8
*) (art
+ wmac_art_offset
);
409 /* only 0xff if all bits are set - address is invalid, empty area */
410 if ((wlan_mac_addr
[0] & wlan_mac_addr
[1] & wlan_mac_addr
[2] &
411 wlan_mac_addr
[3] & wlan_mac_addr
[4] & wlan_mac_addr
[5]) == 0xff) {
412 memcpy(wmac_gen_addr
, eth0_mac_addr
, 5);
413 wmac_gen_addr
[5] = max(eth0_mac_addr
[5], eth1_mac_addr
[5]) + 1;
415 /* Avoid potential conflict in case max(0xff,0x00)+1==0x00 */
416 if (!wmac_gen_addr
[5])
417 wmac_gen_addr
[5] = 1;
419 memcpy(wmac_gen_addr
, wlan_mac_addr
, 6);
422 static void __init
wnr_common_setup(u8
*wmac_addr
)
424 u8
*art
= (u8
*) KSEG1ADDR(0x1fff0000);
426 ath79_register_mdio(0, 0x0);
428 ath79_init_mac(ath79_eth0_data
.mac_addr
, art
+WNR2000V3_MAC0_OFFSET
, 0);
429 ath79_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_RMII
;
430 ath79_eth0_data
.speed
= SPEED_100
;
431 ath79_eth0_data
.duplex
= DUPLEX_FULL
;
433 ath79_init_mac(ath79_eth1_data
.mac_addr
, art
+WNR2000V3_MAC1_OFFSET
, 0);
434 ath79_eth1_data
.phy_if_mode
= PHY_INTERFACE_MODE_RMII
;
435 ath79_eth1_data
.phy_mask
= 0x10;
437 ath79_register_eth(0);
438 ath79_register_eth(1);
440 ath79_register_m25p80(NULL
);
441 ap91_pci_init(art
+ WNR2000V3_PCIE_CALDATA_OFFSET
, wmac_addr
);
444 static void __init
wnr2000v3_setup(void)
449 * Disable JTAG to use all AR724X GPIO LEDs.
450 * Also disable CLKs and bit 20 as u-boot does.
451 * Finally, allow OS to control all link LEDs.
453 ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE
|
454 AR724X_GPIO_FUNC_UART_EN
,
455 AR724X_GPIO_FUNC_CLK_OBS1_EN
|
456 AR724X_GPIO_FUNC_CLK_OBS2_EN
|
457 AR724X_GPIO_FUNC_CLK_OBS3_EN
|
458 AR724X_GPIO_FUNC_CLK_OBS4_EN
|
459 AR724X_GPIO_FUNC_CLK_OBS5_EN
|
460 AR724X_GPIO_FUNC_GE0_MII_CLK_EN
|
461 AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN
|
462 AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN
|
463 AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN
|
464 AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN
|
465 AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN
|
468 wnr_get_wmac(wlan_mac_addr
, WNR2000V3_MAC0_OFFSET
,
469 WNR2000V3_MAC1_OFFSET
, WNR2000V3_WMAC_OFFSET
);
471 wnr_common_setup(wlan_mac_addr
);
473 ath79_register_leds_gpio(-1, ARRAY_SIZE(wnr2000v3_leds_gpio
),
474 wnr2000v3_leds_gpio
);
476 /* Do not use id=-1, we can have more GPIO key-polled devices */
477 ath79_register_gpio_keys_polled(PLATFORM_DEVID_AUTO
,
478 WNR2000V3_KEYS_POLL_INTERVAL
,
479 ARRAY_SIZE(wnr2000v3_keys_gpio
),
480 wnr2000v3_keys_gpio
);
482 ap9x_pci_setup_wmac_led_pin(0, WNR2000V3_GPIO_WMAC_LED_WLAN_BLUE
);
483 ap9x_pci_setup_wmac_led_name(0, wnr2000v3_wmac_led_name
);
485 ap9x_pci_setup_wmac_leds(0, wnr2000v3_wmac_leds_gpio
,
486 ARRAY_SIZE(wnr2000v3_wmac_leds_gpio
));
488 ap9x_pci_setup_wmac_btns(0, wnr2000v3_wmac_keys_gpio
,
489 ARRAY_SIZE(wnr2000v3_wmac_keys_gpio
),
490 WNR2000V3_KEYS_POLL_INTERVAL
);
493 MIPS_MACHINE(ATH79_MACH_WNR2000_V3
, "WNR2000V3", "NETGEAR WNR2000 V3", wnr2000v3_setup
);
495 static void __init
wnr612v2_setup(void)
500 * Disable JTAG and CLKs. Allow OS to control all link LEDs.
501 * Note: U-Boot for WNR612v2 sets undocumented bit 15 but
502 * we leave it for now.
504 ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE
|
505 AR724X_GPIO_FUNC_UART_EN
,
506 AR724X_GPIO_FUNC_CLK_OBS1_EN
|
507 AR724X_GPIO_FUNC_CLK_OBS2_EN
|
508 AR724X_GPIO_FUNC_CLK_OBS3_EN
|
509 AR724X_GPIO_FUNC_CLK_OBS4_EN
|
510 AR724X_GPIO_FUNC_CLK_OBS5_EN
|
511 AR724X_GPIO_FUNC_GE0_MII_CLK_EN
|
512 AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN
|
513 AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN
|
514 AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN
|
515 AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN
|
516 AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN
);
518 wnr_get_wmac(wlan_mac_addr
, WNR2000V3_MAC0_OFFSET
,
519 WNR2000V3_MAC1_OFFSET
, WNR2000V3_WMAC_OFFSET
);
521 wnr_common_setup(wlan_mac_addr
);
523 ath79_register_leds_gpio(-1, ARRAY_SIZE(wnr612v2_leds_gpio
),
527 * This device has no buttons on AR7241 GPIO and no extra LEDs
528 * connected to AR9285 so setup is simpler than for WNR2000v3.
530 ap9x_pci_setup_wmac_led_pin(0, WNR612V2_GPIO_WMAC_LED_WLAN_GREEN
);
531 ap9x_pci_setup_wmac_led_name(0, wnr612v2_wmac_led_name
);
533 ap9x_pci_setup_wmac_leds(0, NULL
, 0);
535 ap9x_pci_setup_wmac_btns(0, wnr612v2_wmac_keys_gpio
,
536 ARRAY_SIZE(wnr612v2_wmac_keys_gpio
),
537 WNR2000V3_KEYS_POLL_INTERVAL
);
540 MIPS_MACHINE(ATH79_MACH_WNR612_V2
, "WNR612V2", "NETGEAR WNR612 V2", wnr612v2_setup
);
542 static void __init
wnr1000v2_setup(void)
547 * Disable JTAG and CLKs. Allow OS to control all link LEDs.
548 * Note: U-Boot for WNR1000v2 sets undocumented bit 15 but
549 * we leave it for now.
551 ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE
|
552 AR724X_GPIO_FUNC_UART_EN
,
553 AR724X_GPIO_FUNC_CLK_OBS1_EN
|
554 AR724X_GPIO_FUNC_CLK_OBS2_EN
|
555 AR724X_GPIO_FUNC_CLK_OBS3_EN
|
556 AR724X_GPIO_FUNC_CLK_OBS4_EN
|
557 AR724X_GPIO_FUNC_CLK_OBS5_EN
|
558 AR724X_GPIO_FUNC_GE0_MII_CLK_EN
|
559 AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN
|
560 AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN
|
561 AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN
|
562 AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN
|
563 AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN
);
565 wnr_get_wmac(wlan_mac_addr
, WNR2000V3_MAC0_OFFSET
,
566 WNR2000V3_MAC1_OFFSET
, WNR2000V3_WMAC_OFFSET
);
568 wnr_common_setup(wlan_mac_addr
);
570 ath79_register_leds_gpio(-1, ARRAY_SIZE(wnr1000v2_leds_gpio
),
571 wnr1000v2_leds_gpio
);
573 ap9x_pci_setup_wmac_led_pin(0, WNR1000V2_GPIO_WMAC_LED_WLAN_BLUE
);
574 ap9x_pci_setup_wmac_led_name(0, wnr2000v3_wmac_led_name
);
576 ap9x_pci_setup_wmac_leds(0, wnr1000v2_wmac_leds_gpio
,
577 ARRAY_SIZE(wnr1000v2_wmac_leds_gpio
));
579 /* All 3 buttons are connected to wireless chip */
580 ap9x_pci_setup_wmac_btns(0, wnr1000v2_wmac_keys_gpio
,
581 ARRAY_SIZE(wnr1000v2_wmac_keys_gpio
),
582 WNR2000V3_KEYS_POLL_INTERVAL
);
585 MIPS_MACHINE(ATH79_MACH_WNR1000_V2
, "WNR1000V2", "NETGEAR WNR1000 V2", wnr1000v2_setup
);
587 static void __init
wpn824n_setup(void)
589 ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE
,
590 AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN
|
591 AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN
|
592 AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN
|
593 AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN
|
594 AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN
|
595 AR724X_GPIO_FUNC_CLK_OBS3_EN
);
597 wnr_common_setup(NULL
);
599 ath79_register_leds_gpio(-1, ARRAY_SIZE(wpn824n_leds_gpio
),
602 ap9x_pci_setup_wmac_led_pin(0, WPN824N_WGPIO_LED_WLAN_BLUE
);
603 ap9x_pci_setup_wmac_led_name(0, wnr2000v3_wmac_led_name
);
604 ap9x_pci_setup_wmac_leds(0, wpn824n_wmac_leds_gpio
,
605 ARRAY_SIZE(wpn824n_wmac_leds_gpio
));
608 MIPS_MACHINE(ATH79_MACH_WPN824N
, "WPN824N", "NETGEAR WPN824N", wpn824n_setup
);