0064-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Thu, 9 Jun 2016 04:55:37 +0200
  3. Subject: ar71xx/cpe510: split profile into 2 profiles cpe210 and cpe510
  4. Split profile into 2GHz and 5GHz. The 5GHz devices are
  5. quite "special". The 2 GHz works perfect.
  6. Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
  7. Backport of LEDE c5ff273d85f69981e5b126eeaed3dee5b4061fb4
  8. diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
  9. index b41f275..0f7a415 100644
  10. --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
  11. +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_gpio-switches
  12. @@ -15,6 +15,7 @@ nanostation-m)
  13. nanostation-m-xw)
  14. ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
  15. ;;
  16. +cpe210|\
  17. cpe510)
  18. ucidef_set_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
  19. ;;
  20. diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  21. index 3d240fb..f1266d8 100644
  22. --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  23. +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
  24. @@ -78,6 +78,7 @@ carambola2)
  25. ucidef_set_led_wlan "wlan" "WLAN" "carambola2:green:wlan" "phy0tpt"
  26. ;;
  27. +cpe210|\
  28. cpe510)
  29. ucidef_set_led_switch "lan0" "LAN0" "tp-link:green:lan0" "switch0" "0x20"
  30. ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
  31. diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  32. index ca9c577..6c3ecf5 100755
  33. --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  34. +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  35. @@ -72,6 +72,7 @@ bsb)
  36. ucidef_set_interface_wlan
  37. ;;
  38. +cpe210|\
  39. cpe510)
  40. ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
  41. ucidef_add_switch "switch0" "1" "1"
  42. diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  43. index 20250e9..0d8ccd2 100755
  44. --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
  45. +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  46. @@ -447,7 +447,11 @@ ar71xx_board_detect() {
  47. *CAP4200AG)
  48. name="cap4200ag"
  49. ;;
  50. - *"CPE210/220/510/520")
  51. + *"CPE210/220")
  52. + name="cpe210"
  53. + tplink_pharos_board_detect
  54. + ;;
  55. + *"CPE510/520")
  56. name="cpe510"
  57. tplink_pharos_board_detect
  58. ;;
  59. diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  60. index 53284df..4003b21 100755
  61. --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  62. +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  63. @@ -265,6 +265,7 @@ platform_check_image() {
  64. return 0
  65. ;;
  66. + cpe210|\
  67. cpe510)
  68. tplink_pharos_check_image "$1" && return 0
  69. return 1
  70. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
  71. index 5cb052a..74daf43 100644
  72. --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
  73. +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
  74. @@ -78,12 +78,8 @@ static struct gpio_keys_button cpe510_gpio_keys[] __initdata = {
  75. }
  76. };
  77. -
  78. -static void __init cpe510_setup(void)
  79. +static void __init cpe_setup(u8 *mac)
  80. {
  81. - u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
  82. - u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
  83. -
  84. /* Disable JTAG, enabling GPIOs 0-3 */
  85. /* Configure OBS4 line, for GPIO 4*/
  86. ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE,
  87. @@ -105,9 +101,31 @@ static void __init cpe510_setup(void)
  88. ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
  89. ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
  90. ath79_register_eth(1);
  91. +}
  92. +
  93. +
  94. +static void __init cpe210_setup(void)
  95. +{
  96. + u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
  97. + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
  98. +
  99. + cpe_setup(mac);
  100. ath79_register_wmac(ee, mac);
  101. }
  102. -MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE210/220/510/520",
  103. +static void __init cpe510_setup(void)
  104. +{
  105. + u8 *mac = (u8 *) KSEG1ADDR(0x1f830008);
  106. + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
  107. +
  108. + cpe_setup(mac);
  109. +
  110. + ath79_register_wmac(ee, mac);
  111. +}
  112. +
  113. +MIPS_MACHINE(ATH79_MACH_CPE210, "CPE210", "TP-LINK CPE210/220",
  114. + cpe210_setup);
  115. +
  116. +MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE510/520",
  117. cpe510_setup);
  118. diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
  119. index d66bd25..75083f9 100644
  120. --- a/target/linux/ar71xx/image/Makefile
  121. +++ b/target/linux/ar71xx/image/Makefile
  122. @@ -2111,7 +2111,8 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR10
  123. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M))
  124. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99))
  125. -$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
  126. +$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE210_220,cpe210-220,CPE210,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
  127. +$(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510_520,cpe510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
  128. $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
  129. $(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
  130. @@ -2175,6 +2176,7 @@ $(eval $(call MultiProfile,TLWR842,TLWR842V1))
  131. $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4))
  132. $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2 TLWR1043V3))
  133. $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
  134. +$(eval $(call MultiProfile,CPE510,CPE210_220 CPE510_520))
  135. $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
  136. $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTROCKETMXW UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
  137. $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
  138. 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
  139. index d4b417b..c83ac2e 100644
  140. --- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
  141. +++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
  142. @@ -1,6 +1,6 @@
  143. --- a/arch/mips/ath79/machtypes.h
  144. +++ b/arch/mips/ath79/machtypes.h
  145. -@@ -16,22 +16,203 @@
  146. +@@ -16,22 +16,204 @@
  147. enum ath79_mach_type {
  148. ATH79_MACH_GENERIC = 0,
  149. @@ -26,6 +26,7 @@
  150. + ATH79_MACH_BHU_BXU2000N2_A1, /* BHU BXU2000n-2 A1 */
  151. + ATH79_MACH_CAP4200AG, /* Senao CAP4200AG */
  152. + ATH79_MACH_CARAMBOLA2, /* 8devices Carambola2 */
  153. ++ ATH79_MACH_CPE210, /* TP-LINK CPE210 */
  154. + ATH79_MACH_CPE510, /* TP-LINK CPE510 */
  155. ATH79_MACH_DB120, /* Atheros DB120 reference board */
  156. ATH79_MACH_PB44, /* Atheros PB44 reference board */