0016-ar71xx-add-support-for-the-UniFi-AP-Outdoor-Plus.patch 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. From: blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
  2. Date: Thu, 22 Jan 2015 09:35:46 +0000
  3. Subject: ar71xx: add support for the UniFi AP Outdoor Plus
  4. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  5. diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
  6. index f0d5d70..6aac86a 100755
  7. --- a/target/linux/ar71xx/base-files/etc/diag.sh
  8. +++ b/target/linux/ar71xx/base-files/etc/diag.sh
  9. @@ -244,6 +244,9 @@ get_status_led() {
  10. uap-pro)
  11. status_led="ubnt:white:dome"
  12. ;;
  13. + unifi-outdoor-plus)
  14. + status_led="ubnt:white:front"
  15. + ;;
  16. airgateway)
  17. status_led="ubnt:white:status"
  18. ;;
  19. diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  20. index 5fbca92..61a7936 100755
  21. --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
  22. +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  23. @@ -723,6 +723,9 @@ ar71xx_board_detect() {
  24. *"UniFiAP Outdoor")
  25. name="unifi-outdoor"
  26. ;;
  27. + *"UniFiAP Outdoor+")
  28. + name="unifi-outdoor-plus"
  29. + ;;
  30. *WP543)
  31. name="wp543"
  32. ;;
  33. diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  34. index e512f41..49746c4 100755
  35. --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  36. +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  37. @@ -363,6 +363,7 @@ platform_check_image() {
  38. return 1
  39. ;;
  40. + unifi-outdoor-plus | \
  41. uap-pro)
  42. [ "$magic_long" != "19852003" ] && {
  43. echo "Invalid image type."
  44. @@ -467,6 +468,7 @@ platform_do_upgrade() {
  45. om5p)
  46. platform_do_upgrade_openmesh "$ARGV"
  47. ;;
  48. + unifi-outdoor-plus | \
  49. uap-pro)
  50. MTD_CONFIG_ARGS="-s 0x180000"
  51. default_do_upgrade "$ARGV"
  52. diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
  53. index ba16c7b..8505ac4 100644
  54. --- a/target/linux/ar71xx/image/Makefile
  55. +++ b/target/linux/ar71xx/image/Makefile
  56. @@ -1262,6 +1262,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,SMART-300,smart-300,SMART-300,tty
  57. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,OOLITE,oolite,GS-OOLITE,ttyATH0,115200,0x3C000101,1,16Mlzma))
  58. $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
  59. +$(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
  60. $(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
  61. @@ -1324,7 +1325,7 @@ $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV5 T
  62. $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
  63. $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
  64. $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
  65. -$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UAPPRO UBNTAIRGW))
  66. +$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
  67. $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800 WNDR3800CH WNDRMAC WNDRMACV2))
  68. $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
  69. $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
  70. diff --git a/target/linux/ar71xx/patches-3.10/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.10/610-MIPS-ath79-openwrt-machines.patch
  71. index 3722519..6bb8884 100644
  72. --- a/target/linux/ar71xx/patches-3.10/610-MIPS-ath79-openwrt-machines.patch
  73. +++ b/target/linux/ar71xx/patches-3.10/610-MIPS-ath79-openwrt-machines.patch
  74. @@ -1,6 +1,6 @@
  75. --- a/arch/mips/ath79/machtypes.h
  76. +++ b/arch/mips/ath79/machtypes.h
  77. -@@ -16,22 +16,146 @@
  78. +@@ -16,22 +16,147 @@
  79. enum ath79_mach_type {
  80. ATH79_MACH_GENERIC = 0,
  81. @@ -120,6 +120,7 @@
  82. ATH79_MACH_UBNT_UAP_PRO, /* Ubiquiti UniFi AP Pro */
  83. ATH79_MACH_UBNT_UNIFI, /* Ubiquiti Unifi */
  84. ATH79_MACH_UBNT_UNIFI_OUTDOOR, /* Ubiquiti UnifiAP Outdoor */
  85. ++ ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */
  86. ATH79_MACH_UBNT_XM, /* Ubiquiti Networks XM board rev 1.0 */
  87. + ATH79_MACH_WHR_G301N, /* Buffalo WHR-G301N */
  88. + ATH79_MACH_WHR_HP_G300N, /* Buffalo WHR-HP-G300N */
  89. diff --git a/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch b/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
  90. index 5e3d4d4..3c3c273 100644
  91. --- a/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
  92. +++ b/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
  93. @@ -1,6 +1,65 @@
  94. --- a/arch/mips/ath79/mach-ubnt-xm.c
  95. +++ b/arch/mips/ath79/mach-ubnt-xm.c
  96. -@@ -332,3 +332,78 @@ static void __init ubnt_uap_pro_setup(vo
  97. +@@ -186,6 +186,19 @@ static struct gpio_led ubnt_unifi_outdoo
  98. + }
  99. + };
  100. +
  101. ++static struct gpio_led ubnt_unifi_outdoor_plus_leds_gpio[] __initdata = {
  102. ++ {
  103. ++ .name = "ubnt:white:front",
  104. ++ .gpio = 1,
  105. ++ .active_low = 0,
  106. ++ }, {
  107. ++ .name = "ubnt:blue:front",
  108. ++ .gpio = 0,
  109. ++ .active_low = 0,
  110. ++ }
  111. ++};
  112. ++
  113. ++
  114. + static void __init ubnt_unifi_setup(void)
  115. + {
  116. + u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
  117. +@@ -245,6 +258,38 @@ MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDO
  118. + "Ubiquiti UniFiAP Outdoor",
  119. + ubnt_unifi_outdoor_setup);
  120. +
  121. ++
  122. ++static void __init ubnt_unifi_outdoor_plus_setup(void)
  123. ++{
  124. ++ u8 *mac1 = (u8 *) KSEG1ADDR(0x1fff0000);
  125. ++ u8 *mac2 = (u8 *) KSEG1ADDR(0x1fff0000 + ETH_ALEN);
  126. ++ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
  127. ++
  128. ++ ath79_register_m25p80(NULL);
  129. ++
  130. ++ ath79_register_mdio(0, ~(UBNT_UNIFIOD_PRI_PHYMASK |
  131. ++ UBNT_UNIFIOD_2ND_PHYMASK));
  132. ++
  133. ++ ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0);
  134. ++ ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0);
  135. ++ ath79_register_eth(0);
  136. ++ ath79_register_eth(1);
  137. ++
  138. ++ ap91_pci_init(ee, NULL);
  139. ++
  140. ++ ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_unifi_outdoor_plus_leds_gpio),
  141. ++ ubnt_unifi_outdoor_plus_leds_gpio);
  142. ++
  143. ++ ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
  144. ++ ARRAY_SIZE(ubnt_xm_gpio_keys),
  145. ++ ubnt_xm_gpio_keys);
  146. ++}
  147. ++
  148. ++MIPS_MACHINE(ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, "UBNT-UOP",
  149. ++ "Ubiquiti UniFiAP Outdoor+",
  150. ++ ubnt_unifi_outdoor_plus_setup);
  151. ++
  152. ++
  153. + static struct gpio_led ubnt_uap_pro_gpio_leds[] __initdata = {
  154. + {
  155. + .name = "ubnt:white:dome",
  156. +@@ -332,3 +377,78 @@ static void __init ubnt_uap_pro_setup(vo
  157. MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro",
  158. ubnt_uap_pro_setup);
  159. @@ -81,8 +140,8 @@
  160. + ubnt_loco_m_xw_setup);
  161. --- a/arch/mips/ath79/machtypes.h
  162. +++ b/arch/mips/ath79/machtypes.h
  163. -@@ -121,9 +121,11 @@ enum ath79_mach_type {
  164. - ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
  165. +@@ -123,9 +123,11 @@ enum ath79_mach_type {
  166. + ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */
  167. ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
  168. ATH79_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
  169. + ATH79_MACH_UBNT_LOCO_M_XW, /* Ubiquiti Loco M XW */