From patchwork Tue Apr 14 17:21:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Carlson X-Patchwork-Id: 18169 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3EHM7qw020051 for ; Tue, 14 Apr 2009 17:22:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756259AbZDNRVj (ORCPT ); Tue, 14 Apr 2009 13:21:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756430AbZDNRVi (ORCPT ); Tue, 14 Apr 2009 13:21:38 -0400 Received: from mms2.broadcom.com ([216.31.210.18]:2139 "EHLO mms2.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753937AbZDNRVh (ORCPT ); Tue, 14 Apr 2009 13:21:37 -0400 Received: from [10.11.16.99] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Tue, 14 Apr 2009 10:21:25 -0700 X-Server-Uuid: D3C04415-6FA8-4F2C-93C1-920E106A2031 Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id 0F1382C1; Tue, 14 Apr 2009 10:21:25 -0700 (PDT) Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.11.18.52]) by mail-irva-10.broadcom.com (Postfix) with ESMTP id ED78F2B0; Tue, 14 Apr 2009 10:21:24 -0700 (PDT) Received: from mail-irva-13.broadcom.com (mail-irva-13.broadcom.com [10.11.16.103]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP id HPM95037; Tue, 14 Apr 2009 10:21:23 -0700 (PDT) Received: from xw6200 (mcarlson [10.12.148.101]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 19A1474D04; Tue, 14 Apr 2009 10:21:23 -0700 (PDT) Date: Tue, 14 Apr 2009 10:21:23 -0700 From: "Matt Carlson" To: "Robin Holt" , "James Bottomley" cc: "Michael Chan" , netdev@vger.kernel.org, "Parisc List" Subject: SEEPROM test patch Message-ID: <20090414172123.GA12319@xw6200.broadcom.net> MIME-Version: 1.0 User-Agent: Mutt/1.5.16 (2007-06-09) X-WSS-ID: 65FA199F3D421382064-01-01 Content-Disposition: inline Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org 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. --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);