0031-ar71xx-fix-ath79_soc_rev-value-for-QCA9531-ver.-2.patch 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Thu, 22 Oct 2015 00:33:25 +0200
  3. Subject: ar71xx: fix ath79_soc_rev value for QCA9531 ver. 2
  4. ath9k expects to get revision id 2 for the QCA9531 ver. 2 rev. 0. This
  5. fixes the very low TX power on some devices like the TP-LINK
  6. TL-WR841ND v10.
  7. As ath79_soc_rev is only used to get the revision number to ath9k on the
  8. QCA9533, just set it to the expected value on the ver. 2.
  9. diff --git a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
  10. index 403897a..cf10af3 100644
  11. --- a/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
  12. +++ b/target/linux/ar71xx/patches-3.18/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
  13. @@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  14. config ATH79_NVRAM
  15. --- a/arch/mips/ath79/clock.c
  16. +++ b/arch/mips/ath79/clock.c
  17. -@@ -350,6 +350,91 @@ static void __init ar934x_clocks_init(void)
  18. +@@ -350,6 +350,91 @@ static void __init ar934x_clocks_init(vo
  19. iounmap(dpll_base);
  20. }
  21. @@ -177,7 +177,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  22. platform_device_register(&ath79_uart_device);
  23. --- a/arch/mips/ath79/dev-usb.c
  24. +++ b/arch/mips/ath79/dev-usb.c
  25. -@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void)
  26. +@@ -236,6 +236,30 @@ static void __init ar934x_usb_setup(void
  27. &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
  28. }
  29. @@ -228,7 +228,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  30. {
  31. return ath79_soc_rev;
  32. }
  33. -@@ -126,7 +126,7 @@ static void __init ar933x_wmac_setup(void)
  34. +@@ -126,7 +126,7 @@ static void __init ar933x_wmac_setup(voi
  35. ath79_wmac_data.is_clk_25mhz = true;
  36. if (ath79_soc_rev == 1)
  37. @@ -237,8 +237,8 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  38. ath79_wmac_data.external_reset = ar933x_wmac_reset;
  39. }
  40. -@@ -151,6 +151,26 @@ static void ar934x_wmac_setup(void)
  41. - ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision;
  42. +@@ -149,6 +149,26 @@ static void ar934x_wmac_setup(void)
  43. + ath79_wmac_data.is_clk_25mhz = true;
  44. }
  45. +static void qca953x_wmac_setup(void)
  46. @@ -264,7 +264,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  47. static void qca955x_wmac_setup(void)
  48. {
  49. u32 t;
  50. -@@ -368,6 +388,8 @@ void __init ath79_register_wmac(u8 *cal_data, u8 *mac_addr)
  51. +@@ -366,6 +386,8 @@ void __init ath79_register_wmac(u8 *cal_
  52. ar933x_wmac_setup();
  53. else if (soc_is_ar934x())
  54. ar934x_wmac_setup();
  55. @@ -286,7 +286,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  56. _prom_putchar = prom_putchar_ar71xx;
  57. --- a/arch/mips/ath79/gpio.c
  58. +++ b/arch/mips/ath79/gpio.c
  59. -@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_function_reg(void)
  60. +@@ -148,7 +148,7 @@ static void __iomem *ath79_gpio_get_func
  61. soc_is_ar913x() ||
  62. soc_is_ar933x())
  63. reg = AR71XX_GPIO_REG_FUNC;
  64. @@ -295,7 +295,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  65. reg = AR934X_GPIO_REG_FUNC;
  66. else
  67. BUG();
  68. -@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(unsigned gpio, u8 val)
  69. +@@ -187,7 +187,7 @@ void __init ath79_gpio_output_select(uns
  70. unsigned int reg;
  71. u32 t, s;
  72. @@ -324,7 +324,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  73. }
  74. --- a/arch/mips/ath79/irq.c
  75. +++ b/arch/mips/ath79/irq.c
  76. -@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(void)
  77. +@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(v
  78. else if (soc_is_ar724x() ||
  79. soc_is_ar933x() ||
  80. soc_is_ar934x() ||
  81. @@ -405,7 +405,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  82. }
  83. --- a/arch/mips/ath79/setup.c
  84. +++ b/arch/mips/ath79/setup.c
  85. -@@ -60,6 +60,7 @@ static void __init ath79_detect_sys_type(void)
  86. +@@ -59,6 +59,7 @@ static void __init ath79_detect_sys_type
  87. u32 major;
  88. u32 minor;
  89. u32 rev = 0;
  90. @@ -413,12 +413,13 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  91. id = ath79_reset_rr(AR71XX_RESET_REG_REV_ID);
  92. major = id & REV_ID_MAJOR_MASK;
  93. -@@ -152,6 +153,16 @@ static void __init ath79_detect_sys_type(void)
  94. +@@ -151,6 +152,17 @@ static void __init ath79_detect_sys_type
  95. rev = id & AR934X_REV_ID_REVISION_MASK;
  96. break;
  97. + case REV_ID_MAJOR_QCA9533_V2:
  98. + ver = 2;
  99. ++ ath79_soc_rev = 2;
  100. + /* drop through */
  101. +
  102. + case REV_ID_MAJOR_QCA9533:
  103. @@ -430,15 +431,23 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed.
  104. case REV_ID_MAJOR_QCA9556:
  105. ath79_soc = ATH79_SOC_QCA9556;
  106. chip = "9556";
  107. -@@ -170,7 +181,7 @@ static void __init ath79_detect_sys_type(void)
  108. +@@ -167,11 +179,12 @@ static void __init ath79_detect_sys_type
  109. + panic("ath79: unknown SoC, id:0x%08x", id);
  110. + }
  111. - ath79_soc_rev = rev;
  112. +- ath79_soc_rev = rev;
  113. ++ if (ver == 1)
  114. ++ ath79_soc_rev = rev;
  115. - if (soc_is_qca955x())
  116. +- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
  117. +- chip, rev);
  118. + if (soc_is_qca953x() || soc_is_qca955x())
  119. - sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
  120. - chip, rev);
  121. ++ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u",
  122. ++ chip, ver, rev);
  123. else
  124. + sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
  125. + pr_info("SoC: %s\n", ath79_sys_type);
  126. --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
  127. +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
  128. @@ -105,6 +105,21 @@
  129. diff --git a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
  130. index 2bdc744..eecccdc 100644
  131. --- a/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
  132. +++ b/target/linux/ar71xx/patches-3.18/735-MIPS-ath79-add-support-for-QCA956x-SoC.patch
  133. @@ -452,7 +452,7 @@
  134. return -ENODEV;
  135. --- a/arch/mips/ath79/setup.c
  136. +++ b/arch/mips/ath79/setup.c
  137. -@@ -175,14 +175,29 @@ static void __init ath79_detect_sys_type
  138. +@@ -176,6 +176,18 @@ static void __init ath79_detect_sys_type
  139. rev = id & QCA955X_REV_ID_REVISION_MASK;
  140. break;
  141. @@ -471,19 +471,20 @@
  142. default:
  143. panic("ath79: unknown SoC, id:0x%08x", id);
  144. }
  145. -
  146. - ath79_soc_rev = rev;
  147. +@@ -183,9 +195,12 @@ static void __init ath79_detect_sys_type
  148. + if (ver == 1)
  149. + ath79_soc_rev = rev;
  150. - if (soc_is_qca953x() || soc_is_qca955x())
  151. -- sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
  152. + if (soc_is_qca953x() || soc_is_qca955x() || soc_is_qca9561())
  153. -+ sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u",
  154. -+ chip, ver, rev);
  155. + sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s ver %u rev %u",
  156. + chip, ver, rev);
  157. + else if (soc_is_tp9343())
  158. + sprintf(ath79_sys_type, "Qualcomm Atheros TP%s rev %u",
  159. - chip, rev);
  160. ++ chip, rev);
  161. else
  162. sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
  163. + pr_info("SoC: %s\n", ath79_sys_type);
  164. --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
  165. +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
  166. @@ -143,6 +143,23 @@