0016-mac80211-ath9k-add-support-for-QCA953x.patch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Fri, 18 Apr 2014 18:30:05 +0200
  3. Subject: mac80211: ath9k: add support for QCA953x
  4. This adds the following patches by Sujith Manoharan from ath9k-devel:
  5. ath9k: Add QCA953x WMAC platform support
  6. ath9k: Disable AR_INTR_SYNC_HOST1_FATAL for QCA953x
  7. ath9k: Fix temperature compensation
  8. diff --git a/package/mac80211/patches/567-ath9k-qca953x-support.patch b/package/mac80211/patches/567-ath9k-qca953x-support.patch
  9. new file mode 100644
  10. index 0000000..e73083a
  11. --- /dev/null
  12. +++ b/package/mac80211/patches/567-ath9k-qca953x-support.patch
  13. @@ -0,0 +1,124 @@
  14. +--- a/drivers/net/wireless/ath/ath9k/ahb.c
  15. ++++ b/drivers/net/wireless/ath/ath9k/ahb.c
  16. +@@ -39,6 +39,10 @@ static const struct platform_device_id a
  17. + .name = "qca955x_wmac",
  18. + .driver_data = AR9300_DEVID_QCA955X,
  19. + },
  20. ++ {
  21. ++ .name = "qca953x_wmac",
  22. ++ .driver_data = AR9300_DEVID_AR953X,
  23. ++ },
  24. + {},
  25. + };
  26. +
  27. +--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
  28. ++++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
  29. +@@ -4792,43 +4792,54 @@ static void ar9003_hw_power_control_over
  30. +
  31. + tempslope:
  32. + if (AR_SREV_9550(ah) || AR_SREV_9531(ah)) {
  33. ++ u8 txmask = (eep->baseEepHeader.txrxMask & 0xf0) >> 4;
  34. ++
  35. + /*
  36. + * AR955x has tempSlope register for each chain.
  37. + * Check whether temp_compensation feature is enabled or not.
  38. + */
  39. + if (eep->baseEepHeader.featureEnable & 0x1) {
  40. + if (frequency < 4000) {
  41. +- REG_RMW_FIELD(ah, AR_PHY_TPC_19,
  42. +- AR_PHY_TPC_19_ALPHA_THERM,
  43. +- eep->base_ext2.tempSlopeLow);
  44. +- REG_RMW_FIELD(ah, AR_PHY_TPC_19_B1,
  45. +- AR_PHY_TPC_19_ALPHA_THERM,
  46. +- temp_slope);
  47. +- REG_RMW_FIELD(ah, AR_PHY_TPC_19_B2,
  48. +- AR_PHY_TPC_19_ALPHA_THERM,
  49. +- eep->base_ext2.tempSlopeHigh);
  50. ++ if (txmask & BIT(0))
  51. ++ REG_RMW_FIELD(ah, AR_PHY_TPC_19,
  52. ++ AR_PHY_TPC_19_ALPHA_THERM,
  53. ++ eep->base_ext2.tempSlopeLow);
  54. ++ if (txmask & BIT(1))
  55. ++ REG_RMW_FIELD(ah, AR_PHY_TPC_19_B1,
  56. ++ AR_PHY_TPC_19_ALPHA_THERM,
  57. ++ temp_slope);
  58. ++ if (txmask & BIT(2))
  59. ++ REG_RMW_FIELD(ah, AR_PHY_TPC_19_B2,
  60. ++ AR_PHY_TPC_19_ALPHA_THERM,
  61. ++ eep->base_ext2.tempSlopeHigh);
  62. + } else {
  63. +- REG_RMW_FIELD(ah, AR_PHY_TPC_19,
  64. +- AR_PHY_TPC_19_ALPHA_THERM,
  65. +- temp_slope);
  66. +- REG_RMW_FIELD(ah, AR_PHY_TPC_19_B1,
  67. +- AR_PHY_TPC_19_ALPHA_THERM,
  68. +- temp_slope1);
  69. +- REG_RMW_FIELD(ah, AR_PHY_TPC_19_B2,
  70. +- AR_PHY_TPC_19_ALPHA_THERM,
  71. +- temp_slope2);
  72. ++ if (txmask & BIT(0))
  73. ++ REG_RMW_FIELD(ah, AR_PHY_TPC_19,
  74. ++ AR_PHY_TPC_19_ALPHA_THERM,
  75. ++ temp_slope);
  76. ++ if (txmask & BIT(1))
  77. ++ REG_RMW_FIELD(ah, AR_PHY_TPC_19_B1,
  78. ++ AR_PHY_TPC_19_ALPHA_THERM,
  79. ++ temp_slope1);
  80. ++ if (txmask & BIT(2))
  81. ++ REG_RMW_FIELD(ah, AR_PHY_TPC_19_B2,
  82. ++ AR_PHY_TPC_19_ALPHA_THERM,
  83. ++ temp_slope2);
  84. + }
  85. + } else {
  86. + /*
  87. + * If temp compensation is not enabled,
  88. + * set all registers to 0.
  89. + */
  90. +- REG_RMW_FIELD(ah, AR_PHY_TPC_19,
  91. +- AR_PHY_TPC_19_ALPHA_THERM, 0);
  92. +- REG_RMW_FIELD(ah, AR_PHY_TPC_19_B1,
  93. +- AR_PHY_TPC_19_ALPHA_THERM, 0);
  94. +- REG_RMW_FIELD(ah, AR_PHY_TPC_19_B2,
  95. +- AR_PHY_TPC_19_ALPHA_THERM, 0);
  96. ++ if (txmask & BIT(0))
  97. ++ REG_RMW_FIELD(ah, AR_PHY_TPC_19,
  98. ++ AR_PHY_TPC_19_ALPHA_THERM, 0);
  99. ++ if (txmask & BIT(1))
  100. ++ REG_RMW_FIELD(ah, AR_PHY_TPC_19_B1,
  101. ++ AR_PHY_TPC_19_ALPHA_THERM, 0);
  102. ++ if (txmask & BIT(2))
  103. ++ REG_RMW_FIELD(ah, AR_PHY_TPC_19_B2,
  104. ++ AR_PHY_TPC_19_ALPHA_THERM, 0);
  105. + }
  106. + } else {
  107. + REG_RMW_FIELD(ah, AR_PHY_TPC_19,
  108. +--- a/drivers/net/wireless/ath/ath9k/hw.c
  109. ++++ b/drivers/net/wireless/ath/ath9k/hw.c
  110. +@@ -901,7 +901,7 @@ static void ath9k_hw_init_interrupt_mask
  111. + AR_IMR_RXORN |
  112. + AR_IMR_BCNMISC;
  113. +
  114. +- if (AR_SREV_9340(ah) || AR_SREV_9550(ah))
  115. ++ if (AR_SREV_9340(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah))
  116. + sync_default &= ~AR_INTR_SYNC_HOST1_FATAL;
  117. +
  118. + if (AR_SREV_9300_20_OR_LATER(ah)) {
  119. +@@ -3104,6 +3104,7 @@ static struct {
  120. + { AR_SREV_VERSION_9462, "9462" },
  121. + { AR_SREV_VERSION_9550, "9550" },
  122. + { AR_SREV_VERSION_9565, "9565" },
  123. ++ { AR_SREV_VERSION_9531, "9531" },
  124. + };
  125. +
  126. + /* For devices with external radios */
  127. +--- a/drivers/net/wireless/ath/ath9k/mac.c
  128. ++++ b/drivers/net/wireless/ath/ath9k/mac.c
  129. +@@ -837,7 +837,7 @@ void ath9k_hw_enable_interrupts(struct a
  130. + return;
  131. + }
  132. +
  133. +- if (AR_SREV_9340(ah) || AR_SREV_9550(ah))
  134. ++ if (AR_SREV_9340(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah))
  135. + sync_default &= ~AR_INTR_SYNC_HOST1_FATAL;
  136. +
  137. + async_mask = AR_INTR_MAC_IRQ;