diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-05-29 04:34:56 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-03 15:00:20 -0400 |
commit | 8f0618914e02c62c5cf2482f8acc7eb8e9afb816 (patch) | |
tree | e964a5a4ed139fcbc96c766a328686525f0008c5 | |
parent | 885ba202cabd90b8ade1fe59185dc96ed4d69e02 (diff) |
iwlwifi: setup correctly L1 L0S pi link values
This patch setups L1 L0S pci link values.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-hw.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-csr.h | 6 |
4 files changed, 39 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h index ee55b283226b..fc118335b60f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h | |||
@@ -100,9 +100,14 @@ | |||
100 | 100 | ||
101 | #include "iwl-commands.h" | 101 | #include "iwl-commands.h" |
102 | 102 | ||
103 | #define PCI_LINK_CTRL 0x0F0 | 103 | /* PCI registers */ |
104 | #define PCI_LINK_CTRL 0x0F0 /* 1 byte */ | ||
104 | #define PCI_POWER_SOURCE 0x0C8 | 105 | #define PCI_POWER_SOURCE 0x0C8 |
105 | #define PCI_REG_WUM8 0x0E8 | 106 | #define PCI_REG_WUM8 0x0E8 |
107 | |||
108 | /* PCI register values */ | ||
109 | #define PCI_LINK_VAL_L0S_EN 0x01 | ||
110 | #define PCI_LINK_VAL_L1_EN 0x02 | ||
106 | #define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT (0x80000000) | 111 | #define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT (0x80000000) |
107 | 112 | ||
108 | #define TFD_QUEUE_SIZE_MAX (256) | 113 | #define TFD_QUEUE_SIZE_MAX (256) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index d548bda1ff72..bf0bd4af10c8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -496,6 +496,10 @@ static int iwl4965_apm_init(struct iwl_priv *priv) | |||
496 | iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, | 496 | iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, |
497 | CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); | 497 | CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); |
498 | 498 | ||
499 | /* disable L0s without affecting L1 :don't wait for ICH L0s bug W/A) */ | ||
500 | iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, | ||
501 | CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX); | ||
502 | |||
499 | /* set "initialization complete" bit to move adapter | 503 | /* set "initialization complete" bit to move adapter |
500 | * D0U* --> D0A* state */ | 504 | * D0U* --> D0A* state */ |
501 | iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | 505 | iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); |
@@ -514,11 +518,12 @@ static int iwl4965_apm_init(struct iwl_priv *priv) | |||
514 | goto out; | 518 | goto out; |
515 | 519 | ||
516 | /* enable DMA */ | 520 | /* enable DMA */ |
517 | iwl_write_prph(priv, APMG_CLK_CTRL_REG, | 521 | iwl_write_prph(priv, APMG_CLK_CTRL_REG, APMG_CLK_VAL_DMA_CLK_RQT | |
518 | APMG_CLK_VAL_DMA_CLK_RQT | APMG_CLK_VAL_BSM_CLK_RQT); | 522 | APMG_CLK_VAL_BSM_CLK_RQT); |
519 | 523 | ||
520 | udelay(20); | 524 | udelay(20); |
521 | 525 | ||
526 | /* disable L1-Active */ | ||
522 | iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG, | 527 | iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG, |
523 | APMG_PCIDEV_STT_VAL_L1_ACT_DIS); | 528 | APMG_PCIDEV_STT_VAL_L1_ACT_DIS); |
524 | 529 | ||
@@ -546,8 +551,13 @@ static void iwl4965_nic_config(struct iwl_priv *priv) | |||
546 | 551 | ||
547 | pci_read_config_byte(priv->pci_dev, PCI_LINK_CTRL, &val_link); | 552 | pci_read_config_byte(priv->pci_dev, PCI_LINK_CTRL, &val_link); |
548 | 553 | ||
549 | /* disable L1 entry -- workaround for pre-B1 */ | 554 | /* L1 is enabled by BIOS */ |
550 | pci_write_config_byte(priv->pci_dev, PCI_LINK_CTRL, val_link & ~0x02); | 555 | if ((val_link & PCI_LINK_VAL_L1_EN) == PCI_LINK_VAL_L1_EN) |
556 | /* diable L0S disabled L1A enabled */ | ||
557 | iwl_set_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); | ||
558 | else | ||
559 | /* L0S enabled L1A disabled */ | ||
560 | iwl_clear_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); | ||
551 | 561 | ||
552 | radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); | 562 | radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); |
553 | 563 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 0355ccd2d296..b1c50453a7e7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -63,6 +63,10 @@ static int iwl5000_apm_init(struct iwl_priv *priv) | |||
63 | iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, | 63 | iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, |
64 | CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); | 64 | CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); |
65 | 65 | ||
66 | /* disable L0s without affecting L1 :don't wait for ICH L0s bug W/A) */ | ||
67 | iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, | ||
68 | CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX); | ||
69 | |||
66 | iwl_set_bit(priv, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL); | 70 | iwl_set_bit(priv, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL); |
67 | 71 | ||
68 | /* set "initialization complete" bit to move adapter | 72 | /* set "initialization complete" bit to move adapter |
@@ -83,13 +87,13 @@ static int iwl5000_apm_init(struct iwl_priv *priv) | |||
83 | return ret; | 87 | return ret; |
84 | 88 | ||
85 | /* enable DMA */ | 89 | /* enable DMA */ |
86 | iwl_write_prph(priv, APMG_CLK_EN_REG, | 90 | iwl_write_prph(priv, APMG_CLK_EN_REG, APMG_CLK_VAL_DMA_CLK_RQT); |
87 | APMG_CLK_VAL_DMA_CLK_RQT); | ||
88 | 91 | ||
89 | udelay(20); | 92 | udelay(20); |
90 | 93 | ||
94 | /* disable L1-Active */ | ||
91 | iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG, | 95 | iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG, |
92 | APMG_PCIDEV_STT_VAL_L1_ACT_DIS); | 96 | APMG_PCIDEV_STT_VAL_L1_ACT_DIS); |
93 | 97 | ||
94 | iwl_release_nic_access(priv); | 98 | iwl_release_nic_access(priv); |
95 | 99 | ||
@@ -106,8 +110,13 @@ static void iwl5000_nic_config(struct iwl_priv *priv) | |||
106 | 110 | ||
107 | pci_read_config_byte(priv->pci_dev, PCI_LINK_CTRL, &val_link); | 111 | pci_read_config_byte(priv->pci_dev, PCI_LINK_CTRL, &val_link); |
108 | 112 | ||
109 | /* disable L1 entry -- workaround for pre-B1 */ | 113 | /* L1 is enabled by BIOS */ |
110 | pci_write_config_byte(priv->pci_dev, PCI_LINK_CTRL, val_link & ~0x02); | 114 | if ((val_link & PCI_LINK_VAL_L1_EN) == PCI_LINK_VAL_L1_EN) |
115 | /* diable L0S disabled L1A enabled */ | ||
116 | iwl_set_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); | ||
117 | else | ||
118 | /* L0S enabled L1A disabled */ | ||
119 | iwl_clear_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); | ||
111 | 120 | ||
112 | radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); | 121 | radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); |
113 | 122 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-csr.h b/drivers/net/wireless/iwlwifi/iwl-csr.h index 9d6e5d2072d2..545ed692d889 100644 --- a/drivers/net/wireless/iwlwifi/iwl-csr.h +++ b/drivers/net/wireless/iwlwifi/iwl-csr.h | |||
@@ -87,13 +87,14 @@ | |||
87 | /* EEPROM reads */ | 87 | /* EEPROM reads */ |
88 | #define CSR_EEPROM_REG (CSR_BASE+0x02c) | 88 | #define CSR_EEPROM_REG (CSR_BASE+0x02c) |
89 | #define CSR_EEPROM_GP (CSR_BASE+0x030) | 89 | #define CSR_EEPROM_GP (CSR_BASE+0x030) |
90 | #define CSR_GIO_REG (CSR_BASE+0x03C) | ||
90 | #define CSR_GP_UCODE (CSR_BASE+0x044) | 91 | #define CSR_GP_UCODE (CSR_BASE+0x044) |
91 | #define CSR_UCODE_DRV_GP1 (CSR_BASE+0x054) | 92 | #define CSR_UCODE_DRV_GP1 (CSR_BASE+0x054) |
92 | #define CSR_UCODE_DRV_GP1_SET (CSR_BASE+0x058) | 93 | #define CSR_UCODE_DRV_GP1_SET (CSR_BASE+0x058) |
93 | #define CSR_UCODE_DRV_GP1_CLR (CSR_BASE+0x05c) | 94 | #define CSR_UCODE_DRV_GP1_CLR (CSR_BASE+0x05c) |
94 | #define CSR_UCODE_DRV_GP2 (CSR_BASE+0x060) | 95 | #define CSR_UCODE_DRV_GP2 (CSR_BASE+0x060) |
95 | #define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100) | ||
96 | #define CSR_LED_REG (CSR_BASE+0x094) | 96 | #define CSR_LED_REG (CSR_BASE+0x094) |
97 | #define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100) | ||
97 | 98 | ||
98 | /* Analog phase-lock-loop configuration */ | 99 | /* Analog phase-lock-loop configuration */ |
99 | #define CSR_ANA_PLL_CFG (CSR_BASE+0x20c) | 100 | #define CSR_ANA_PLL_CFG (CSR_BASE+0x20c) |
@@ -213,6 +214,9 @@ | |||
213 | #define CSR_EEPROM_GP_BAD_SIGNATURE (0x00000000) | 214 | #define CSR_EEPROM_GP_BAD_SIGNATURE (0x00000000) |
214 | #define CSR_EEPROM_GP_IF_OWNER_MSK (0x00000180) | 215 | #define CSR_EEPROM_GP_IF_OWNER_MSK (0x00000180) |
215 | 216 | ||
217 | /* CSR GIO */ | ||
218 | #define CSR_GIO_REG_VAL_L0S_ENABLED (0x00000002) | ||
219 | |||
216 | /* UCODE DRV GP */ | 220 | /* UCODE DRV GP */ |
217 | #define CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP (0x00000001) | 221 | #define CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP (0x00000001) |
218 | #define CSR_UCODE_SW_BIT_RFKILL (0x00000002) | 222 | #define CSR_UCODE_SW_BIT_RFKILL (0x00000002) |