904-MIPS-ath79-ubnt-rocket-m-ti-supprt.patch 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. --- a/arch/mips/ath79/mach-ubnt-xm.c
  2. +++ b/arch/mips/ath79/mach-ubnt-xm.c
  3. @@ -21,6 +21,8 @@
  4. #include <asm/mach-ath79/irq.h>
  5. #include <asm/mach-ath79/ar71xx_regs.h>
  6. +#include <linux/platform_data/phy-at803x.h>
  7. +
  8. #include "common.h"
  9. #include "dev-ap9x-pci.h"
  10. #include "dev-eth.h"
  11. @@ -404,6 +406,40 @@ static struct gpio_led ubnt_xw_leds_gpio
  12. },
  13. };
  14. +#define UBNT_ROCKET_TI_GPIO_LED_L1 16
  15. +#define UBNT_ROCKET_TI_GPIO_LED_L2 17
  16. +#define UBNT_ROCKET_TI_GPIO_LED_L3 18
  17. +#define UBNT_ROCKET_TI_GPIO_LED_L4 19
  18. +#define UBNT_ROCKET_TI_GPIO_LED_L5 20
  19. +#define UBNT_ROCKET_TI_GPIO_LED_L6 21
  20. +static struct gpio_led ubnt_rocket_ti_leds_gpio[] __initdata = {
  21. + {
  22. + .name = "ubnt:green:link1",
  23. + .gpio = UBNT_ROCKET_TI_GPIO_LED_L1,
  24. + .active_low = 1,
  25. + }, {
  26. + .name = "ubnt:green:link2",
  27. + .gpio = UBNT_ROCKET_TI_GPIO_LED_L2,
  28. + .active_low = 1,
  29. + }, {
  30. + .name = "ubnt:green:link3",
  31. + .gpio = UBNT_ROCKET_TI_GPIO_LED_L3,
  32. + .active_low = 1,
  33. + }, {
  34. + .name = "ubnt:green:link4",
  35. + .gpio = UBNT_ROCKET_TI_GPIO_LED_L4,
  36. + .active_low = 0,
  37. + }, {
  38. + .name = "ubnt:green:link5",
  39. + .gpio = UBNT_ROCKET_TI_GPIO_LED_L5,
  40. + .active_low = 0,
  41. + }, {
  42. + .name = "ubnt:green:link6",
  43. + .gpio = UBNT_ROCKET_TI_GPIO_LED_L6,
  44. + .active_low = 0,
  45. + },
  46. +};
  47. +
  48. static void __init ubnt_xw_init(void)
  49. {
  50. u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
  51. @@ -477,6 +513,62 @@ static void __init ubnt_rocket_m_xw_setu
  52. ath79_register_eth(0);
  53. }
  54. +static struct at803x_platform_data ubnt_rocket_m_ti_at803_data = {
  55. + .disable_smarteee = 1,
  56. + .enable_rgmii_rx_delay = 1,
  57. + .enable_rgmii_tx_delay = 1,
  58. +};
  59. +static struct mdio_board_info ubnt_rocket_m_ti_mdio_info[] = {
  60. + {
  61. + .bus_id = "ag71xx-mdio.0",
  62. + .phy_addr = 4,
  63. + .platform_data = &ubnt_rocket_m_ti_at803_data,
  64. + },
  65. +};
  66. +
  67. +static void __init ubnt_rocket_m_ti_setup(void)
  68. +{
  69. + u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
  70. +
  71. + ath79_register_m25p80(NULL);
  72. +
  73. + ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_rocket_ti_leds_gpio),
  74. + ubnt_rocket_ti_leds_gpio);
  75. + ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  76. + ARRAY_SIZE(ubnt_xm_gpio_keys),
  77. + ubnt_xm_gpio_keys);
  78. +
  79. + ap91_pci_init(eeprom + 0x1000, NULL);
  80. +
  81. + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
  82. + ath79_setup_ar934x_eth_rx_delay(3, 3);
  83. + ath79_init_mac(ath79_eth0_data.mac_addr,
  84. + eeprom + UAP_PRO_MAC0_OFFSET, 0);
  85. + ath79_init_mac(ath79_eth1_data.mac_addr,
  86. + eeprom + UAP_PRO_MAC1_OFFSET, 0);
  87. +
  88. + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
  89. + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
  90. + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
  91. + ath79_eth1_data.mii_bus_dev = &ath79_mdio1_device.dev;
  92. +
  93. + mdiobus_register_board_info(ubnt_rocket_m_ti_mdio_info,
  94. + ARRAY_SIZE(ubnt_rocket_m_ti_mdio_info));
  95. + ath79_register_mdio(0, 0x0);
  96. +
  97. +
  98. + ath79_eth0_data.phy_mask = BIT(4);
  99. + /* read out from vendor */
  100. + ath79_eth0_pll_data.pll_1000 = 0x2000000;
  101. + ath79_eth0_pll_data.pll_10 = 0x1313;
  102. + ath79_register_eth(0);
  103. +
  104. + ath79_register_mdio(1, 0x0);
  105. + ath79_eth1_data.phy_mask = BIT(3);
  106. + ath79_register_eth(1);
  107. +}
  108. +
  109. +
  110. MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW",
  111. ubnt_nano_m_xw_setup);
  112. @@ -486,6 +578,9 @@ MIPS_MACHINE(ATH79_MACH_UBNT_LOCO_M_XW,
  113. MIPS_MACHINE(ATH79_MACH_UBNT_ROCKET_M_XW, "UBNT-RM-XW", "Ubiquiti Rocket M XW",
  114. ubnt_rocket_m_xw_setup);
  115. +MIPS_MACHINE(ATH79_MACH_UBNT_ROCKET_M_TI, "UBNT-RM-TI", "Ubiquiti Rocket M TI",
  116. + ubnt_rocket_m_ti_setup);
  117. +
  118. static struct gpio_led ubnt_airgateway_gpio_leds[] __initdata = {
  119. {
  120. .name = "ubnt:blue:wlan",
  121. --- a/arch/mips/ath79/machtypes.h
  122. +++ b/arch/mips/ath79/machtypes.h
  123. @@ -178,6 +178,7 @@ enum ath79_mach_type {
  124. ATH79_MACH_UBNT_NANO_M_XW, /* Ubiquiti NanoStation M XW */
  125. ATH79_MACH_UBNT_ROCKET_M, /* Ubiquiti Rocket M */
  126. ATH79_MACH_UBNT_ROCKET_M_XW, /* Ubiquiti Rocket M XW*/
  127. + ATH79_MACH_UBNT_ROCKET_M_TI, /* Ubiquiti Rocket M TI*/
  128. ATH79_MACH_UBNT_RSPRO, /* Ubiquiti RouterStation Pro */
  129. ATH79_MACH_UBNT_RS, /* Ubiquiti RouterStation */
  130. ATH79_MACH_UBNT_UAP_PRO, /* Ubiquiti UniFi AP Pro */