diff options
author | Alexander Bondar <alexander.bondar@intel.com> | 2014-02-18 10:45:00 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-03-09 13:16:39 -0400 |
commit | a812cba9bb141225ce28a48b60038e115620bccd (patch) | |
tree | 6294679a060230f8dd66dae2fc190c2e4273f575 /drivers/net/wireless/iwlwifi/iwl-io.h | |
parent | 8ea0c68fe56983f40256d0407ecf19530fd31442 (diff) |
iwlwifi: pcie: enable LP XTAL to reduce power consumption
1. Enable LP XTAL to avoid HW bug where device may consume much
power if FW is not loaded after device reset. LP XTAL is
disabled by default after device HW reset. Configure device's
"persistence" mode to avoid resetting XTAL again when SHRD_HW_RST
occurs in S3.
2. Add methods to access SHR (shared block memory space) directly from PCI
bus w/o need to power up MAC HW.
Shared internal registers (e.g. SHR_APMG_GP1, SHR_APMG_XTAL_CFG)can be
accessed directly from PCI bus through SHR arbiter even when MAC HW is
powered down. This is possible due to indirect read/write via
HEEP_CTRL_WRD_PCIEX_CTRL (0xEC) and HEEP_CTRL_WRD_PCIEX_DATA (0xF4)
registers.
Use iwl_write32()/iwl_read32() family to access these registers. The MAC HW
need not be powered up so no "grab inc access" is required.
For example, to read from SHR_APMG_GP1 register (0x1DC),
first, write to the control register:
HEEP_CTRL_WRD_PCIEX_CTRL[15:0] = 0x1DC (offset of the SHR_APMG_GP1 register)
HEEP_CTRL_WRD_PCIEX_CTRL[29:28] = 2 (read access)
second, read from the data register HEEP_CTRL_WRD_PCIEX_DATA[31:0].
To write the register, first, write to the data register
HEEP_CTRL_WRD_PCIEX_DATA[31:0] and then:
HEEP_CTRL_WRD_PCIEX_CTRL[15:0] = 0x1DC (offset of the SHR_APMG_GP1 register)
HEEP_CTRL_WRD_PCIEX_CTRL[29:28] = 3 (write access)
Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-io.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-io.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-io.h b/drivers/net/wireless/iwlwifi/iwl-io.h index 9e81b23d738b..665ddd9dbbc4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-io.h +++ b/drivers/net/wireless/iwlwifi/iwl-io.h | |||
@@ -70,7 +70,9 @@ u32 iwl_read_direct32(struct iwl_trans *trans, u32 reg); | |||
70 | void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value); | 70 | void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value); |
71 | 71 | ||
72 | 72 | ||
73 | u32 __iwl_read_prph(struct iwl_trans *trans, u32 ofs); | ||
73 | u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs); | 74 | u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs); |
75 | void __iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val); | ||
74 | void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val); | 76 | void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val); |
75 | int iwl_poll_prph_bit(struct iwl_trans *trans, u32 addr, | 77 | int iwl_poll_prph_bit(struct iwl_trans *trans, u32 addr, |
76 | u32 bits, u32 mask, int timeout); | 78 | u32 bits, u32 mask, int timeout); |