aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-07-31 17:28:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-04 16:44:22 -0400
commit65b7998a9be418482493e9448bb83ff2914ed050 (patch)
tree47af0592b112089e54feb7925420013bf1f7f981
parent8ce73f3abd064081706cc337c771378fc4431ef3 (diff)
iwlwifi: Distinguish power amplifier for 6000 series
For 6x00 2x2 NIC, two types of Power Amplifier are available. In order for uCode to apply correct tx power, driver needs to program the CSR_GP_DRIVER_REG register and let uCode know the type of PA. If driver do not program CSR_GP_DRIVER_REG register (default to 0), then it is uCode's decision for tx power 2x2 Hybrid card: use both internal and external PA 2x2 IPA(Internal Power Amplifier) card: internal PA only Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c50
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-csr.h10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h16
7 files changed, 94 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 5f7c52053c18..cf3fbc6b98ef 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -73,6 +73,18 @@ static void iwl1000_set_ct_threshold(struct iwl_priv *priv)
73 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD; 73 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
74} 74}
75 75
76/* NIC configuration for 1000 series */
77static void iwl1000_nic_config(struct iwl_priv *priv)
78{
79 iwl5000_nic_config(priv);
80
81 /* Setting digital SVR for 1000 card to 1.32V */
82 /* locking is acquired in iwl_set_bits_mask_prph() function */
83 iwl_set_bits_mask_prph(priv, APMG_DIGITAL_SVR_REG,
84 APMG_SVR_DIGITAL_VOLTAGE_1_32,
85 ~APMG_SVR_VOLTAGE_CONFIG_BIT_MSK);
86}
87
76static struct iwl_lib_ops iwl1000_lib = { 88static struct iwl_lib_ops iwl1000_lib = {
77 .set_hw_params = iwl5000_hw_set_hw_params, 89 .set_hw_params = iwl5000_hw_set_hw_params,
78 .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, 90 .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl,
@@ -95,7 +107,7 @@ static struct iwl_lib_ops iwl1000_lib = {
95 .init = iwl5000_apm_init, 107 .init = iwl5000_apm_init,
96 .reset = iwl5000_apm_reset, 108 .reset = iwl5000_apm_reset,
97 .stop = iwl5000_apm_stop, 109 .stop = iwl5000_apm_stop,
98 .config = iwl5000_nic_config, 110 .config = iwl1000_nic_config,
99 .set_pwr_src = iwl_set_pwr_src, 111 .set_pwr_src = iwl_set_pwr_src,
100 }, 112 },
101 .eeprom_ops = { 113 .eeprom_ops = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index ddd64fef3039..87957c052839 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -198,6 +198,7 @@ out:
198} 198}
199 199
200 200
201/* NIC configuration for 5000 series and up */
201void iwl5000_nic_config(struct iwl_priv *priv) 202void iwl5000_nic_config(struct iwl_priv *priv)
202{ 203{
203 unsigned long flags; 204 unsigned long flags;
@@ -239,18 +240,11 @@ void iwl5000_nic_config(struct iwl_priv *priv)
239 APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS, 240 APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS,
240 ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS); 241 ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS);
241 242
242 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_1000) {
243 /* Setting digital SVR for 1000 card to 1.32V */
244 iwl_set_bits_mask_prph(priv, APMG_DIGITAL_SVR_REG,
245 APMG_SVR_DIGITAL_VOLTAGE_1_32,
246 ~APMG_SVR_VOLTAGE_CONFIG_BIT_MSK);
247 }
248 243
249 spin_unlock_irqrestore(&priv->lock, flags); 244 spin_unlock_irqrestore(&priv->lock, flags);
250} 245}
251 246
252 247
253
254/* 248/*
255 * EEPROM 249 * EEPROM
256 */ 250 */
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 59ff73536f3a..052a704f2364 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -68,6 +68,24 @@ static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
68 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD; 68 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
69} 69}
70 70
71/* NIC configuration for 6000 series */
72static void iwl6000_nic_config(struct iwl_priv *priv)
73{
74 iwl5000_nic_config(priv);
75
76 /* no locking required for register write */
77 if (priv->cfg->pa_type == IWL_PA_HYBRID) {
78 /* 2x2 hybrid phy type */
79 iwl_write32(priv, CSR_GP_DRIVER_REG,
80 CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_HYB);
81 } else if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
82 /* 2x2 IPA phy type */
83 iwl_write32(priv, CSR_GP_DRIVER_REG,
84 CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
85 }
86 /* else do nothing, uCode configured */
87}
88
71static struct iwl_lib_ops iwl6000_lib = { 89static struct iwl_lib_ops iwl6000_lib = {
72 .set_hw_params = iwl5000_hw_set_hw_params, 90 .set_hw_params = iwl5000_hw_set_hw_params,
73 .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, 91 .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl,
@@ -90,7 +108,7 @@ static struct iwl_lib_ops iwl6000_lib = {
90 .init = iwl5000_apm_init, 108 .init = iwl5000_apm_init,
91 .reset = iwl5000_apm_reset, 109 .reset = iwl5000_apm_reset,
92 .stop = iwl5000_apm_stop, 110 .stop = iwl5000_apm_stop,
93 .config = iwl5000_nic_config, 111 .config = iwl6000_nic_config,
94 .set_pwr_src = iwl_set_pwr_src, 112 .set_pwr_src = iwl_set_pwr_src,
95 }, 113 },
96 .eeprom_ops = { 114 .eeprom_ops = {
@@ -146,9 +164,13 @@ struct iwl_cfg iwl6000_2ag_cfg = {
146 .valid_tx_ant = ANT_BC, 164 .valid_tx_ant = ANT_BC,
147 .valid_rx_ant = ANT_BC, 165 .valid_rx_ant = ANT_BC,
148 .need_pll_cfg = false, 166 .need_pll_cfg = false,
167 .pa_type = IWL_PA_SYSTEM,
149}; 168};
150 169
151struct iwl_cfg iwl6000_2agn_cfg = { 170/*
171 * "h": Hybrid configuration, use both internal and external Power Amplifier
172 */
173struct iwl_cfg iwl6000h_2agn_cfg = {
152 .name = "6000 Series 2x2 AGN", 174 .name = "6000 Series 2x2 AGN",
153 .fw_name_pre = IWL6000_FW_PRE, 175 .fw_name_pre = IWL6000_FW_PRE,
154 .ucode_api_max = IWL6000_UCODE_API_MAX, 176 .ucode_api_max = IWL6000_UCODE_API_MAX,
@@ -162,6 +184,27 @@ struct iwl_cfg iwl6000_2agn_cfg = {
162 .valid_tx_ant = ANT_AB, 184 .valid_tx_ant = ANT_AB,
163 .valid_rx_ant = ANT_AB, 185 .valid_rx_ant = ANT_AB,
164 .need_pll_cfg = false, 186 .need_pll_cfg = false,
187 .pa_type = IWL_PA_HYBRID,
188};
189
190/*
191 * "i": Internal configuration, use internal Power Amplifier
192 */
193struct iwl_cfg iwl6000i_2agn_cfg = {
194 .name = "6000 Series 2x2 AGN",
195 .fw_name_pre = IWL6000_FW_PRE,
196 .ucode_api_max = IWL6000_UCODE_API_MAX,
197 .ucode_api_min = IWL6000_UCODE_API_MIN,
198 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
199 .ops = &iwl6000_ops,
200 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
201 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
202 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
203 .mod_params = &iwl50_mod_params,
204 .valid_tx_ant = ANT_BC,
205 .valid_rx_ant = ANT_BC,
206 .need_pll_cfg = false,
207 .pa_type = IWL_PA_INTERNAL,
165}; 208};
166 209
167struct iwl_cfg iwl6050_2agn_cfg = { 210struct iwl_cfg iwl6050_2agn_cfg = {
@@ -178,6 +221,7 @@ struct iwl_cfg iwl6050_2agn_cfg = {
178 .valid_tx_ant = ANT_AB, 221 .valid_tx_ant = ANT_AB,
179 .valid_rx_ant = ANT_AB, 222 .valid_rx_ant = ANT_AB,
180 .need_pll_cfg = false, 223 .need_pll_cfg = false,
224 .pa_type = IWL_PA_SYSTEM,
181}; 225};
182 226
183struct iwl_cfg iwl6000_3agn_cfg = { 227struct iwl_cfg iwl6000_3agn_cfg = {
@@ -194,6 +238,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
194 .valid_tx_ant = ANT_ABC, 238 .valid_tx_ant = ANT_ABC,
195 .valid_rx_ant = ANT_ABC, 239 .valid_rx_ant = ANT_ABC,
196 .need_pll_cfg = false, 240 .need_pll_cfg = false,
241 .pa_type = IWL_PA_SYSTEM,
197}; 242};
198 243
199struct iwl_cfg iwl6050_3agn_cfg = { 244struct iwl_cfg iwl6050_3agn_cfg = {
@@ -210,6 +255,7 @@ struct iwl_cfg iwl6050_3agn_cfg = {
210 .valid_tx_ant = ANT_ABC, 255 .valid_tx_ant = ANT_ABC,
211 .valid_rx_ant = ANT_ABC, 256 .valid_rx_ant = ANT_ABC,
212 .need_pll_cfg = false, 257 .need_pll_cfg = false,
258 .pa_type = IWL_PA_SYSTEM,
213}; 259};
214 260
215MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); 261MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 4cb1a1b73483..a54330b24432 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3142,11 +3142,13 @@ static struct pci_device_id iwl_hw_card_ids[] = {
3142 {IWL_PCI_DEVICE(0x0082, 0x1102, iwl6000_2ag_cfg)}, 3142 {IWL_PCI_DEVICE(0x0082, 0x1102, iwl6000_2ag_cfg)},
3143 {IWL_PCI_DEVICE(0x0085, 0x1112, iwl6000_2ag_cfg)}, 3143 {IWL_PCI_DEVICE(0x0085, 0x1112, iwl6000_2ag_cfg)},
3144 {IWL_PCI_DEVICE(0x0082, 0x1122, iwl6000_2ag_cfg)}, 3144 {IWL_PCI_DEVICE(0x0082, 0x1122, iwl6000_2ag_cfg)},
3145 {IWL_PCI_DEVICE(0x008D, PCI_ANY_ID, iwl6000h_2agn_cfg)},
3146 {IWL_PCI_DEVICE(0x008E, PCI_ANY_ID, iwl6000h_2agn_cfg)},
3145 {IWL_PCI_DEVICE(0x422B, PCI_ANY_ID, iwl6000_3agn_cfg)}, 3147 {IWL_PCI_DEVICE(0x422B, PCI_ANY_ID, iwl6000_3agn_cfg)},
3146 {IWL_PCI_DEVICE(0x422C, PCI_ANY_ID, iwl6000_2agn_cfg)}, 3148 {IWL_PCI_DEVICE(0x422C, PCI_ANY_ID, iwl6000i_2agn_cfg)},
3147 {IWL_PCI_DEVICE(0x4238, PCI_ANY_ID, iwl6000_3agn_cfg)}, 3149 {IWL_PCI_DEVICE(0x4238, PCI_ANY_ID, iwl6000_3agn_cfg)},
3148 {IWL_PCI_DEVICE(0x4239, PCI_ANY_ID, iwl6000_2agn_cfg)}, 3150 {IWL_PCI_DEVICE(0x4239, PCI_ANY_ID, iwl6000i_2agn_cfg)},
3149 {IWL_PCI_DEVICE(0x0082, PCI_ANY_ID, iwl6000_2agn_cfg)}, 3151 {IWL_PCI_DEVICE(0x0082, PCI_ANY_ID, iwl6000h_2agn_cfg)},
3150 {IWL_PCI_DEVICE(0x0085, PCI_ANY_ID, iwl6000_3agn_cfg)}, 3152 {IWL_PCI_DEVICE(0x0085, PCI_ANY_ID, iwl6000_3agn_cfg)},
3151 {IWL_PCI_DEVICE(0x0086, PCI_ANY_ID, iwl6050_3agn_cfg)}, 3153 {IWL_PCI_DEVICE(0x0086, PCI_ANY_ID, iwl6050_3agn_cfg)},
3152 {IWL_PCI_DEVICE(0x0087, PCI_ANY_ID, iwl6050_2agn_cfg)}, 3154 {IWL_PCI_DEVICE(0x0087, PCI_ANY_ID, iwl6050_2agn_cfg)},
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index febcf76e1d41..10ddcdda1041 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -206,6 +206,7 @@ struct iwl_mod_params {
206 * filename is constructed as fw_name_pre<api>.ucode. 206 * filename is constructed as fw_name_pre<api>.ucode.
207 * @ucode_api_max: Highest version of uCode API supported by driver. 207 * @ucode_api_max: Highest version of uCode API supported by driver.
208 * @ucode_api_min: Lowest version of uCode API supported by driver. 208 * @ucode_api_min: Lowest version of uCode API supported by driver.
209 * @pa_type: used by 6000 series only to identify the type of Power Amplifier
209 * 210 *
210 * We enable the driver to be backward compatible wrt API version. The 211 * We enable the driver to be backward compatible wrt API version. The
211 * driver specifies which APIs it supports (with @ucode_api_max being the 212 * driver specifies which APIs it supports (with @ucode_api_max being the
@@ -226,6 +227,7 @@ struct iwl_mod_params {
226 * iwl_hcmd_utils_ops etc. we accommodate different command structures 227 * iwl_hcmd_utils_ops etc. we accommodate different command structures
227 * and flows between hardware versions (4965/5000) as well as their API 228 * and flows between hardware versions (4965/5000) as well as their API
228 * versions. 229 * versions.
230 *
229 */ 231 */
230struct iwl_cfg { 232struct iwl_cfg {
231 const char *name; 233 const char *name;
@@ -242,6 +244,7 @@ struct iwl_cfg {
242 u8 valid_rx_ant; 244 u8 valid_rx_ant;
243 bool need_pll_cfg; 245 bool need_pll_cfg;
244 bool use_isr_legacy; 246 bool use_isr_legacy;
247 enum iwl_pa_type pa_type;
245}; 248};
246 249
247/*************************** 250/***************************
diff --git a/drivers/net/wireless/iwlwifi/iwl-csr.h b/drivers/net/wireless/iwlwifi/iwl-csr.h
index f03dae1b2f36..06437d13e73e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/iwlwifi/iwl-csr.h
@@ -91,7 +91,8 @@
91#define CSR_EEPROM_GP (CSR_BASE+0x030) 91#define CSR_EEPROM_GP (CSR_BASE+0x030)
92#define CSR_OTP_GP_REG (CSR_BASE+0x034) 92#define CSR_OTP_GP_REG (CSR_BASE+0x034)
93#define CSR_GIO_REG (CSR_BASE+0x03C) 93#define CSR_GIO_REG (CSR_BASE+0x03C)
94#define CSR_GP_UCODE (CSR_BASE+0x044) 94#define CSR_GP_UCODE_REG (CSR_BASE+0x048)
95#define CSR_GP_DRIVER_REG (CSR_BASE+0x050)
95#define CSR_UCODE_DRV_GP1 (CSR_BASE+0x054) 96#define CSR_UCODE_DRV_GP1 (CSR_BASE+0x054)
96#define CSR_UCODE_DRV_GP1_SET (CSR_BASE+0x058) 97#define CSR_UCODE_DRV_GP1_SET (CSR_BASE+0x058)
97#define CSR_UCODE_DRV_GP1_CLR (CSR_BASE+0x05c) 98#define CSR_UCODE_DRV_GP1_CLR (CSR_BASE+0x05c)
@@ -245,6 +246,13 @@
245#define CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED (0x00000004) 246#define CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED (0x00000004)
246#define CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT (0x00000008) 247#define CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT (0x00000008)
247 248
249/* GP Driver */
250#define CSR_GP_DRIVER_REG_BIT_RADIO_SKU_MSK (0x00000003)
251#define CSR_GP_DRIVER_REG_BIT_RADIO_SKU_3x3_HYB (0x00000000)
252#define CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_HYB (0x00000001)
253#define CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA (0x00000002)
254
255
248/* GI Chicken Bits */ 256/* GI Chicken Bits */
249#define CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX (0x00800000) 257#define CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX (0x00800000)
250#define CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER (0x20000000) 258#define CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER (0x20000000)
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 0ee3ad245697..335a8f34bc51 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -57,7 +57,8 @@ extern struct iwl_cfg iwl5100_bg_cfg;
57extern struct iwl_cfg iwl5100_abg_cfg; 57extern struct iwl_cfg iwl5100_abg_cfg;
58extern struct iwl_cfg iwl5150_agn_cfg; 58extern struct iwl_cfg iwl5150_agn_cfg;
59extern struct iwl_cfg iwl6000_2ag_cfg; 59extern struct iwl_cfg iwl6000_2ag_cfg;
60extern struct iwl_cfg iwl6000_2agn_cfg; 60extern struct iwl_cfg iwl6000h_2agn_cfg;
61extern struct iwl_cfg iwl6000i_2agn_cfg;
61extern struct iwl_cfg iwl6000_3agn_cfg; 62extern struct iwl_cfg iwl6000_3agn_cfg;
62extern struct iwl_cfg iwl6050_2agn_cfg; 63extern struct iwl_cfg iwl6050_2agn_cfg;
63extern struct iwl_cfg iwl6050_3agn_cfg; 64extern struct iwl_cfg iwl6050_3agn_cfg;
@@ -888,6 +889,19 @@ enum iwl_nvm_type {
888 NVM_DEVICE_TYPE_OTP, 889 NVM_DEVICE_TYPE_OTP,
889}; 890};
890 891
892
893/**
894 * enum iwl_pa_type - Power Amplifier type
895 * @IWL_PA_SYSTEM: based on uCode configuration
896 * @IWL_PA_HYBRID: use both Internal and external PA
897 * @IWL_PA_INTERNAL: use Internal only
898 */
899enum iwl_pa_type {
900 IWL_PA_SYSTEM = 0,
901 IWL_PA_HYBRID = 1,
902 IWL_PA_INTERNAL = 2,
903};
904
891/* interrupt statistics */ 905/* interrupt statistics */
892struct isr_statistics { 906struct isr_statistics {
893 u32 hw; 907 u32 hw;