blob: d1665fa6d15a0e7ce56fb7dcb28f73b4e7554220 [file] [log] [blame]
Tomas Winkler5a6a2562008-04-24 11:55:23 -07001/******************************************************************************
2 *
Wey-Yi Guy4e318262011-12-27 11:21:32 -08003 * Copyright(c) 2007 - 2012 Intel Corporation. All rights reserved.
Tomas Winkler5a6a2562008-04-24 11:55:23 -07004 *
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:
Wey-Yi Guy3d2b1622010-03-17 18:57:13 -070022 * Intel Linux Wireless <ilw@linux.intel.com>
Tomas Winkler5a6a2562008-04-24 11:55:23 -070023 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
Tomas Winkler5a6a2562008-04-24 11:55:23 -070027#include <linux/module.h>
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070028#include <linux/stringify.h>
Johannes Berge9676692012-04-10 14:10:28 -070029#include "iwl-config.h"
Johannes Berg0db19cd2012-04-03 20:57:59 +020030#include "iwl-agn-hw.h"
31#include "iwl-csr.h"
Johannes Berg6468a012012-05-16 19:13:54 +020032#include "cfg.h"
Tomas Winkler5a6a2562008-04-24 11:55:23 -070033
Reinette Chatrea0987a82008-12-02 12:14:06 -080034/* Highest firmware API version supported */
Fry, Donald H41504cc2011-02-16 11:49:34 -080035#define IWL5000_UCODE_API_MAX 5
Jay Sternberg39e6d222009-02-27 16:21:19 -080036#define IWL5150_UCODE_API_MAX 2
Tomas Winkler5a6a2562008-04-24 11:55:23 -070037
Meenakshi Venkataraman78cbcf22012-04-22 07:55:27 -070038/* Oldest version we won't warn about */
39#define IWL5000_UCODE_API_OK 5
40#define IWL5150_UCODE_API_OK 2
41
Reinette Chatrea0987a82008-12-02 12:14:06 -080042/* Lowest firmware API version supported */
43#define IWL5000_UCODE_API_MIN 1
44#define IWL5150_UCODE_API_MIN 1
45
Johannes Berg586aed92012-04-03 20:41:07 +020046/* EEPROM versions */
47#define EEPROM_5000_TX_POWER_VERSION (4)
48#define EEPROM_5000_EEPROM_VERSION (0x11A)
49#define EEPROM_5050_TX_POWER_VERSION (4)
50#define EEPROM_5050_EEPROM_VERSION (0x21E)
51
Reinette Chatrea0987a82008-12-02 12:14:06 -080052#define IWL5000_FW_PRE "iwlwifi-5000-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070053#define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode"
Reinette Chatrea0987a82008-12-02 12:14:06 -080054
55#define IWL5150_FW_PRE "iwlwifi-5150-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070056#define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode"
Jay Sternberg4e062f92008-10-14 12:32:41 -070057
Johannes Berg6794f3e2012-03-06 13:30:56 -080058static const struct iwl_base_params iwl5000_base_params = {
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -070059 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -070060 .num_of_queues = IWLAGN_NUM_QUEUES,
Ben Cahillfadb3582009-10-23 13:42:21 -070061 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -070062 .led_compensation = 51,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -080063 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -080064 .chain_noise_scale = 1000,
Paul Bolle6de49022012-05-30 09:14:41 +020065 .wd_timeout = IWL_WATCHDOG_DISABLED,
Wey-Yi Guy678b3852010-03-26 12:54:37 -070066 .max_event_log_size = 512,
Wey-Yi Guyf3529102011-08-02 09:08:37 -070067 .no_idle_support = true,
Tomas Winkler5a6a2562008-04-24 11:55:23 -070068};
Johannes Berg6794f3e2012-03-06 13:30:56 -080069
70static const struct iwl_ht_params iwl5000_ht_params = {
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -070071 .ht_greenfield_support = true,
Johannes Bergd3704932012-05-21 20:03:01 +020072 .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -070073};
74
Johannes Berg26a7ca92012-05-21 11:55:54 +020075static const struct iwl_eeprom_params iwl5000_eeprom_params = {
76 .regulatory_bands = {
77 EEPROM_REG_BAND_1_CHANNELS,
78 EEPROM_REG_BAND_2_CHANNELS,
79 EEPROM_REG_BAND_3_CHANNELS,
80 EEPROM_REG_BAND_4_CHANNELS,
81 EEPROM_REG_BAND_5_CHANNELS,
82 EEPROM_REG_BAND_24_HT40_CHANNELS,
83 EEPROM_REG_BAND_52_HT40_CHANNELS
84 },
85};
86
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080087#define IWL_DEVICE_5000 \
88 .fw_name_pre = IWL5000_FW_PRE, \
89 .ucode_api_max = IWL5000_UCODE_API_MAX, \
Meenakshi Venkataraman78cbcf22012-04-22 07:55:27 -070090 .ucode_api_ok = IWL5000_UCODE_API_OK, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080091 .ucode_api_min = IWL5000_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -070092 .device_family = IWL_DEVICE_FAMILY_5000, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +020093 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
94 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080095 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, \
96 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080097 .base_params = &iwl5000_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +020098 .eeprom_params = &iwl5000_eeprom_params, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080099 .led_mode = IWL_LED_BLINK
100
Johannes Berg706c4ff2012-03-05 11:24:33 -0800101const struct iwl_cfg iwl5300_agn_cfg = {
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700102 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800103 IWL_DEVICE_5000,
Johannes Berg2845fd82011-04-05 08:55:05 -0700104 /* at least EEPROM 0x11A has wrong info */
105 .valid_tx_ant = ANT_ABC, /* .cfg overwrite */
106 .valid_rx_ant = ANT_ABC, /* .cfg overwrite */
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700107 .ht_params = &iwl5000_ht_params,
108};
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700109
Johannes Berg706c4ff2012-03-05 11:24:33 -0800110const struct iwl_cfg iwl5100_bgn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800111 .name = "Intel(R) WiFi Link 5100 BGN",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800112 IWL_DEVICE_5000,
Wey-Yi Guydbbf1752010-11-15 13:43:07 -0800113 .valid_tx_ant = ANT_B, /* .cfg overwrite */
114 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700115 .ht_params = &iwl5000_ht_params,
Esti Kummer47408632008-07-11 11:53:30 +0800116};
117
Johannes Berg706c4ff2012-03-05 11:24:33 -0800118const struct iwl_cfg iwl5100_abg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800119 .name = "Intel(R) WiFi Link 5100 ABG",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800120 IWL_DEVICE_5000,
Wey-Yi Guydbbf1752010-11-15 13:43:07 -0800121 .valid_tx_ant = ANT_B, /* .cfg overwrite */
122 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
Esti Kummer47408632008-07-11 11:53:30 +0800123};
124
Johannes Berg706c4ff2012-03-05 11:24:33 -0800125const struct iwl_cfg iwl5100_agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800126 .name = "Intel(R) WiFi Link 5100 AGN",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800127 IWL_DEVICE_5000,
Wey-Yi Guydbbf1752010-11-15 13:43:07 -0800128 .valid_tx_ant = ANT_B, /* .cfg overwrite */
129 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700130 .ht_params = &iwl5000_ht_params,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700131};
132
Johannes Berg706c4ff2012-03-05 11:24:33 -0800133const struct iwl_cfg iwl5350_agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800134 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
Reinette Chatrea0987a82008-12-02 12:14:06 -0800135 .fw_name_pre = IWL5000_FW_PRE,
136 .ucode_api_max = IWL5000_UCODE_API_MAX,
Meenakshi Venkataraman78cbcf22012-04-22 07:55:27 -0700137 .ucode_api_ok = IWL5000_UCODE_API_OK,
Reinette Chatrea0987a82008-12-02 12:14:06 -0800138 .ucode_api_min = IWL5000_UCODE_API_MIN,
Johannes Berg2d771cb2012-04-09 17:47:00 -0700139 .device_family = IWL_DEVICE_FAMILY_5000,
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200140 .max_inst_size = IWLAGN_RTC_INST_SIZE,
141 .max_data_size = IWLAGN_RTC_DATA_SIZE,
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700142 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
143 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700144 .base_params = &iwl5000_base_params,
Johannes Berg26a7ca92012-05-21 11:55:54 +0200145 .eeprom_params = &iwl5000_eeprom_params,
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700146 .ht_params = &iwl5000_ht_params,
Wey-Yi Guy564b3442010-11-09 09:21:34 -0800147 .led_mode = IWL_LED_BLINK,
Wey-Yi Guy50619ac2010-12-07 08:06:31 -0800148 .internal_wimax_coex = true,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700149};
150
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800151#define IWL_DEVICE_5150 \
152 .fw_name_pre = IWL5150_FW_PRE, \
153 .ucode_api_max = IWL5150_UCODE_API_MAX, \
Meenakshi Venkataraman78cbcf22012-04-22 07:55:27 -0700154 .ucode_api_ok = IWL5150_UCODE_API_OK, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800155 .ucode_api_min = IWL5150_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700156 .device_family = IWL_DEVICE_FAMILY_5150, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200157 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
158 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800159 .eeprom_ver = EEPROM_5050_EEPROM_VERSION, \
160 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800161 .base_params = &iwl5000_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200162 .eeprom_params = &iwl5000_eeprom_params, \
Johannes Bergc27bdc82011-11-25 11:11:43 -0800163 .no_xtal_calib = true, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800164 .led_mode = IWL_LED_BLINK, \
165 .internal_wimax_coex = true
166
Johannes Berg706c4ff2012-03-05 11:24:33 -0800167const struct iwl_cfg iwl5150_agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800168 .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800169 IWL_DEVICE_5150,
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700170 .ht_params = &iwl5000_ht_params,
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800171
Tomas Winkler7100e922008-12-01 16:32:18 -0800172};
173
Johannes Berg706c4ff2012-03-05 11:24:33 -0800174const struct iwl_cfg iwl5150_abg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800175 .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800176 IWL_DEVICE_5150,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700177};
178
Meenakshi Venkataraman78cbcf22012-04-22 07:55:27 -0700179MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_OK));
180MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_OK));