提交 e455ecaf 编写于 作者: S Sara Sharon 提交者: Greg Kroah-Hartman

iwlwifi: pcie: read correct prph address for newer devices

[ Upstream commit 84fb372c892e231e9a2ffdaa5c2df52d94aa536c ]

For newer devices we have higher range of periphery
addresses. Currently it is masked out, so we end up
reading another address.
Signed-off-by: NSara Sharon <sara.sharon@intel.com>
Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 c5eafde0
...@@ -1830,18 +1830,30 @@ static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs) ...@@ -1830,18 +1830,30 @@ static u32 iwl_trans_pcie_read32(struct iwl_trans *trans, u32 ofs)
return readl(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs); return readl(IWL_TRANS_GET_PCIE_TRANS(trans)->hw_base + ofs);
} }
static u32 iwl_trans_pcie_prph_msk(struct iwl_trans *trans)
{
if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560)
return 0x00FFFFFF;
else
return 0x000FFFFF;
}
static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg) static u32 iwl_trans_pcie_read_prph(struct iwl_trans *trans, u32 reg)
{ {
u32 mask = iwl_trans_pcie_prph_msk(trans);
iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR, iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_RADDR,
((reg & 0x000FFFFF) | (3 << 24))); ((reg & mask) | (3 << 24)));
return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT); return iwl_trans_pcie_read32(trans, HBUS_TARG_PRPH_RDAT);
} }
static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr, static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr,
u32 val) u32 val)
{ {
u32 mask = iwl_trans_pcie_prph_msk(trans);
iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR, iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WADDR,
((addr & 0x000FFFFF) | (3 << 24))); ((addr & mask) | (3 << 24)));
iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val); iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册