610-MIPS-ath79-UBNT-add-airGateway-pro-support.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. --- a/arch/mips/ath79/mach-ubnt-xm.c
  2. +++ b/arch/mips/ath79/mach-ubnt-xm.c
  3. @@ -642,3 +642,59 @@ static void __init ubnt_airgateway_setup
  4. MIPS_MACHINE(ATH79_MACH_UBNT_AIRGW, "UBNT-AGW", "Ubiquiti AirGateway",
  5. ubnt_airgateway_setup);
  6. +static struct gpio_led ubnt_airgateway_pro_gpio_leds[] __initdata = {
  7. + {
  8. + .name = "ubnt:blue:wlan",
  9. + .gpio = 13,
  10. + }, {
  11. + .name = "ubnt:white:status",
  12. + .gpio = 17,
  13. + },
  14. +};
  15. +
  16. +
  17. +static struct gpio_keys_button airgateway_pro_gpio_keys[] __initdata = {
  18. + {
  19. + .desc = "reset",
  20. + .type = EV_KEY,
  21. + .code = KEY_RESTART,
  22. + .debounce_interval = UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
  23. + .gpio = 12,
  24. + .active_low = 1,
  25. + }
  26. +};
  27. +
  28. +static void __init ubnt_airgateway_pro_setup(void)
  29. +{
  30. + u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
  31. + u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff0000);
  32. +
  33. + ath79_register_m25p80(NULL);
  34. + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_pro_gpio_leds),
  35. + ubnt_airgateway_pro_gpio_leds);
  36. +
  37. + ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  38. + ARRAY_SIZE(airgateway_pro_gpio_keys),
  39. + airgateway_pro_gpio_keys);
  40. +
  41. + ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
  42. + ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
  43. +
  44. +
  45. + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
  46. +
  47. + ath79_register_mdio(1, 0x0);
  48. +
  49. + /* GMAC0 is left unused in this configuration */
  50. +
  51. + /* GMAC1 is connected to MAC0 on the internal switch */
  52. + /* The PoE/WAN port connects to port 5 on the internal switch */
  53. + /* The LAN port connects to port 4 on the internal switch */
  54. + ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
  55. + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
  56. + ath79_register_eth(1);
  57. +
  58. +}
  59. +
  60. +MIPS_MACHINE(ATH79_MACH_UBNT_AIRGWP, "UBNT-AGWP", "Ubiquiti AirGateway Pro",
  61. + ubnt_airgateway_pro_setup);