[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1332507320-19902-1-git-send-email-richard.alpe@ericsson.com>
Date: Fri, 23 Mar 2012 13:55:20 +0100
From: Richard Alpe <richard.alpe@...csson.com>
To: <jeffrey.t.kirsher@...el.com>, <jesse.brandeburg@...el.com>,
<bruce.w.allan@...el.com>, <carolyn.wyborny@...el.com>,
<donald.c.skidmore@...el.com>, <gregory.v.rose@...el.com>,
<peter.p.waskiewicz.jr@...el.com>, <alexander.h.duyck@...el.com>,
<john.ronciak@...el.com>, <e1000-devel@...ts.sourceforge.net>,
<netdev@...r.kernel.org>
CC: <linux-kernel@...r.kernel.org>,
Richard Alpe <richard.alpe@...csson.com>
Subject: [PATCH] e1000e: clear REQ and GNT in EECD (82571 && 82572)
Clear the REQ and GNT bit in the eeprom control register (EECD).
This is required if the eeprom is to be accessed with auto read
EERD register.
After a cold reset this doesn't matter but if PBIST MAC test was
executed before booting, the register was left in a dirty state
(the 2 bits where set), which caused the read operation to time out
and returning 0.
Reference (page 312):
http://download.intel.com/design/network/manuals/316080.pdf
Reported-by: Aleksandar Igic <aleksandar.igic@...tech.com.au>
Signed-off-by: Richard Alpe <richard.alpe@...csson.com>
---
drivers/net/ethernet/intel/e1000e/82571.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index b3fdc69..51f7d2e 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1001,6 +1001,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
{
u32 ctrl, ctrl_ext;
+ u32 ctrl, ctrl_ext, eecd;
s32 ret_val;
/*
@@ -1099,6 +1100,16 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
if (hw->phy.media_type == e1000_media_type_internal_serdes)
hw->mac.serdes_link_state = e1000_serdes_link_down;
+ /*
+ * 82571 and 82572 need EEC.EE_REQ and EEC.EE_GNT cleared
+ * when using EERD to access the EEPROM
+ */
+ if ((hw->mac.type == e1000_82571) || (hw->mac.type == e1000_82572)) {
+ eecd = er32(EECD);
+ eecd &= ~(E1000_EECD_REQ | E1000_EECD_GNT);
+ ew32(EECD, eecd);
+ }
+
return 0;
}
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists