iwl-8000.c 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. /******************************************************************************
  2. *
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
  10. * Copyright(c) 2016 Intel Deutschland GmbH
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of version 2 of the GNU General Public License as
  14. * published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  24. * USA
  25. *
  26. * The full GNU General Public License is included in this distribution
  27. * in the file called COPYING.
  28. *
  29. * Contact Information:
  30. * Intel Linux Wireless <linuxwifi@intel.com>
  31. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  32. *
  33. * BSD LICENSE
  34. *
  35. * Copyright(c) 2014 Intel Corporation. All rights reserved.
  36. * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
  37. * All rights reserved.
  38. *
  39. * Redistribution and use in source and binary forms, with or without
  40. * modification, are permitted provided that the following conditions
  41. * are met:
  42. *
  43. * * Redistributions of source code must retain the above copyright
  44. * notice, this list of conditions and the following disclaimer.
  45. * * Redistributions in binary form must reproduce the above copyright
  46. * notice, this list of conditions and the following disclaimer in
  47. * the documentation and/or other materials provided with the
  48. * distribution.
  49. * * Neither the name Intel Corporation nor the names of its
  50. * contributors may be used to endorse or promote products derived
  51. * from this software without specific prior written permission.
  52. *
  53. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  54. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  55. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  56. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  57. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  58. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  59. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  60. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  61. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  62. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  63. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  64. *
  65. *****************************************************************************/
  66. #include <linux/module.h>
  67. #include <linux/stringify.h>
  68. #include "iwl-config.h"
  69. #include "iwl-agn-hw.h"
  70. /* Highest firmware API version supported */
  71. #define IWL8000_UCODE_API_MAX 26
  72. #define IWL8265_UCODE_API_MAX 26
  73. /* Lowest firmware API version supported */
  74. #define IWL8000_UCODE_API_MIN 17
  75. #define IWL8265_UCODE_API_MIN 20
  76. /* NVM versions */
  77. #define IWL8000_NVM_VERSION 0x0a1d
  78. #define IWL8000_TX_POWER_VERSION 0xffff /* meaningless */
  79. /* Memory offsets and lengths */
  80. #define IWL8260_DCCM_OFFSET 0x800000
  81. #define IWL8260_DCCM_LEN 0x18000
  82. #define IWL8260_DCCM2_OFFSET 0x880000
  83. #define IWL8260_DCCM2_LEN 0x8000
  84. #define IWL8260_SMEM_OFFSET 0x400000
  85. #define IWL8260_SMEM_LEN 0x68000
  86. #define IWL8000_FW_PRE "iwlwifi-8000C-"
  87. #define IWL8000_MODULE_FIRMWARE(api) \
  88. IWL8000_FW_PRE "-" __stringify(api) ".ucode"
  89. #define IWL8265_FW_PRE "iwlwifi-8265-"
  90. #define IWL8265_MODULE_FIRMWARE(api) \
  91. IWL8265_FW_PRE __stringify(api) ".ucode"
  92. #define NVM_HW_SECTION_NUM_FAMILY_8000 10
  93. #define DEFAULT_NVM_FILE_FAMILY_8000B "nvmData-8000B"
  94. #define DEFAULT_NVM_FILE_FAMILY_8000C "nvmData-8000C"
  95. /* Max SDIO RX/TX aggregation sizes of the ADDBA request/response */
  96. #define MAX_RX_AGG_SIZE_8260_SDIO 21
  97. #define MAX_TX_AGG_SIZE_8260_SDIO 40
  98. /* Max A-MPDU exponent for HT and VHT */
  99. #define MAX_HT_AMPDU_EXPONENT_8260_SDIO IEEE80211_HT_MAX_AMPDU_32K
  100. #define MAX_VHT_AMPDU_EXPONENT_8260_SDIO IEEE80211_VHT_MAX_AMPDU_32K
  101. static const struct iwl_base_params iwl8000_base_params = {
  102. .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_8000,
  103. .num_of_queues = 31,
  104. .shadow_ram_support = true,
  105. .led_compensation = 57,
  106. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  107. .max_event_log_size = 512,
  108. .shadow_reg_enable = true,
  109. .pcie_l1_allowed = true,
  110. };
  111. static const struct iwl_ht_params iwl8000_ht_params = {
  112. .stbc = true,
  113. .ldpc = true,
  114. .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
  115. };
  116. static const struct iwl_tt_params iwl8000_tt_params = {
  117. .ct_kill_entry = 115,
  118. .ct_kill_exit = 93,
  119. .ct_kill_duration = 5,
  120. .dynamic_smps_entry = 111,
  121. .dynamic_smps_exit = 107,
  122. .tx_protection_entry = 112,
  123. .tx_protection_exit = 105,
  124. .tx_backoff = {
  125. {.temperature = 110, .backoff = 200},
  126. {.temperature = 111, .backoff = 600},
  127. {.temperature = 112, .backoff = 1200},
  128. {.temperature = 113, .backoff = 2000},
  129. {.temperature = 114, .backoff = 4000},
  130. },
  131. .support_ct_kill = true,
  132. .support_dynamic_smps = true,
  133. .support_tx_protection = true,
  134. .support_tx_backoff = true,
  135. };
  136. #define IWL_DEVICE_8000_COMMON \
  137. .device_family = IWL_DEVICE_FAMILY_8000, \
  138. .max_inst_size = IWL60_RTC_INST_SIZE, \
  139. .max_data_size = IWL60_RTC_DATA_SIZE, \
  140. .base_params = &iwl8000_base_params, \
  141. .led_mode = IWL_LED_RF_STATE, \
  142. .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_8000, \
  143. .features = NETIF_F_RXCSUM, \
  144. .non_shared_ant = ANT_A, \
  145. .dccm_offset = IWL8260_DCCM_OFFSET, \
  146. .dccm_len = IWL8260_DCCM_LEN, \
  147. .dccm2_offset = IWL8260_DCCM2_OFFSET, \
  148. .dccm2_len = IWL8260_DCCM2_LEN, \
  149. .smem_offset = IWL8260_SMEM_OFFSET, \
  150. .smem_len = IWL8260_SMEM_LEN, \
  151. .default_nvm_file_B_step = DEFAULT_NVM_FILE_FAMILY_8000B, \
  152. .default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C, \
  153. .thermal_params = &iwl8000_tt_params, \
  154. .apmg_not_supported = true
  155. #define IWL_DEVICE_8000 \
  156. IWL_DEVICE_8000_COMMON, \
  157. .ucode_api_max = IWL8000_UCODE_API_MAX, \
  158. .ucode_api_min = IWL8000_UCODE_API_MIN \
  159. #define IWL_DEVICE_8260 \
  160. IWL_DEVICE_8000_COMMON, \
  161. .ucode_api_max = IWL8000_UCODE_API_MAX, \
  162. .ucode_api_min = IWL8000_UCODE_API_MIN \
  163. #define IWL_DEVICE_8265 \
  164. IWL_DEVICE_8000_COMMON, \
  165. .ucode_api_max = IWL8265_UCODE_API_MAX, \
  166. .ucode_api_min = IWL8265_UCODE_API_MIN \
  167. const struct iwl_cfg iwl8260_2n_cfg = {
  168. .name = "Intel(R) Dual Band Wireless N 8260",
  169. .fw_name_pre = IWL8000_FW_PRE,
  170. IWL_DEVICE_8260,
  171. .ht_params = &iwl8000_ht_params,
  172. .nvm_ver = IWL8000_NVM_VERSION,
  173. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  174. };
  175. const struct iwl_cfg iwl8260_2ac_cfg = {
  176. .name = "Intel(R) Dual Band Wireless AC 8260",
  177. .fw_name_pre = IWL8000_FW_PRE,
  178. IWL_DEVICE_8260,
  179. .ht_params = &iwl8000_ht_params,
  180. .nvm_ver = IWL8000_NVM_VERSION,
  181. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  182. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  183. };
  184. const struct iwl_cfg iwl8265_2ac_cfg = {
  185. .name = "Intel(R) Dual Band Wireless AC 8265",
  186. .fw_name_pre = IWL8265_FW_PRE,
  187. IWL_DEVICE_8265,
  188. .ht_params = &iwl8000_ht_params,
  189. .nvm_ver = IWL8000_NVM_VERSION,
  190. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  191. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  192. .vht_mu_mimo_supported = true,
  193. };
  194. const struct iwl_cfg iwl8275_2ac_cfg = {
  195. .name = "Intel(R) Dual Band Wireless AC 8275",
  196. .fw_name_pre = IWL8265_FW_PRE,
  197. IWL_DEVICE_8265,
  198. .ht_params = &iwl8000_ht_params,
  199. .nvm_ver = IWL8000_NVM_VERSION,
  200. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  201. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  202. .vht_mu_mimo_supported = true,
  203. };
  204. const struct iwl_cfg iwl4165_2ac_cfg = {
  205. .name = "Intel(R) Dual Band Wireless AC 4165",
  206. .fw_name_pre = IWL8000_FW_PRE,
  207. IWL_DEVICE_8000,
  208. .ht_params = &iwl8000_ht_params,
  209. .nvm_ver = IWL8000_NVM_VERSION,
  210. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  211. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  212. };
  213. const struct iwl_cfg iwl8260_2ac_sdio_cfg = {
  214. .name = "Intel(R) Dual Band Wireless-AC 8260",
  215. .fw_name_pre = IWL8000_FW_PRE,
  216. IWL_DEVICE_8260,
  217. .ht_params = &iwl8000_ht_params,
  218. .nvm_ver = IWL8000_NVM_VERSION,
  219. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  220. .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
  221. .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
  222. .disable_dummy_notification = true,
  223. .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
  224. .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
  225. };
  226. const struct iwl_cfg iwl8265_2ac_sdio_cfg = {
  227. .name = "Intel(R) Dual Band Wireless-AC 8265",
  228. .fw_name_pre = IWL8265_FW_PRE,
  229. IWL_DEVICE_8265,
  230. .ht_params = &iwl8000_ht_params,
  231. .nvm_ver = IWL8000_NVM_VERSION,
  232. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  233. .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
  234. .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
  235. .disable_dummy_notification = true,
  236. .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
  237. .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
  238. };
  239. const struct iwl_cfg iwl4165_2ac_sdio_cfg = {
  240. .name = "Intel(R) Dual Band Wireless-AC 4165",
  241. .fw_name_pre = IWL8000_FW_PRE,
  242. IWL_DEVICE_8000,
  243. .ht_params = &iwl8000_ht_params,
  244. .nvm_ver = IWL8000_NVM_VERSION,
  245. .nvm_calib_ver = IWL8000_TX_POWER_VERSION,
  246. .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
  247. .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
  248. .bt_shared_single_ant = true,
  249. .disable_dummy_notification = true,
  250. .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
  251. .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
  252. };
  253. MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_MAX));
  254. MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE(IWL8265_UCODE_API_MAX));