diff options
| author | msaitoh <msaitoh@NetBSD.org> | 2021-12-16 10:48:49 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 2021-12-16 10:48:49 +0000 |
| commit | 885598521f07e66d6dd00879d4b6701ed03dbdc8 (patch) | |
| tree | 08f63c8ac0ff35bdc2e3d04aac7f41083ee19fd5 /sys/dev | |
| parent | 7f28aab15e68a1c98c9897e59d6484f52e8983e2 (diff) | |
Print NVM image version on 82598.
FreeBSD ix-3.3.29 added code to decode NVM version. On 82598, the NVM
offset is NVM_EEP_OFFSET_82598(== 0x2a). My own three different 82598
cards' value in NVM_EEP_OFFSET_82598 are 0xffff. Instead, the dev starter
version (0x29) has the value. Two of them have 0x1070 and another has 0x2090.
The 82598 specification update notes about 2.9.0.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pci/ixgbe/ixgbe.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/pci/ixgbe/ixgbe.c b/sys/dev/pci/ixgbe/ixgbe.c index 7559d12bd53..86e73fbf589 100644 --- a/sys/dev/pci/ixgbe/ixgbe.c +++ b/sys/dev/pci/ixgbe/ixgbe.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.299 2021/12/15 08:42:48 msaitoh Exp $ */ +/* $NetBSD: ixgbe.c,v 1.300 2021/12/16 10:48:49 msaitoh Exp $ */ /****************************************************************************** @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.299 2021/12/15 08:42:48 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.300 2021/12/16 10:48:49 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1020,6 +1020,23 @@ ixgbe_attach(device_t parent, device_t dev, void *aux) /* NVM Image Version */ high = low = 0; switch (hw->mac.type) { + case ixgbe_mac_82598EB: + /* + * Print version from the dev starter version (0x29). The + * location is the same as newer device's IXGBE_NVM_MAP_VER. + */ + hw->eeprom.ops.read(hw, IXGBE_NVM_MAP_VER, &nvmreg); + if (nvmreg == 0xffff) + break; + high = (nvmreg >> 12) & 0x0f; + low = (nvmreg >> 4) & 0xff; + id = nvmreg & 0x0f; + /* + * The following output might not be correct. Some 82598 cards + * have 0x1070 or 0x2090. 82598 spec update notes about 2.9.0. + */ + aprint_normal(" NVM Image Version %u.%u.%u,", high, low, id); + break; case ixgbe_mac_X540: case ixgbe_mac_X550EM_a: hw->eeprom.ops.read(hw, IXGBE_NVM_IMAGE_VER, &nvmreg); |
