6000.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2008 - 2013 Intel Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. * The full GNU General Public License is included in this distribution in the
  19. * file called LICENSE.
  20. *
  21. * Contact Information:
  22. * Intel Linux Wireless <ilw@linux.intel.com>
  23. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  24. *
  25. *****************************************************************************/
  26. #include <linux/module.h>
  27. #include <linux/stringify.h>
  28. #include "iwl-config.h"
  29. #include "iwl-agn-hw.h"
  30. #include "cfg.h"
  31. #include "dvm/commands.h" /* needed for BT for now */
  32. /* Highest firmware API version supported */
  33. #define IWL6000_UCODE_API_MAX 6
  34. #define IWL6050_UCODE_API_MAX 5
  35. #define IWL6000G2_UCODE_API_MAX 6
  36. #define IWL6035_UCODE_API_MAX 6
  37. /* Oldest version we won't warn about */
  38. #define IWL6000_UCODE_API_OK 4
  39. #define IWL6000G2_UCODE_API_OK 5
  40. #define IWL6050_UCODE_API_OK 5
  41. #define IWL6000G2B_UCODE_API_OK 6
  42. #define IWL6035_UCODE_API_OK 6
  43. /* Lowest firmware API version supported */
  44. #define IWL6000_UCODE_API_MIN 4
  45. #define IWL6050_UCODE_API_MIN 4
  46. #define IWL6000G2_UCODE_API_MIN 5
  47. #define IWL6035_UCODE_API_MIN 6
  48. /* EEPROM versions */
  49. #define EEPROM_6000_TX_POWER_VERSION (4)
  50. #define EEPROM_6000_EEPROM_VERSION (0x423)
  51. #define EEPROM_6050_TX_POWER_VERSION (4)
  52. #define EEPROM_6050_EEPROM_VERSION (0x532)
  53. #define EEPROM_6150_TX_POWER_VERSION (6)
  54. #define EEPROM_6150_EEPROM_VERSION (0x553)
  55. #define EEPROM_6005_TX_POWER_VERSION (6)
  56. #define EEPROM_6005_EEPROM_VERSION (0x709)
  57. #define EEPROM_6030_TX_POWER_VERSION (6)
  58. #define EEPROM_6030_EEPROM_VERSION (0x709)
  59. #define EEPROM_6035_TX_POWER_VERSION (6)
  60. #define EEPROM_6035_EEPROM_VERSION (0x753)
  61. #define IWL6000_FW_PRE "iwlwifi-6000-"
  62. #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode"
  63. #define IWL6050_FW_PRE "iwlwifi-6050-"
  64. #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode"
  65. #define IWL6005_FW_PRE "iwlwifi-6000g2a-"
  66. #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode"
  67. #define IWL6030_FW_PRE "iwlwifi-6000g2b-"
  68. #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode"
  69. static const struct iwl_base_params iwl6000_base_params = {
  70. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  71. .num_of_queues = IWLAGN_NUM_QUEUES,
  72. .pll_cfg_val = 0,
  73. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  74. .shadow_ram_support = true,
  75. .led_compensation = 51,
  76. .adv_thermal_throttle = true,
  77. .support_ct_kill_exit = true,
  78. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  79. .chain_noise_scale = 1000,
  80. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  81. .max_event_log_size = 512,
  82. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  83. };
  84. static const struct iwl_base_params iwl6050_base_params = {
  85. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  86. .num_of_queues = IWLAGN_NUM_QUEUES,
  87. .pll_cfg_val = 0,
  88. .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
  89. .shadow_ram_support = true,
  90. .led_compensation = 51,
  91. .adv_thermal_throttle = true,
  92. .support_ct_kill_exit = true,
  93. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  94. .chain_noise_scale = 1500,
  95. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  96. .max_event_log_size = 1024,
  97. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  98. };
  99. static const struct iwl_base_params iwl6000_g2_base_params = {
  100. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  101. .num_of_queues = IWLAGN_NUM_QUEUES,
  102. .pll_cfg_val = 0,
  103. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  104. .shadow_ram_support = true,
  105. .led_compensation = 57,
  106. .adv_thermal_throttle = true,
  107. .support_ct_kill_exit = true,
  108. .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
  109. .chain_noise_scale = 1000,
  110. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  111. .max_event_log_size = 512,
  112. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  113. };
  114. static const struct iwl_ht_params iwl6000_ht_params = {
  115. .ht_greenfield_support = true,
  116. .use_rts_for_aggregation = true, /* use rts/cts protection */
  117. .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
  118. };
  119. static const struct iwl_bt_params iwl6000_bt_params = {
  120. /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
  121. .advanced_bt_coexist = true,
  122. .agg_time_limit = BT_AGG_THRESHOLD_DEF,
  123. .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
  124. .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
  125. .bt_sco_disable = true,
  126. };
  127. static const struct iwl_eeprom_params iwl6000_eeprom_params = {
  128. .regulatory_bands = {
  129. EEPROM_REG_BAND_1_CHANNELS,
  130. EEPROM_REG_BAND_2_CHANNELS,
  131. EEPROM_REG_BAND_3_CHANNELS,
  132. EEPROM_REG_BAND_4_CHANNELS,
  133. EEPROM_REG_BAND_5_CHANNELS,
  134. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  135. EEPROM_REG_BAND_52_HT40_CHANNELS
  136. },
  137. .enhanced_txpower = true,
  138. };
  139. #define IWL_DEVICE_6005 \
  140. .fw_name_pre = IWL6005_FW_PRE, \
  141. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  142. .ucode_api_ok = IWL6000G2_UCODE_API_OK, \
  143. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  144. .device_family = IWL_DEVICE_FAMILY_6005, \
  145. .max_inst_size = IWL60_RTC_INST_SIZE, \
  146. .max_data_size = IWL60_RTC_DATA_SIZE, \
  147. .nvm_ver = EEPROM_6005_EEPROM_VERSION, \
  148. .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
  149. .base_params = &iwl6000_g2_base_params, \
  150. .eeprom_params = &iwl6000_eeprom_params, \
  151. .need_temp_offset_calib = true, \
  152. .led_mode = IWL_LED_RF_STATE
  153. const struct iwl_cfg iwl6005_2agn_cfg = {
  154. .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
  155. IWL_DEVICE_6005,
  156. .ht_params = &iwl6000_ht_params,
  157. };
  158. const struct iwl_cfg iwl6005_2abg_cfg = {
  159. .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
  160. IWL_DEVICE_6005,
  161. };
  162. const struct iwl_cfg iwl6005_2bg_cfg = {
  163. .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
  164. IWL_DEVICE_6005,
  165. };
  166. const struct iwl_cfg iwl6005_2agn_sff_cfg = {
  167. .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
  168. IWL_DEVICE_6005,
  169. .ht_params = &iwl6000_ht_params,
  170. };
  171. const struct iwl_cfg iwl6005_2agn_d_cfg = {
  172. .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
  173. IWL_DEVICE_6005,
  174. .ht_params = &iwl6000_ht_params,
  175. };
  176. const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
  177. .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
  178. IWL_DEVICE_6005,
  179. .ht_params = &iwl6000_ht_params,
  180. };
  181. const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
  182. .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
  183. IWL_DEVICE_6005,
  184. .ht_params = &iwl6000_ht_params,
  185. };
  186. #define IWL_DEVICE_6030 \
  187. .fw_name_pre = IWL6030_FW_PRE, \
  188. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  189. .ucode_api_ok = IWL6000G2B_UCODE_API_OK, \
  190. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  191. .device_family = IWL_DEVICE_FAMILY_6030, \
  192. .max_inst_size = IWL60_RTC_INST_SIZE, \
  193. .max_data_size = IWL60_RTC_DATA_SIZE, \
  194. .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
  195. .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  196. .base_params = &iwl6000_g2_base_params, \
  197. .bt_params = &iwl6000_bt_params, \
  198. .eeprom_params = &iwl6000_eeprom_params, \
  199. .need_temp_offset_calib = true, \
  200. .led_mode = IWL_LED_RF_STATE, \
  201. .adv_pm = true \
  202. const struct iwl_cfg iwl6030_2agn_cfg = {
  203. .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
  204. IWL_DEVICE_6030,
  205. .ht_params = &iwl6000_ht_params,
  206. };
  207. const struct iwl_cfg iwl6030_2abg_cfg = {
  208. .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
  209. IWL_DEVICE_6030,
  210. };
  211. const struct iwl_cfg iwl6030_2bgn_cfg = {
  212. .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
  213. IWL_DEVICE_6030,
  214. .ht_params = &iwl6000_ht_params,
  215. };
  216. const struct iwl_cfg iwl6030_2bg_cfg = {
  217. .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
  218. IWL_DEVICE_6030,
  219. };
  220. #define IWL_DEVICE_6035 \
  221. .fw_name_pre = IWL6030_FW_PRE, \
  222. .ucode_api_max = IWL6035_UCODE_API_MAX, \
  223. .ucode_api_ok = IWL6035_UCODE_API_OK, \
  224. .ucode_api_min = IWL6035_UCODE_API_MIN, \
  225. .device_family = IWL_DEVICE_FAMILY_6030, \
  226. .max_inst_size = IWL60_RTC_INST_SIZE, \
  227. .max_data_size = IWL60_RTC_DATA_SIZE, \
  228. .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
  229. .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  230. .base_params = &iwl6000_g2_base_params, \
  231. .bt_params = &iwl6000_bt_params, \
  232. .eeprom_params = &iwl6000_eeprom_params, \
  233. .need_temp_offset_calib = true, \
  234. .led_mode = IWL_LED_RF_STATE, \
  235. .adv_pm = true
  236. const struct iwl_cfg iwl6035_2agn_cfg = {
  237. .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
  238. IWL_DEVICE_6035,
  239. .ht_params = &iwl6000_ht_params,
  240. };
  241. const struct iwl_cfg iwl1030_bgn_cfg = {
  242. .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
  243. IWL_DEVICE_6030,
  244. .ht_params = &iwl6000_ht_params,
  245. };
  246. const struct iwl_cfg iwl1030_bg_cfg = {
  247. .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
  248. IWL_DEVICE_6030,
  249. };
  250. const struct iwl_cfg iwl130_bgn_cfg = {
  251. .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
  252. IWL_DEVICE_6030,
  253. .ht_params = &iwl6000_ht_params,
  254. .rx_with_siso_diversity = true,
  255. };
  256. const struct iwl_cfg iwl130_bg_cfg = {
  257. .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
  258. IWL_DEVICE_6030,
  259. .rx_with_siso_diversity = true,
  260. };
  261. /*
  262. * "i": Internal configuration, use internal Power Amplifier
  263. */
  264. #define IWL_DEVICE_6000i \
  265. .fw_name_pre = IWL6000_FW_PRE, \
  266. .ucode_api_max = IWL6000_UCODE_API_MAX, \
  267. .ucode_api_ok = IWL6000_UCODE_API_OK, \
  268. .ucode_api_min = IWL6000_UCODE_API_MIN, \
  269. .device_family = IWL_DEVICE_FAMILY_6000i, \
  270. .max_inst_size = IWL60_RTC_INST_SIZE, \
  271. .max_data_size = IWL60_RTC_DATA_SIZE, \
  272. .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
  273. .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
  274. .nvm_ver = EEPROM_6000_EEPROM_VERSION, \
  275. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
  276. .base_params = &iwl6000_base_params, \
  277. .eeprom_params = &iwl6000_eeprom_params, \
  278. .led_mode = IWL_LED_BLINK
  279. const struct iwl_cfg iwl6000i_2agn_cfg = {
  280. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  281. IWL_DEVICE_6000i,
  282. .ht_params = &iwl6000_ht_params,
  283. };
  284. const struct iwl_cfg iwl6000i_2abg_cfg = {
  285. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  286. IWL_DEVICE_6000i,
  287. };
  288. const struct iwl_cfg iwl6000i_2bg_cfg = {
  289. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  290. IWL_DEVICE_6000i,
  291. };
  292. #define IWL_DEVICE_6050 \
  293. .fw_name_pre = IWL6050_FW_PRE, \
  294. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  295. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  296. .device_family = IWL_DEVICE_FAMILY_6050, \
  297. .max_inst_size = IWL60_RTC_INST_SIZE, \
  298. .max_data_size = IWL60_RTC_DATA_SIZE, \
  299. .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
  300. .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
  301. .nvm_ver = EEPROM_6050_EEPROM_VERSION, \
  302. .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
  303. .base_params = &iwl6050_base_params, \
  304. .eeprom_params = &iwl6000_eeprom_params, \
  305. .led_mode = IWL_LED_BLINK, \
  306. .internal_wimax_coex = true
  307. const struct iwl_cfg iwl6050_2agn_cfg = {
  308. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  309. IWL_DEVICE_6050,
  310. .ht_params = &iwl6000_ht_params,
  311. };
  312. const struct iwl_cfg iwl6050_2abg_cfg = {
  313. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  314. IWL_DEVICE_6050,
  315. };
  316. #define IWL_DEVICE_6150 \
  317. .fw_name_pre = IWL6050_FW_PRE, \
  318. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  319. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  320. .device_family = IWL_DEVICE_FAMILY_6150, \
  321. .max_inst_size = IWL60_RTC_INST_SIZE, \
  322. .max_data_size = IWL60_RTC_DATA_SIZE, \
  323. .nvm_ver = EEPROM_6150_EEPROM_VERSION, \
  324. .nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
  325. .base_params = &iwl6050_base_params, \
  326. .eeprom_params = &iwl6000_eeprom_params, \
  327. .led_mode = IWL_LED_BLINK, \
  328. .internal_wimax_coex = true
  329. const struct iwl_cfg iwl6150_bgn_cfg = {
  330. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
  331. IWL_DEVICE_6150,
  332. .ht_params = &iwl6000_ht_params,
  333. };
  334. const struct iwl_cfg iwl6150_bg_cfg = {
  335. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
  336. IWL_DEVICE_6150,
  337. };
  338. const struct iwl_cfg iwl6000_3agn_cfg = {
  339. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  340. .fw_name_pre = IWL6000_FW_PRE,
  341. .ucode_api_max = IWL6000_UCODE_API_MAX,
  342. .ucode_api_ok = IWL6000_UCODE_API_OK,
  343. .ucode_api_min = IWL6000_UCODE_API_MIN,
  344. .device_family = IWL_DEVICE_FAMILY_6000,
  345. .max_inst_size = IWL60_RTC_INST_SIZE,
  346. .max_data_size = IWL60_RTC_DATA_SIZE,
  347. .nvm_ver = EEPROM_6000_EEPROM_VERSION,
  348. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  349. .base_params = &iwl6000_base_params,
  350. .eeprom_params = &iwl6000_eeprom_params,
  351. .ht_params = &iwl6000_ht_params,
  352. .led_mode = IWL_LED_BLINK,
  353. };
  354. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
  355. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
  356. MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
  357. MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));