Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134789
b: refs/heads/master
c: a6f6cb1
h: refs/heads/master
i:
  134787: 4e23e93
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Feb 27, 2009
1 parent 244623b commit 2b7ae48
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7fd764455a13f4d9b37c9b908f07d0758f11d3c5
refs/heads/master: a6f6cb1cf8ba54efdbbbf61b5b4345b0246da42f
18 changes: 18 additions & 0 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -11509,6 +11509,22 @@ static void __devinit tg3_read_bc_ver(struct tg3 *tp)
}
}

static void __devinit tg3_read_hwsb_ver(struct tg3 *tp)
{
u32 val, major, minor;

/* Use native endian representation */
if (tg3_nvram_read(tp, TG3_NVM_HWSB_CFG1, &val))
return;

major = (val & TG3_NVM_HWSB_CFG1_MAJMSK) >>
TG3_NVM_HWSB_CFG1_MAJSFT;
minor = (val & TG3_NVM_HWSB_CFG1_MINMSK) >>
TG3_NVM_HWSB_CFG1_MINSFT;

snprintf(&tp->fw_ver[0], 32, "sb v%d.%02d", major, minor);
}

static void __devinit tg3_read_sb_ver(struct tg3 *tp, u32 val)
{
u32 offset, major, minor, build;
Expand Down Expand Up @@ -11645,6 +11661,8 @@ static void __devinit tg3_read_fw_ver(struct tg3 *tp)
tg3_read_bc_ver(tp);
else if ((val & TG3_EEPROM_MAGIC_FW_MSK) == TG3_EEPROM_MAGIC_FW)
tg3_read_sb_ver(tp, val);
else if ((val & TG3_EEPROM_MAGIC_HW_MSK) == TG3_EEPROM_MAGIC_HW)
tg3_read_hwsb_ver(tp);
else
return;

Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/tg3.h
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,12 @@

#define TG3_OTP_DEFAULT 0x286c1640

/* Hardware Selfboot NVRAM layout */
#define TG3_NVM_HWSB_CFG1 0x00000004
#define TG3_NVM_HWSB_CFG1_MAJMSK 0xf8000000
#define TG3_NVM_HWSB_CFG1_MAJSFT 27
#define TG3_NVM_HWSB_CFG1_MINMSK 0x07c00000
#define TG3_NVM_HWSB_CFG1_MINSFT 22

#define TG3_EEPROM_MAGIC 0x669955aa
#define TG3_EEPROM_MAGIC_FW 0xa5000000
Expand Down

0 comments on commit 2b7ae48

Please sign in to comment.