From: Richard Alpe <richard.alpe@ericsson.com>
To: <jeffrey.t.kirsher@intel.com>, <jesse.brandeburg@intel.com>,
<bruce.w.allan@intel.com>, <carolyn.wyborny@intel.com>,
<donald.c.skidmore@intel.com>, <gregory.v.rose@intel.com>,
<peter.p.waskiewicz.jr@intel.com>, <alexander.h.duyck@intel.com>,
<john.ronciak@intel.com>, <e1000-devel@lists.sourceforge.net>,
<netdev@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, Richard Alpe <richard.alpe@ericsson.com>
Subject: [PATCH] e1000e: clear REQ and GNT in EECD (82571 && 82572)
Date: Fri, 23 Mar 2012 13:55:20 +0100 [thread overview]
Message-ID: <1332507320-19902-1-git-send-email-richard.alpe@ericsson.com> (raw)
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@dektech.com.au>
Signed-off-by: Richard Alpe <richard.alpe@ericsson.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
next reply other threads:[~2012-03-23 12:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-23 12:55 Richard Alpe [this message]
2012-03-24 9:13 ` [PATCH] e1000e: clear REQ and GNT in EECD (82571 && 82572) Jeff Kirsher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1332507320-19902-1-git-send-email-richard.alpe@ericsson.com \
--to=richard.alpe@ericsson.com \
--cc=alexander.h.duyck@intel.com \
--cc=bruce.w.allan@intel.com \
--cc=carolyn.wyborny@intel.com \
--cc=donald.c.skidmore@intel.com \
--cc=e1000-devel@lists.sourceforge.net \
--cc=gregory.v.rose@intel.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=john.ronciak@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).