2 * Ubiquiti Networks XM (rev 1.0) board support
4 * Copyright (C) 2011 René Bolldorf <xsecute@googlemail.com>
6 * Derived from: mach-pb44.c
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
13 #include <linux/init.h>
14 #include <linux/pci.h>
15 #include <linux/platform_device.h>
16 #include <linux/ath9k_platform.h>
17 #include <linux/etherdevice.h>
18 #include <linux/ar8216_platform.h>
20 #include <asm/mach-ath79/ath79.h>
21 #include <asm/mach-ath79/irq.h>
22 #include <asm/mach-ath79/ar71xx_regs.h>
24 #include <linux/platform_data/phy-at803x.h>
27 #include "dev-ap9x-pci.h"
29 #include "dev-gpio-buttons.h"
30 #include "dev-leds-gpio.h"
31 #include "dev-m25p80.h"
34 #include "machtypes.h"
36 #define UBNT_XM_GPIO_LED_L1 0
37 #define UBNT_XM_GPIO_LED_L2 1
38 #define UBNT_XM_GPIO_LED_L3 11
39 #define UBNT_XM_GPIO_LED_L4 7
41 #define UBNT_XM_GPIO_BTN_RESET 12
43 #define UBNT_XM_KEYS_POLL_INTERVAL 20
44 #define UBNT_XM_KEYS_DEBOUNCE_INTERVAL (3 * UBNT_XM_KEYS_POLL_INTERVAL)
46 #define UBNT_XM_EEPROM_ADDR 0x1fff1000
48 static struct gpio_led ubnt_xm_leds_gpio[] __initdata = {
50 .name = "ubnt:red:link1",
51 .gpio = UBNT_XM_GPIO_LED_L1,
54 .name = "ubnt:orange:link2",
55 .gpio = UBNT_XM_GPIO_LED_L2,
58 .name = "ubnt:green:link3",
59 .gpio = UBNT_XM_GPIO_LED_L3,
62 .name = "ubnt:green:link4",
63 .gpio = UBNT_XM_GPIO_LED_L4,
68 static struct gpio_keys_button ubnt_xm_gpio_keys[] __initdata = {
73 .debounce_interval = UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
74 .gpio = UBNT_XM_GPIO_BTN_RESET,
79 #define UBNT_M_WAN_PHYMASK BIT(4)
81 static void __init ubnt_xm_init(void)
83 u8 *eeprom = (u8 *) KSEG1ADDR(UBNT_XM_EEPROM_ADDR);
84 u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
85 u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
87 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xm_leds_gpio),
90 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
91 ARRAY_SIZE(ubnt_xm_gpio_keys),
94 ath79_register_m25p80(NULL);
95 ap91_pci_init(eeprom, NULL);
97 ath79_register_mdio(0, ~UBNT_M_WAN_PHYMASK);
98 ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
99 ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
100 ath79_register_eth(0);
103 MIPS_MACHINE(ATH79_MACH_UBNT_XM,
105 "Ubiquiti Networks XM (rev 1.0) board",
108 MIPS_MACHINE(ATH79_MACH_UBNT_BULLET_M, "UBNT-BM", "Ubiquiti Bullet M",
111 static void __init ubnt_rocket_m_setup(void)
114 ath79_register_usb();
117 MIPS_MACHINE(ATH79_MACH_UBNT_ROCKET_M, "UBNT-RM", "Ubiquiti Rocket M",
118 ubnt_rocket_m_setup);
120 static void __init ubnt_nano_m_setup(void)
123 ath79_register_eth(1);
126 MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M, "UBNT-NM", "Ubiquiti Nanostation M",
129 static struct gpio_led ubnt_airrouter_leds_gpio[] __initdata = {
131 .name = "ubnt:green:globe",
135 .name = "ubnt:green:power",
138 .default_state = LEDS_GPIO_DEFSTATE_ON,
142 static void __init ubnt_airrouter_setup(void)
144 u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
145 u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
147 ath79_register_m25p80(NULL);
148 ath79_register_mdio(0, ~UBNT_M_WAN_PHYMASK);
150 ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
151 ath79_init_local_mac(ath79_eth1_data.mac_addr, mac1);
153 ath79_register_eth(1);
154 ath79_register_eth(0);
155 ath79_register_usb();
157 ap91_pci_init(ee, NULL);
158 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airrouter_leds_gpio),
159 ubnt_airrouter_leds_gpio);
161 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
162 ARRAY_SIZE(ubnt_xm_gpio_keys),
166 MIPS_MACHINE(ATH79_MACH_UBNT_AIRROUTER, "UBNT-AR", "Ubiquiti AirRouter",
167 ubnt_airrouter_setup);
169 static struct gpio_led ubnt_unifi_leds_gpio[] __initdata = {
171 .name = "ubnt:orange:dome",
175 .name = "ubnt:green:dome",
181 static struct gpio_led ubnt_unifi_outdoor_leds_gpio[] __initdata = {
183 .name = "ubnt:orange:front",
187 .name = "ubnt:green:front",
193 static struct gpio_led ubnt_unifi_outdoor_plus_leds_gpio[] __initdata = {
195 .name = "ubnt:white:front",
199 .name = "ubnt:blue:front",
206 static void __init ubnt_unifi_setup(void)
208 u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
209 u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
211 ath79_register_m25p80(NULL);
213 ath79_register_mdio(0, ~UBNT_M_WAN_PHYMASK);
215 ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
216 ath79_register_eth(0);
218 ap91_pci_init(ee, NULL);
220 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_leds_gpio),
221 ubnt_unifi_leds_gpio);
223 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
224 ARRAY_SIZE(ubnt_xm_gpio_keys),
228 MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI, "UBNT-UF", "Ubiquiti UniFi",
232 #define UBNT_UNIFIOD_PRI_PHYMASK BIT(4)
233 #define UBNT_UNIFIOD_2ND_PHYMASK (BIT(0) | BIT(1) | BIT(2) | BIT(3))
235 static void __init ubnt_unifi_outdoor_setup(void)
237 u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
238 u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
239 u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
241 ath79_register_m25p80(NULL);
243 ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
244 UBNT_UNIFIOD_2ND_PHYMASK));
246 ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
247 ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
248 ath79_register_eth(0);
249 ath79_register_eth(1);
251 ap91_pci_init(ee, NULL);
253 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_leds_gpio),
254 ubnt_unifi_outdoor_leds_gpio);
256 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
257 ARRAY_SIZE(ubnt_xm_gpio_keys),
261 MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR, "UBNT-U20",
262 "Ubiquiti UniFiAP Outdoor",
263 ubnt_unifi_outdoor_setup);
266 static void __init ubnt_unifi_outdoor_plus_setup(void)
268 u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
269 u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
270 u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
272 ath79_register_m25p80(NULL);
274 ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
275 UBNT_UNIFIOD_2ND_PHYMASK));
277 ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
278 ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
279 ath79_register_eth(0);
280 ath79_register_eth(1);
282 ap91_pci_init(ee, NULL);
284 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio),
285 ubnt_unifi_outdoor_plus_leds_gpio);
287 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
288 ARRAY_SIZE(ubnt_xm_gpio_keys),
292 MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, "UBNT-UOP",
293 "Ubiquiti UniFiAP Outdoor+",
294 ubnt_unifi_outdoor_plus_setup);
297 static struct gpio_led ubnt_uap_pro_gpio_leds[] __initdata = {
299 .name = "ubnt:white:dome",
302 .name = "ubnt:blue:dome",
307 static struct gpio_keys_button uap_pro_gpio_keys[] __initdata = {
312 .debounce_interval = UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
318 static struct ar8327_pad_cfg uap_pro_ar8327_pad0_cfg = {
319 .mode = AR8327_PAD_MAC_RGMII,
320 .txclk_delay_en = true,
321 .rxclk_delay_en = true,
322 .txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
323 .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
326 static struct ar8327_platform_data uap_pro_ar8327_data = {
327 .pad0_cfg = &uap_pro_ar8327_pad0_cfg,
330 .speed = AR8327_PORT_SPEED_1000,
337 static struct mdio_board_info uap_pro_mdio0_info[] = {
339 .bus_id = "ag71xx-mdio.0",
341 .platform_data = &uap_pro_ar8327_data,
345 #define UAP_PRO_MAC0_OFFSET 0x0000
346 #define UAP_PRO_MAC1_OFFSET 0x0006
347 #define UAP_PRO_WMAC_CALDATA_OFFSET 0x1000
348 #define UAP_PRO_PCI_CALDATA_OFFSET 0x5000
350 static void __init ubnt_uap_pro_setup(void)
352 u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
354 ath79_register_m25p80(NULL);
356 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_uap_pro_gpio_leds),
357 ubnt_uap_pro_gpio_leds);
358 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
359 ARRAY_SIZE(uap_pro_gpio_keys),
362 ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
363 ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
365 ath79_register_mdio(0, 0x0);
366 mdiobus_register_board_info(uap_pro_mdio0_info,
367 ARRAY_SIZE(uap_pro_mdio0_info));
369 ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
370 ath79_init_mac(ath79_eth0_data.mac_addr,
371 eeprom + UAP_PRO_MAC0_OFFSET, 0);
373 /* GMAC0 is connected to an AR8327 switch */
374 ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
375 ath79_eth0_data.phy_mask = BIT(0);
376 ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
377 ath79_eth0_pll_data.pll_1000 = 0x06000000;
378 ath79_register_eth(0);
381 MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro",
384 #define UBNT_XW_GPIO_LED_L1 11
385 #define UBNT_XW_GPIO_LED_L2 16
386 #define UBNT_XW_GPIO_LED_L3 13
387 #define UBNT_XW_GPIO_LED_L4 14
389 static struct gpio_led ubnt_xw_leds_gpio[] __initdata = {
391 .name = "ubnt:red:link1",
392 .gpio = UBNT_XW_GPIO_LED_L1,
395 .name = "ubnt:orange:link2",
396 .gpio = UBNT_XW_GPIO_LED_L2,
399 .name = "ubnt:green:link3",
400 .gpio = UBNT_XW_GPIO_LED_L3,
403 .name = "ubnt:green:link4",
404 .gpio = UBNT_XW_GPIO_LED_L4,
409 #define UBNT_ROCKET_TI_GPIO_LED_L1 16
410 #define UBNT_ROCKET_TI_GPIO_LED_L2 17
411 #define UBNT_ROCKET_TI_GPIO_LED_L3 18
412 #define UBNT_ROCKET_TI_GPIO_LED_L4 19
413 #define UBNT_ROCKET_TI_GPIO_LED_L5 20
414 #define UBNT_ROCKET_TI_GPIO_LED_L6 21
415 static struct gpio_led ubnt_rocket_ti_leds_gpio[] __initdata = {
417 .name = "ubnt:green:link1",
418 .gpio = UBNT_ROCKET_TI_GPIO_LED_L1,
421 .name = "ubnt:green:link2",
422 .gpio = UBNT_ROCKET_TI_GPIO_LED_L2,
425 .name = "ubnt:green:link3",
426 .gpio = UBNT_ROCKET_TI_GPIO_LED_L3,
429 .name = "ubnt:green:link4",
430 .gpio = UBNT_ROCKET_TI_GPIO_LED_L4,
433 .name = "ubnt:green:link5",
434 .gpio = UBNT_ROCKET_TI_GPIO_LED_L5,
437 .name = "ubnt:green:link6",
438 .gpio = UBNT_ROCKET_TI_GPIO_LED_L6,
443 static void __init ubnt_xw_init(void)
445 u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
447 ath79_register_m25p80(NULL);
449 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xw_leds_gpio),
451 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
452 ARRAY_SIZE(ubnt_xm_gpio_keys),
455 ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
456 ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
459 ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0_SLAVE);
460 ath79_init_mac(ath79_eth0_data.mac_addr,
461 eeprom + UAP_PRO_MAC0_OFFSET, 0);
463 ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
464 ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
467 static void __init ubnt_nano_m_xw_setup(void)
471 /* GMAC0 is connected to an AR8326 switch */
472 ath79_register_mdio(0, ~(BIT(0) | BIT(1) | BIT(5)));
473 ath79_eth0_data.phy_mask = (BIT(0) | BIT(1) | BIT(5));
474 ath79_eth0_data.speed = SPEED_100;
475 ath79_eth0_data.duplex = DUPLEX_FULL;
476 ath79_register_eth(0);
479 static void __init ubnt_loco_m_xw_setup(void)
483 ath79_register_mdio(0, ~BIT(1));
484 ath79_eth0_data.phy_mask = BIT(1);
485 ath79_register_eth(0);
488 static void __init ubnt_rocket_m_xw_setup(void)
490 u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
492 ath79_register_m25p80(NULL);
494 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xw_leds_gpio),
496 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
497 ARRAY_SIZE(ubnt_xm_gpio_keys),
500 ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
501 ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
503 ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
504 ath79_init_mac(ath79_eth0_data.mac_addr,
505 eeprom + UAP_PRO_MAC0_OFFSET, 0);
507 ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
508 ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
510 ath79_register_mdio(0, ~BIT(4));
511 ath79_eth0_data.phy_mask = BIT(4);
512 ath79_eth0_pll_data.pll_1000 = 0x06000000;
513 ath79_register_eth(0);
516 static struct at803x_platform_data ubnt_rocket_m_ti_at803_data = {
517 .disable_smarteee = 1,
518 .enable_rgmii_rx_delay = 1,
519 .enable_rgmii_tx_delay = 1,
521 static struct mdio_board_info ubnt_rocket_m_ti_mdio_info[] = {
523 .bus_id = "ag71xx-mdio.0",
525 .platform_data = &ubnt_rocket_m_ti_at803_data,
529 static void __init ubnt_rocket_m_ti_setup(void)
531 u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
533 ath79_register_m25p80(NULL);
535 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_rocket_ti_leds_gpio),
536 ubnt_rocket_ti_leds_gpio);
537 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
538 ARRAY_SIZE(ubnt_xm_gpio_keys),
541 ap91_pci_init(eeprom + 0x1000, NULL);
543 ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
544 ath79_setup_ar934x_eth_rx_delay(3, 3);
545 ath79_init_mac(ath79_eth0_data.mac_addr,
546 eeprom + UAP_PRO_MAC0_OFFSET, 0);
547 ath79_init_mac(ath79_eth1_data.mac_addr,
548 eeprom + UAP_PRO_MAC1_OFFSET, 0);
550 ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
551 ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
552 ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
553 ath79_eth1_data.mii_bus_dev = &ath79_mdio1_device.dev;
555 mdiobus_register_board_info(ubnt_rocket_m_ti_mdio_info,
556 ARRAY_SIZE(ubnt_rocket_m_ti_mdio_info));
557 ath79_register_mdio(0, 0x0);
560 ath79_eth0_data.phy_mask = BIT(4);
561 /* read out from vendor */
562 ath79_eth0_pll_data.pll_1000 = 0x2000000;
563 ath79_eth0_pll_data.pll_10 = 0x1313;
564 ath79_register_eth(0);
566 ath79_register_mdio(1, 0x0);
567 ath79_eth1_data.phy_mask = BIT(3);
568 ath79_register_eth(1);
572 MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW",
573 ubnt_nano_m_xw_setup);
575 MIPS_MACHINE(ATH79_MACH_UBNT_LOCO_M_XW, "UBNT-LOCO-XW", "Ubiquiti Loco M XW",
576 ubnt_loco_m_xw_setup);
578 MIPS_MACHINE(ATH79_MACH_UBNT_ROCKET_M_XW, "UBNT-RM-XW", "Ubiquiti Rocket M XW",
579 ubnt_rocket_m_xw_setup);
581 MIPS_MACHINE(ATH79_MACH_UBNT_ROCKET_M_TI, "UBNT-RM-TI", "Ubiquiti Rocket M TI",
582 ubnt_rocket_m_ti_setup);
584 static struct gpio_led ubnt_airgateway_gpio_leds[] __initdata = {
586 .name = "ubnt:blue:wlan",
589 .name = "ubnt:white:status",
594 static struct gpio_keys_button airgateway_gpio_keys[] __initdata = {
599 .debounce_interval = UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
605 static void __init ubnt_airgateway_setup(void)
608 u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff0000);
609 u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
610 u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
613 ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
614 AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
615 AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
616 AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
617 AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
619 t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
620 t |= AR933X_BOOTSTRAP_MDIO_GPIO_EN;
621 ath79_reset_wr(AR933X_RESET_REG_BOOTSTRAP, t);
623 ath79_register_m25p80(NULL);
624 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_gpio_leds),
625 ubnt_airgateway_gpio_leds);
627 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
628 ARRAY_SIZE(airgateway_gpio_keys),
629 airgateway_gpio_keys);
631 ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
632 ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
634 ath79_register_mdio(0, 0x0);
636 ath79_register_eth(1);
637 ath79_register_eth(0);
639 ath79_register_wmac(ee, NULL);
642 MIPS_MACHINE(ATH79_MACH_UBNT_AIRGW, "UBNT-AGW", "Ubiquiti AirGateway",
643 ubnt_airgateway_setup);
645 static struct gpio_led ubnt_airgateway_pro_gpio_leds[] __initdata = {
647 .name = "ubnt:blue:wlan",
650 .name = "ubnt:white:status",
656 static struct gpio_keys_button airgateway_pro_gpio_keys[] __initdata = {
661 .debounce_interval = UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
667 static void __init ubnt_airgateway_pro_setup(void)
669 u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
670 u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff0000);
672 ath79_register_m25p80(NULL);
673 ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_pro_gpio_leds),
674 ubnt_airgateway_pro_gpio_leds);
676 ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
677 ARRAY_SIZE(airgateway_pro_gpio_keys),
678 airgateway_pro_gpio_keys);
680 ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
681 ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
684 ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
686 ath79_register_mdio(1, 0x0);
688 /* GMAC0 is left unused in this configuration */
690 /* GMAC1 is connected to MAC0 on the internal switch */
691 /* The PoE/WAN port connects to port 5 on the internal switch */
692 /* The LAN port connects to port 4 on the internal switch */
693 ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
694 ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
695 ath79_register_eth(1);
699 MIPS_MACHINE(ATH79_MACH_UBNT_AIRGWP, "UBNT-AGWP", "Ubiquiti AirGateway Pro",
700 ubnt_airgateway_pro_setup);