netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matt Carlson" <mcarlson@broadcom.com>
To: "Robin Holt" <holt@sgi.com>,
	"James Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: "Michael Chan" <mchan@broadcom.com>,
	netdev@vger.kernel.org,
	"Parisc List" <linux-parisc@vger.kernel.org>
Subject: SEEPROM test patch
Date: Tue, 14 Apr 2009 10:21:23 -0700	[thread overview]
Message-ID: <20090414172123.GA12319@xw6200.broadcom.net> (raw)

James, Robin.  I looked through the patches again and found that the
SEEPROM routines were not being adjusted correctly along with the flash
NVRAM access routines.  The patch below should shore up the difference.
The patch works on both BE and LE systems.

Can you apply the patch below and see if it fixes your problem?  (You
may have to back out David's changes for the mac addresses to be
restored, but 'eeprom -e' dumps should be fixed.)  If it does, I'll
post a replacement patch that documents why the code is doing what it's
doing.


diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 6a736dd..3ef43c2 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -2190,7 +2190,10 @@ static int tg3_nvram_read_using_eeprom(struct tg3 *tp,
 	if (!(tmp & EEPROM_ADDR_COMPLETE))
 		return -EBUSY;
 
-	*val = tr32(GRC_EEPROM_DATA);
+	tmp = tr32(GRC_EEPROM_DATA);
+
+	*val = swab32(tmp);
+
 	return 0;
 }
 
@@ -10657,13 +10660,13 @@ static int tg3_nvram_write_block_using_eeprom(struct tg3 *tp,
 
 	for (i = 0; i < len; i += 4) {
 		u32 addr;
-		__be32 data;
+		__le32 data;
 
 		addr = offset + i;
 
 		memcpy(&data, buf + i, 4);
 
-		tw32(GRC_EEPROM_DATA, be32_to_cpu(data));
+		tw32(GRC_EEPROM_DATA, le32_to_cpu(data));
 
 		val = tr32(GRC_EEPROM_ADDR);
 		tw32(GRC_EEPROM_ADDR, val | EEPROM_ADDR_COMPLETE);


             reply	other threads:[~2009-04-14 17:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 17:21 Matt Carlson [this message]
2009-04-14 17:44 ` SEEPROM test patch James Bottomley
2009-04-14 18:22   ` Robin Holt

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=20090414172123.GA12319@xw6200.broadcom.net \
    --to=mcarlson@broadcom.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=holt@sgi.com \
    --cc=linux-parisc@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /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).