0015-Add-support-for-the-TP-LINK-TL-WR941ND-v5.patch 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Tue, 3 Feb 2015 16:54:22 +0100
  3. Subject: Add support for the TP-LINK TL-WR941ND v5
  4. This device is very similar to the TL-WR841N v8, only two LED GPIOs are
  5. different.
  6. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  7. diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
  8. index 924766d..f0d5d70 100755
  9. --- a/target/linux/ar71xx/base-files/etc/diag.sh
  10. +++ b/target/linux/ar71xx/base-files/etc/diag.sh
  11. @@ -214,7 +214,8 @@ get_status_led() {
  12. tl-wr841n-v8 | \
  13. tl-wa830re-v2 | \
  14. tl-wr842n-v2 | \
  15. - tl-wr941nd)
  16. + tl-wr941nd | \
  17. + tl-wr941nd-v5)
  18. status_led="tp-link:green:system"
  19. ;;
  20. archer-c5 | \
  21. diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  22. index ee90c52..a74b8f4 100755
  23. --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  24. +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  25. @@ -345,7 +345,8 @@ tl-wr741nd-v4)
  26. ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
  27. ;;
  28. -tl-wr841n-v8)
  29. +tl-wr841n-v8 | \
  30. +tl-wr941nd-v5)
  31. ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
  32. ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
  33. ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
  34. diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  35. index c494310..3ccb917 100755
  36. --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  37. +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  38. @@ -211,6 +211,7 @@ smart-300 | \
  39. tl-mr3420-v2 |\
  40. tl-wr841n-v8 |\
  41. tl-wr842n-v2 |\
  42. +tl-wr941nd-v5 |\
  43. wnr2000-v3 |\
  44. wnr2200 |\
  45. wnr612-v2)
  46. diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  47. index 13c5bf2..5fbca92 100755
  48. --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
  49. +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  50. @@ -681,6 +681,9 @@ ar71xx_board_detect() {
  51. *TL-WR941ND)
  52. name="tl-wr941nd"
  53. ;;
  54. + *"TL-WR941N/ND v5")
  55. + name="tl-wr941nd-v5"
  56. + ;;
  57. *"TL-WR703N v1")
  58. name="tl-wr703n"
  59. ;;
  60. diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  61. index a566b62..e512f41 100755
  62. --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  63. +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  64. @@ -326,6 +326,7 @@ platform_check_image() {
  65. tl-wr841n-v9 | \
  66. tl-wr842n-v2 | \
  67. tl-wr941nd | \
  68. + tl-wr941nd-v5 | \
  69. tl-wr1041n-v2 | \
  70. tl-wr1043nd | \
  71. tl-wr1043nd-v2 | \
  72. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c
  73. index 0099b15..73cfdd9 100644
  74. --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c
  75. +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c
  76. @@ -38,6 +38,15 @@
  77. #define TL_MR3420V2_GPIO_LED_3G 11
  78. #define TL_MR3420V2_GPIO_USB_POWER 4
  79. +#define TL_WR941NDV5_GPIO_LED_WLAN 13
  80. +#define TL_WR941NDV5_GPIO_LED_QSS 15
  81. +#define TL_WR941NDV5_GPIO_LED_WAN 18
  82. +#define TL_WR941NDV5_GPIO_LED_LAN1 19
  83. +#define TL_WR941NDV5_GPIO_LED_LAN2 20
  84. +#define TL_WR941NDV5_GPIO_LED_LAN3 2
  85. +#define TL_WR941NDV5_GPIO_LED_LAN4 3
  86. +#define TL_WR941NDV5_GPIO_LED_SYSTEM 14
  87. +
  88. #define TL_WR841NV8_KEYS_POLL_INTERVAL 20 /* msecs */
  89. #define TL_WR841NV8_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR841NV8_KEYS_POLL_INTERVAL)
  90. @@ -127,6 +136,42 @@ static struct gpio_keys_button tl_mr3420v2_gpio_keys[] __initdata = {
  91. }
  92. };
  93. +static struct gpio_led tl_wr941nd_v5_leds_gpio[] __initdata = {
  94. + {
  95. + .name = "tp-link:green:lan1",
  96. + .gpio = TL_WR941NDV5_GPIO_LED_LAN1,
  97. + .active_low = 1,
  98. + }, {
  99. + .name = "tp-link:green:lan2",
  100. + .gpio = TL_WR941NDV5_GPIO_LED_LAN2,
  101. + .active_low = 1,
  102. + }, {
  103. + .name = "tp-link:green:lan3",
  104. + .gpio = TL_WR941NDV5_GPIO_LED_LAN3,
  105. + .active_low = 1,
  106. + }, {
  107. + .name = "tp-link:green:lan4",
  108. + .gpio = TL_WR941NDV5_GPIO_LED_LAN4,
  109. + .active_low = 1,
  110. + }, {
  111. + .name = "tp-link:green:qss",
  112. + .gpio = TL_WR941NDV5_GPIO_LED_QSS,
  113. + .active_low = 1,
  114. + }, {
  115. + .name = "tp-link:green:system",
  116. + .gpio = TL_WR941NDV5_GPIO_LED_SYSTEM,
  117. + .active_low = 1,
  118. + }, {
  119. + .name = "tp-link:green:wan",
  120. + .gpio = TL_WR941NDV5_GPIO_LED_WAN,
  121. + .active_low = 1,
  122. + }, {
  123. + .name = "tp-link:green:wlan",
  124. + .gpio = TL_WR941NDV5_GPIO_LED_WLAN,
  125. + .active_low = 1,
  126. + },
  127. +};
  128. +
  129. static void __init tl_ap123_setup(void)
  130. {
  131. u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
  132. @@ -223,3 +268,19 @@ static void __init tl_mr3420v2_setup(void)
  133. MIPS_MACHINE(ATH79_MACH_TL_MR3420_V2, "TL-MR3420-v2", "TP-LINK TL-MR3420 v2",
  134. tl_mr3420v2_setup);
  135. +
  136. +
  137. +static void __init tl_wr941nd_v5_setup(void)
  138. +{
  139. + tl_ap123_setup();
  140. +
  141. + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v5_leds_gpio),
  142. + tl_wr941nd_v5_leds_gpio);
  143. +
  144. + ath79_register_gpio_keys_polled(1, TL_WR841NV8_KEYS_POLL_INTERVAL,
  145. + ARRAY_SIZE(tl_wr841n_v8_gpio_keys),
  146. + tl_wr841n_v8_gpio_keys);
  147. +}
  148. +
  149. +MIPS_MACHINE(ATH79_MACH_TL_WR941ND_V5, "TL-WR941ND-v5", "TP-LINK TL-WR941N/ND v5",
  150. + tl_wr941nd_v5_setup);
  151. diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
  152. index 3fdaf47..ba16c7b 100644
  153. --- a/target/linux/ar71xx/image/Makefile
  154. +++ b/target/linux/ar71xx/image/Makefile
  155. @@ -1242,6 +1242,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWA801NV2,tl-wa801nd-v2,TL-WA801
  156. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWA850,tl-wa850re-v1,TL-WA850RE,ttyS0,115200,0x08500001,1,4Mlzma))
  157. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWA860,tl-wa860re-v1,TL-WA860RE,ttyS0,115200,0x08600001,1,4Mlzma))
  158. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWA901NV3,tl-wa901nd-v3,TL-WA901ND-v3,ttyS0,115200,0x09010003,1,4Mlzma))
  159. +$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR941NV5,tl-wr941nd-v5,TL-WR941ND-v5,ttyS0,115200,0x09410005,1,4Mlzma))
  160. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR941NV6,tl-wr941nd-v6,TL-WDR3500,ttyS0,115200,0x09410006,1,4Mlzma))
  161. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1041,tl-wr1041n-v2,TL-WR1041N-v2,ttyS0,115200,0x10410002,1,4Mlzma))
  162. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR1043ND-v2,ttyS0,115200,0x10430002,1,8M))
  163. @@ -1319,7 +1320,7 @@ $(eval $(call MultiProfile,TLWR741,TLWR741NV1 TLWR741NV2 TLWR741NV4))
  164. $(eval $(call MultiProfile,TLWR743,TLWR743NV1 TLWR743NV2))
  165. $(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7 TLWR841NV8 TLWR841NV9))
  166. $(eval $(call MultiProfile,TLWR842,TLWR842V1 TLWR842V2))
  167. -$(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV6))
  168. +$(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV5 TLWR941NV6))
  169. $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
  170. $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
  171. $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
  172. 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
  173. index 516d52d..3722519 100644
  174. --- a/target/linux/ar71xx/patches-3.10/610-MIPS-ath79-openwrt-machines.patch
  175. +++ b/target/linux/ar71xx/patches-3.10/610-MIPS-ath79-openwrt-machines.patch
  176. @@ -1,6 +1,6 @@
  177. --- a/arch/mips/ath79/machtypes.h
  178. +++ b/arch/mips/ath79/machtypes.h
  179. -@@ -16,22 +16,145 @@
  180. +@@ -16,22 +16,146 @@
  181. enum ath79_mach_type {
  182. ATH79_MACH_GENERIC = 0,
  183. @@ -108,6 +108,7 @@
  184. + ATH79_MACH_TL_WR841N_V8, /* TP-LINK TL-WR841N/ND v8 */
  185. + ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */
  186. + ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
  187. ++ ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */
  188. ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
  189. ATH79_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
  190. + ATH79_MACH_UBNT_LSSR71, /* Ubiquiti LS-SR71 */
  191. diff --git a/target/linux/ar71xx/patches-3.10/720-MIPS-ath79-add-Tube2H-support.patch b/target/linux/ar71xx/patches-3.10/720-MIPS-ath79-add-Tube2H-support.patch
  192. index c4aa70c..7a3754b 100644
  193. --- a/target/linux/ar71xx/patches-3.10/720-MIPS-ath79-add-Tube2H-support.patch
  194. +++ b/target/linux/ar71xx/patches-3.10/720-MIPS-ath79-add-Tube2H-support.patch
  195. @@ -1,13 +1,13 @@
  196. --- a/arch/mips/ath79/machtypes.h
  197. +++ b/arch/mips/ath79/machtypes.h
  198. -@@ -141,6 +141,7 @@ enum ath79_mach_type {
  199. - ATH79_MACH_TL_WR841N_V9, /* TP-LINK TL-WR841N/ND v9 */
  200. +@@ -143,6 +143,7 @@ enum ath79_mach_type {
  201. ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */
  202. ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
  203. + ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */
  204. + ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */
  205. ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
  206. ATH79_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
  207. - ATH79_MACH_UBNT_LSSR71, /* Ubiquiti LS-SR71 */
  208. + ATH79_MACH_UBNT_LOCO_M_XW, /* Ubiquiti Loco M XW */
  209. --- a/arch/mips/ath79/Kconfig
  210. +++ b/arch/mips/ath79/Kconfig
  211. @@ -29,6 +29,15 @@ config ATH79_MACH_ALFA_NX
  212. @@ -28,7 +28,7 @@
  213. select SOC_AR724X
  214. --- a/arch/mips/ath79/Makefile
  215. +++ b/arch/mips/ath79/Makefile
  216. -@@ -116,6 +116,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2)
  217. +@@ -117,6 +117,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2)
  218. obj-$(CONFIG_ATH79_MACH_TL_WR2543N) += mach-tl-wr2543n.o
  219. obj-$(CONFIG_ATH79_MACH_TL_WR703N) += mach-tl-wr703n.o
  220. obj-$(CONFIG_ATH79_MACH_TL_WR720N_V3) += mach-tl-wr720n-v3.o