Advertisement
Guest User

[PATCH] [RFC] [ar71xx] Add support for Ubiquiti Rocket M5 XW

a guest
Apr 15th, 2015
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 8.51 KB | None | 0 0
  1. ---
  2. target/linux/ar71xx/base-files/etc/diag.sh         |  2 +-
  3.  .../ar71xx/base-files/etc/uci-defaults/01_leds     |  1 +
  4.  .../ar71xx/base-files/etc/uci-defaults/02_network  |  1 +
  5.  target/linux/ar71xx/base-files/lib/ar71xx.sh       |  3 ++
  6.  .../ar71xx/base-files/lib/upgrade/platform.sh      |  1 +
  7.  .../linux/ar71xx/files/arch/mips/ath79/mach-ubnt.c |  1 +
  8.  target/linux/ar71xx/image/Makefile                 |  3 +-
  9.  .../610-MIPS-ath79-openwrt-machines.patch          |  3 +-
  10.  ...3-MIPS-ath79-add-ubnt-rocket-m-xw-support.patch | 56 ++++++++++++++++++++++
  11.  9 files changed, 68 insertions(+), 3 deletions(-)
  12.  create mode 100644 target/linux/ar71xx/patches-3.18/903-MIPS-ath79-add-ubnt-rocket-m-xw-support.patch
  13.  
  14. diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
  15. index 52a73ee..f4f5190 100644
  16. --- a/target/linux/ar71xx/base-files/etc/diag.sh
  17. +++ b/target/linux/ar71xx/base-files/etc/diag.sh
  18. @@ -34,7 +34,7 @@ get_status_led() {
  19.     aw-nr580)
  20.         status_led="aw-nr580:green:ready"
  21.         ;;
  22. -   bullet-m | rocket-m | nano-m | nanostation-m | nanostation-m-xw | loco-m-xw)
  23. +   bullet-m | rocket-m | rocket-m-xw | nano-m | nanostation-m | nanostation-m-xw | loco-m-xw)
  24.         status_led="ubnt:green:link4"
  25.         ;;
  26.     bxu2000n-2-a1)
  27. diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  28. index 787523a..0a9a285 100644
  29. --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  30. +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  31. @@ -38,6 +38,7 @@ ap113)
  32.  bullet-m | \
  33.  nanostation-m | \
  34.  rocket-m | \
  35. +rocket-m-xw | \
  36.  nanostation-m-xw | \
  37.  loco-m-xw)
  38.     ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100" "0" "13"
  39. diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  40. index 9789834..af7930a 100644
  41. --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  42. +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  43. @@ -318,6 +318,7 @@ rb-912uag-2hpnd |\
  44.  rb-912uag-5hpnd |\
  45.  rb-sxt2n |\
  46.  rb-sxt5n |\
  47. +rocket-m-xw |\
  48.  tl-mr10u |\
  49.  tl-mr11u |\
  50.  tl-mr12u |\
  51. diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  52. index b3dbcf5..c6aa81e 100755
  53. --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
  54. +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  55. @@ -621,6 +621,9 @@ ar71xx_board_detect() {
  56.     *"Rocket M")
  57.         name="rocket-m"
  58.         ;;
  59. +   *"Rocket M XW")
  60. +       name="rocket-m-xw"
  61. +       ;;
  62.     *RouterStation)
  63.         name="routerstation"
  64.         ;;
  65. diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  66. index 0cbee1d..d349133 100755
  67. --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  68. +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  69. @@ -224,6 +224,7 @@ platform_check_image() {
  70.     loco-m-xw | \
  71.     nanostation-m | \
  72.     rocket-m | \
  73. +   rocket-m-xw | \
  74.     nanostation-m-xw | \
  75.     rw2458n | \
  76.     wndap360 | \
  77. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt.c
  78. index e49ac23..a7bb7e7 100644
  79. --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt.c
  80. +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt.c
  81. @@ -10,6 +10,7 @@
  82.   *  by the Free Software Foundation.
  83.   */
  84.  
  85. +#include <linux/platform_data/phy-at803x.h>
  86.  #include <asm/mach-ath79/ath79.h>
  87.  
  88.  #include "dev-eth.h"
  89. diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
  90. index 8766756..b35bd56 100644
  91. --- a/target/linux/ar71xx/image/Makefile
  92. +++ b/target/linux/ar71xx/image/Makefile
  93. @@ -1523,6 +1523,7 @@ $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115
  94.  $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTUNIFIOUTDOOR,ubnt-unifi-outdoor,UBNT-U20,ttyS0,115200,XM,BZ,ar7240))
  95.  $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTNANOMXW,ubnt-nano-m-xw,UBNT-NM-XW,ttyS0,115200,XM,XW,ar934x))
  96.  $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTLOCOXW,ubnt-loco-m-xw,UBNT-LOCO-XW,ttyS0,115200,XM,XW,ar934x))
  97. +$(eval $(call SingleProfile,UBNTXM,64kraw,UBNTROCKETMXW,ubnt-rocket-m-xw,UBNT-RM-XW,ttyS0,115200,XM,XW,ar934x))
  98.  $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTAIRGW,ubnt-air-gateway,UBNT-AGW,ttyATH0,115200,XM,AirGW,ar933x))
  99.  
  100.  $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
  101. @@ -1573,7 +1574,7 @@ $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV5 T
  102.  $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
  103.  $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
  104.  $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
  105. -$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
  106. +$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTROCKETMXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
  107.  $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
  108.  $(eval $(call MultiProfile,WNR1000V2,REALWNR1000V2 WNR1000V2_VC))
  109.  $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
  110. diff --git a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
  111. index 2aca064..8612f1d 100644
  112. --- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
  113. +++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
  114. @@ -1,6 +1,6 @@
  115.  --- a/arch/mips/ath79/machtypes.h
  116.  +++ b/arch/mips/ath79/machtypes.h
  117. -@@ -16,22 +16,190 @@
  118. +@@ -16,22 +16,191 @@
  119.  
  120.   enum ath79_mach_type {
  121.     ATH79_MACH_GENERIC = 0,
  122. @@ -154,6 +154,7 @@
  123.     ATH79_MACH_UBNT_NANO_M,     /* Ubiquiti NanoStation M */
  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_RSPRO,      /* Ubiquiti RouterStation Pro */
  128.  +  ATH79_MACH_UBNT_RS,     /* Ubiquiti RouterStation */
  129.     ATH79_MACH_UBNT_UAP_PRO,    /* Ubiquiti UniFi AP Pro */
  130. diff --git a/target/linux/ar71xx/patches-3.18/903-MIPS-ath79-add-ubnt-rocket-m-xw-support.patch b/target/linux/ar71xx/patches-3.18/903-MIPS-ath79-add-ubnt-rocket-m-xw-support.patch
  131. new file mode 100644
  132. index 0000000..96aa25f
  133. --- /dev/null
  134. +++ b/target/linux/ar71xx/patches-3.18/903-MIPS-ath79-add-ubnt-rocket-m-xw-support.patch
  135. @@ -0,0 +1,56 @@
  136. +--- a/arch/mips/ath79/mach-ubnt-xm.c
  137. ++++ b/arch/mips/ath79/mach-ubnt-xm.c
  138. +@@ -16,6 +16,7 @@
  139. + #include <linux/ath9k_platform.h>
  140. + #include <linux/etherdevice.h>
  141. + #include <linux/ar8216_platform.h>
  142. ++#include <linux/platform_data/phy-at803x.h>
  143. +
  144. + #include <asm/mach-ath79/ath79.h>
  145. + #include <asm/mach-ath79/irq.h>
  146. +@@ -449,12 +450,45 @@
  147. +   ath79_register_eth(0);
  148. + }
  149. +
  150. ++static void __init ubnt_rocket_m_xw_setup(void)
  151. ++{
  152. ++  u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
  153. ++
  154. ++  ath79_register_m25p80(NULL);
  155. ++
  156. ++  ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xw_leds_gpio),
  157. ++               ubnt_xw_leds_gpio);
  158. ++  ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  159. ++                                        ARRAY_SIZE(ubnt_xm_gpio_keys),
  160. ++                                        ubnt_xm_gpio_keys);
  161. ++
  162. ++  ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
  163. ++  ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
  164. ++
  165. ++  ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
  166. ++  ath79_init_mac(ath79_eth0_data.mac_addr,
  167. ++             eeprom + UAP_PRO_MAC0_OFFSET, 0);
  168. ++
  169. ++  ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
  170. ++  ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
  171. ++  ath79_eth0_data.speed = SPEED_100;
  172. ++  ath79_eth0_data.duplex = DUPLEX_FULL;
  173. ++
  174. ++
  175. ++
  176. ++
  177. ++  ath79_register_eth(0);
  178. ++}
  179. ++
  180. + MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW",
  181. +        ubnt_nano_m_xw_setup);
  182. +
  183. + MIPS_MACHINE(ATH79_MACH_UBNT_LOCO_M_XW, "UBNT-LOCO-XW", "Ubiquiti Loco M XW",
  184. +        ubnt_loco_m_xw_setup);
  185. +
  186. ++MIPS_MACHINE(ATH79_MACH_UBNT_ROCKET_M_XW, "UBNT-RM-XW", "Ubiquiti Rocket M XW",
  187. ++       ubnt_rocket_m_xw_setup);
  188. ++
  189. + static struct gpio_led ubnt_airgateway_gpio_leds[] __initdata = {
  190. +   {
  191. +       .name      = "ubnt:blue:wlan",
  192. --
  193. 2.1.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement