提交 f8701fe3 编写于 作者: R Reinette Chatre 提交者: John W. Linville

iwlwifi: power up all devices for EEPROM read

Recent commits "iwlwifi: remove power-wasting calls to apm_ops.init()" and
"iwlagn: power up device before initializing EEPROM" had the goal of
reducing device power consumption from the time the module is loaded until
the interface is brought up and the device's power saving mechanisms kick
in. The idea is that once the module is loaded there is no need for the
device to consume power until the interface is brought up.

With the current solution the device is only powered up during EEPROM read,
and then so also only if the EEPROM type is OTP. We have found that on
certain platforms even non-OTP devices require power to be up during EEPROM
read. On these platforms the driver never loads and the system log contains
the following:

iwlagn 0000:03:00.0: MAC is in deep sleep!.  CSR_GP_CNTRL = 0x080403D8

We thus now power up all devices during EEPROM read.
Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 64a76b50
...@@ -77,8 +77,7 @@ ...@@ -77,8 +77,7 @@
* The MAC (uCode processor, etc.) does not need to be powered up for accessing * The MAC (uCode processor, etc.) does not need to be powered up for accessing
* the CSR registers. * the CSR registers.
* *
* NOTE: Newer devices using one-time-programmable (OTP) memory * NOTE: Device does need to be awake in order to read this memory
* require device to be awake in order to read this memory
* via CSR_EEPROM and CSR_OTP registers * via CSR_EEPROM and CSR_OTP registers
*/ */
#define CSR_BASE (0x000) #define CSR_BASE (0x000)
...@@ -111,9 +110,8 @@ ...@@ -111,9 +110,8 @@
/* /*
* EEPROM and OTP (one-time-programmable) memory reads * EEPROM and OTP (one-time-programmable) memory reads
* *
* NOTE: For (newer) devices using OTP, device must be awake, initialized via * NOTE: Device must be awake, initialized via apm_ops.init(),
* apm_ops.init() in order to read. Older devices (3945/4965/5000) * in order to read.
* use EEPROM and do not require this.
*/ */
#define CSR_EEPROM_REG (CSR_BASE+0x02c) #define CSR_EEPROM_REG (CSR_BASE+0x02c)
#define CSR_EEPROM_GP (CSR_BASE+0x030) #define CSR_EEPROM_GP (CSR_BASE+0x030)
......
...@@ -518,10 +518,7 @@ int iwl_eeprom_init(struct iwl_priv *priv) ...@@ -518,10 +518,7 @@ int iwl_eeprom_init(struct iwl_priv *priv)
} }
e = (u16 *)priv->eeprom; e = (u16 *)priv->eeprom;
if (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) { priv->cfg->ops->lib->apm_ops.init(priv);
/* OTP reads require powered-up chip */
priv->cfg->ops->lib->apm_ops.init(priv);
}
ret = priv->cfg->ops->lib->eeprom_ops.verify_signature(priv); ret = priv->cfg->ops->lib->eeprom_ops.verify_signature(priv);
if (ret < 0) { if (ret < 0) {
...@@ -570,13 +567,6 @@ int iwl_eeprom_init(struct iwl_priv *priv) ...@@ -570,13 +567,6 @@ int iwl_eeprom_init(struct iwl_priv *priv)
e[cache_addr / 2] = eeprom_data; e[cache_addr / 2] = eeprom_data;
cache_addr += sizeof(u16); cache_addr += sizeof(u16);
} }
/*
* Now that OTP reads are complete, reset chip to save
* power until we load uCode during "up".
*/
priv->cfg->ops->lib->apm_ops.stop(priv);
} else { } else {
/* eeprom is an array of 16bit values */ /* eeprom is an array of 16bit values */
for (addr = 0; addr < sz; addr += sizeof(u16)) { for (addr = 0; addr < sz; addr += sizeof(u16)) {
...@@ -603,6 +593,8 @@ int iwl_eeprom_init(struct iwl_priv *priv) ...@@ -603,6 +593,8 @@ int iwl_eeprom_init(struct iwl_priv *priv)
err: err:
if (ret) if (ret)
iwl_eeprom_free(priv); iwl_eeprom_free(priv);
/* Reset chip to save power until we load uCode during "up". */
priv->cfg->ops->lib->apm_ops.stop(priv);
alloc_err: alloc_err:
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册