Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Print NVM image version on 82598.



details:   https://anonhg.NetBSD.org/src/rev/e3b0417c8185
branches:  trunk
changeset: 1027700:e3b0417c8185
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Dec 16 10:48:49 2021 +0000

description:
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:

 sys/dev/pci/ixgbe/ixgbe.c |  21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r 45df70d49745 -r e3b0417c8185 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Thu Dec 16 09:38:54 2021 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Thu Dec 16 10:48:49 2021 +0000
@@ -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 @@
        /* 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);



Home | Main Index | Thread Index | Old Index