Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tg3: Add version reporting for hardware selfboot

This patch adds version reporting for hardware selfboot.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Matt Carlson and committed by
David S. Miller
a6f6cb1c 7fd76445

+24
+18
drivers/net/tg3.c
··· 11509 11509 } 11510 11510 } 11511 11511 11512 + static void __devinit tg3_read_hwsb_ver(struct tg3 *tp) 11513 + { 11514 + u32 val, major, minor; 11515 + 11516 + /* Use native endian representation */ 11517 + if (tg3_nvram_read(tp, TG3_NVM_HWSB_CFG1, &val)) 11518 + return; 11519 + 11520 + major = (val & TG3_NVM_HWSB_CFG1_MAJMSK) >> 11521 + TG3_NVM_HWSB_CFG1_MAJSFT; 11522 + minor = (val & TG3_NVM_HWSB_CFG1_MINMSK) >> 11523 + TG3_NVM_HWSB_CFG1_MINSFT; 11524 + 11525 + snprintf(&tp->fw_ver[0], 32, "sb v%d.%02d", major, minor); 11526 + } 11527 + 11512 11528 static void __devinit tg3_read_sb_ver(struct tg3 *tp, u32 val) 11513 11529 { 11514 11530 u32 offset, major, minor, build; ··· 11661 11645 tg3_read_bc_ver(tp); 11662 11646 else if ((val & TG3_EEPROM_MAGIC_FW_MSK) == TG3_EEPROM_MAGIC_FW) 11663 11647 tg3_read_sb_ver(tp, val); 11648 + else if ((val & TG3_EEPROM_MAGIC_HW_MSK) == TG3_EEPROM_MAGIC_HW) 11649 + tg3_read_hwsb_ver(tp); 11664 11650 else 11665 11651 return; 11666 11652
+6
drivers/net/tg3.h
··· 1719 1719 1720 1720 #define TG3_OTP_DEFAULT 0x286c1640 1721 1721 1722 + /* Hardware Selfboot NVRAM layout */ 1723 + #define TG3_NVM_HWSB_CFG1 0x00000004 1724 + #define TG3_NVM_HWSB_CFG1_MAJMSK 0xf8000000 1725 + #define TG3_NVM_HWSB_CFG1_MAJSFT 27 1726 + #define TG3_NVM_HWSB_CFG1_MINMSK 0x07c00000 1727 + #define TG3_NVM_HWSB_CFG1_MINSFT 22 1722 1728 1723 1729 #define TG3_EEPROM_MAGIC 0x669955aa 1724 1730 #define TG3_EEPROM_MAGIC_FW 0xa5000000