Module Name:    src
Committed By:   martin
Date:           Wed Oct 18 14:41:55 UTC 2023

Modified Files:
        src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h if_wmvar.h pcidevs

Log Message:
Pull up the following, requested by msaitoh in ticket #1915:

        sys/dev/pci/pcidevs                     1.1497
        sys/dev/pci/if_wm.c                     1.689,1.790-1.791 via patch
        sys/dev/pci/if_wmreg.h                  1.120 via patch
        sys/dev/pci/if_wmvar.h                  1.51

- Use 12K for packet buffer for jumbo frame on PCH2 and newer.
- Add new workaround for Tiger Lake and newer to avoid packet loss.
- Add I219{V,LM}({22,23}) devices (Raptor Lake).


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.52 -r1.508.4.53 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.17 -r1.98.6.18 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.33.6.11 -r1.33.6.12 src/sys/dev/pci/if_wmvar.h
cvs rdiff -u -r1.1289.2.29 -r1.1289.2.30 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.52 src/sys/dev/pci/if_wm.c:1.508.4.53
--- src/sys/dev/pci/if_wm.c:1.508.4.52	Sun Oct  8 15:31:17 2023
+++ src/sys/dev/pci/if_wm.c	Wed Oct 18 14:41:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.52 2023/10/08 15:31:17 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.53 2023/10/18 14:41:54 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.52 2023/10/08 15:31:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.53 2023/10/18 14:41:54 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1713,25 +1713,31 @@ static const struct wm_product {
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM13,
 	  "I219 LM (13) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM14,
 	  "I219 LM (14) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM15,
 	  "I219 LM (15) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM16,
 	  "I219 LM (16) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM17,
 	  "I219 LM (17) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM18,
 	  "I219 LM (18) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM19,
 	  "I219 LM (19) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM22,
+	  "I219 LM (22) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM23,
+	  "I219 LM (23) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V,
 	  "I219 V Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
@@ -1767,25 +1773,31 @@ static const struct wm_product {
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V13,
 	  "I219 V (13) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V14,
 	  "I219 V (14) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V15,
 	  "I219 V (15) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V16,
 	  "I219 V (16) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V17,
 	  "I219 V (17) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V18,
 	  "I219 V (18) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V19,
 	  "I219 V (19) Ethernet Connection",
-	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V22,
+	  "I219 V (22) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V23,
+	  "I219 V (23) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */
 	{ 0,			0,
 	  NULL,
 	  0,			0 },
@@ -2282,7 +2294,8 @@ alloc_retry:
 		    && (sc->sc_type != WM_T_PCH2)
 		    && (sc->sc_type != WM_T_PCH_LPT)
 		    && (sc->sc_type != WM_T_PCH_SPT)
-		    && (sc->sc_type != WM_T_PCH_CNP)) {
+		    && (sc->sc_type != WM_T_PCH_CNP)
+		    && (sc->sc_type != WM_T_PCH_TGP)) {
 			/* ICH* and PCH* have no PCIe capability registers */
 			if (pci_get_capability(pa->pa_pc, pa->pa_tag,
 				PCI_CAP_PCIEXPRESS, &sc->sc_pcixe_capoff,
@@ -2527,6 +2540,7 @@ alloc_retry:
 		break;
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		sc->nvm.read = wm_nvm_read_spt;
 		/* SPT has no GFPREG; flash registers mapped through BAR0 */
 		sc->sc_flags |= WM_F_EEPROM_FLASH;
@@ -2654,6 +2668,7 @@ alloc_retry:
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		apme_mask = WUC_APME;
 		eeprom_data = CSR_READ(sc, WMREG_WUC);
 		if ((eeprom_data & apme_mask) != 0)
@@ -2788,6 +2803,7 @@ alloc_retry:
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		/* Already checked before wm_reset () */
 		apme_mask = eeprom_data = 0;
 		break;
@@ -2948,6 +2964,7 @@ alloc_retry:
 	    || sc->sc_type == WM_T_ICH10 || sc->sc_type == WM_T_PCH
 	    || sc->sc_type == WM_T_PCH2 || sc->sc_type == WM_T_PCH_LPT
 	    || sc->sc_type == WM_T_PCH_SPT || sc->sc_type == WM_T_PCH_CNP
+	    || sc->sc_type == WM_T_PCH_TGP
 	    || sc->sc_type == WM_T_82573
 	    || sc->sc_type == WM_T_82574 || sc->sc_type == WM_T_82583) {
 		/* Copper only */
@@ -3140,6 +3157,7 @@ alloc_retry:
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		/* XXX limited to 9234 */
 		sc->sc_ethercom.ec_capabilities |= ETHERCAP_JUMBO_MTU;
 		break;
@@ -4215,6 +4233,7 @@ wm_set_ral(struct wm_softc *sc, const ui
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		if (idx == 0) {
 			CSR_WRITE(sc, WMREG_CORDOVA_RAL(idx), ral_lo);
 			CSR_WRITE_FLUSH(sc);
@@ -4272,7 +4291,8 @@ wm_mchash(struct wm_softc *sc, const uin
 	if ((sc->sc_type == WM_T_ICH8) || (sc->sc_type == WM_T_ICH9)
 	    || (sc->sc_type == WM_T_ICH10) || (sc->sc_type == WM_T_PCH)
 	    || (sc->sc_type == WM_T_PCH2) || (sc->sc_type == WM_T_PCH_LPT)
-	    || (sc->sc_type == WM_T_PCH_SPT) || (sc->sc_type == WM_T_PCH_CNP)){
+	    || (sc->sc_type == WM_T_PCH_SPT) || (sc->sc_type == WM_T_PCH_CNP)
+	    || (sc->sc_type == WM_T_PCH_TGP)) {
 		hash = (enaddr[4] >> ich8_lo_shift[sc->sc_mchash_type]) |
 		    (((uint16_t)enaddr[5]) << ich8_hi_shift[sc->sc_mchash_type]);
 		return (hash & 0x3ff);
@@ -4307,6 +4327,7 @@ wm_rar_count(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		size = WM_RAL_TABSIZE_PCH_LPT;
 		break;
 	case WM_T_82575:
@@ -4369,8 +4390,8 @@ wm_set_filter(struct wm_softc *sc)
 	size = wm_rar_count(sc);
 	wm_set_ral(sc, CLLADDR(ifp->if_sadl), 0);
 
-	if ((sc->sc_type == WM_T_PCH_LPT) || (sc->sc_type == WM_T_PCH_SPT)
-	    || (sc->sc_type == WM_T_PCH_CNP)) {
+	if ((sc->sc_type == WM_T_PCH_LPT) || (sc->sc_type == WM_T_PCH_SPT) ||
+	    (sc->sc_type == WM_T_PCH_CNP) || (sc->sc_type == WM_T_PCH_TGP)) {
 		i = __SHIFTOUT(CSR_READ(sc, WMREG_FWSM), FWSM_WLOCK_MAC);
 		switch (i) {
 		case 0:
@@ -4395,7 +4416,8 @@ wm_set_filter(struct wm_softc *sc)
 	if ((sc->sc_type == WM_T_ICH8) || (sc->sc_type == WM_T_ICH9)
 	    || (sc->sc_type == WM_T_ICH10) || (sc->sc_type == WM_T_PCH)
 	    || (sc->sc_type == WM_T_PCH2) || (sc->sc_type == WM_T_PCH_LPT)
-	    || (sc->sc_type == WM_T_PCH_SPT) || (sc->sc_type == WM_T_PCH_CNP))
+	    || (sc->sc_type == WM_T_PCH_SPT) || (sc->sc_type == WM_T_PCH_CNP)
+	    || (sc->sc_type == WM_T_PCH_TGP))
 		size = WM_ICH8_MC_TABSIZE;
 	else
 		size = WM_MC_TABSIZE;
@@ -4429,7 +4451,8 @@ wm_set_filter(struct wm_softc *sc)
 		    || (sc->sc_type == WM_T_PCH2)
 		    || (sc->sc_type == WM_T_PCH_LPT)
 		    || (sc->sc_type == WM_T_PCH_SPT)
-		    || (sc->sc_type == WM_T_PCH_CNP))
+		    || (sc->sc_type == WM_T_PCH_CNP)
+		    || (sc->sc_type == WM_T_PCH_TGP))
 			reg &= 0x1f;
 		else
 			reg &= 0x7f;
@@ -4572,6 +4595,7 @@ wm_lan_init_done(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		for (i = 0; i < WM_ICH8_LAN_INIT_TIMEOUT; i++) {
 			reg = CSR_READ(sc, WMREG_STATUS);
 			if ((reg & STATUS_LAN_INIT_DONE) != 0)
@@ -4658,6 +4682,7 @@ wm_get_cfg_done(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		delay(10*1000);
 		if (sc->sc_type >= WM_T_ICH10)
 			wm_lan_init_done(sc);
@@ -4793,6 +4818,7 @@ wm_init_lcd_from_nvm(struct wm_softc *sc
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		sw_cfg_mask = FEXTNVM_SW_CONFIG_ICH8M;
 		break;
 	default:
@@ -5073,6 +5099,7 @@ wm_initialize_hardware_bits(struct wm_so
 		case WM_T_PCH_LPT:
 		case WM_T_PCH_SPT:
 		case WM_T_PCH_CNP:
+		case WM_T_PCH_TGP:
 			/* TARC0 */
 			if (sc->sc_type == WM_T_ICH8) {
 				/* Set TARC0 bits 29 and 28 */
@@ -5407,7 +5434,9 @@ wm_reset(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
-		sc->sc_pba = PBA_26K;
+	case WM_T_PCH_TGP:
+		sc->sc_pba = sc->sc_ethercom.ec_if.if_mtu > 1500 ?
+		    PBA_12K : PBA_26K;
 		break;
 	default:
 		sc->sc_pba = sc->sc_ethercom.ec_if.if_mtu > 8192 ?
@@ -5532,6 +5561,7 @@ wm_reset(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		reg = CSR_READ(sc, WMREG_CTRL) | CTRL_RST;
 		if (wm_phy_resetisblocked(sc) == false) {
 			/*
@@ -5678,6 +5708,7 @@ wm_reset(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		break;
 	default:
 		panic("%s: unknown type\n", __func__);
@@ -5726,7 +5757,8 @@ wm_reset(struct wm_softc *sc)
 	if ((sc->sc_type == WM_T_ICH8) || (sc->sc_type == WM_T_ICH9)
 	    || (sc->sc_type == WM_T_ICH10) || (sc->sc_type == WM_T_PCH)
 	    || (sc->sc_type == WM_T_PCH2) || (sc->sc_type == WM_T_PCH_LPT)
-	    || (sc->sc_type == WM_T_PCH_SPT) || (sc->sc_type == WM_T_PCH_CNP)){
+	    || (sc->sc_type == WM_T_PCH_SPT) || (sc->sc_type == WM_T_PCH_CNP)
+	    || (sc->sc_type == WM_T_PCH_TGP)) {
 		reg = CSR_READ(sc, WMREG_KABGTXD);
 		reg |= KABGTXD_BGSQLBIAS;
 		CSR_WRITE(sc, WMREG_KABGTXD, reg);
@@ -6917,6 +6949,13 @@ wm_init_locked(struct ifnet *ifp)
 		CSR_WRITE(sc, WMREG_GCR, reg);
 	}
 
+	/* Ungate DMA clock to avoid packet loss */
+	if (sc->sc_type >= WM_T_PCH_TGP) {
+		reg = CSR_READ(sc, WMREG_FFLT_DBG);
+		reg |= (1 << 12);
+		CSR_WRITE(sc, WMREG_FFLT_DBG, reg);
+	}
+
 	if ((sc->sc_type >= WM_T_ICH8)
 	    || (sc->sc_pcidevid == PCI_PRODUCT_INTEL_82546GB_QUAD_COPPER)
 	    || (sc->sc_pcidevid == PCI_PRODUCT_INTEL_82546GB_QUAD_COPPER_KSP3)) {
@@ -6989,7 +7028,8 @@ wm_init_locked(struct ifnet *ifp)
 	if ((sc->sc_type != WM_T_ICH8) && (sc->sc_type != WM_T_ICH9)
 	    && (sc->sc_type != WM_T_ICH10) && (sc->sc_type != WM_T_PCH)
 	    && (sc->sc_type != WM_T_PCH2) && (sc->sc_type != WM_T_PCH_LPT)
-	    && (sc->sc_type != WM_T_PCH_SPT) && (sc->sc_type != WM_T_PCH_CNP)){
+	    && (sc->sc_type != WM_T_PCH_SPT) && (sc->sc_type != WM_T_PCH_CNP)
+	    && (sc->sc_type != WM_T_PCH_TGP)) {
 		CSR_WRITE(sc, WMREG_FCAL, FCAL_CONST);
 		CSR_WRITE(sc, WMREG_FCAH, FCAH_CONST);
 		CSR_WRITE(sc, WMREG_FCT, ETHERTYPE_FLOWCONTROL);
@@ -7025,6 +7065,7 @@ wm_init_locked(struct ifnet *ifp)
 		case WM_T_PCH_LPT:
 		case WM_T_PCH_SPT:
 		case WM_T_PCH_CNP:
+		case WM_T_PCH_TGP:
 			/*
 			 * Set the mac to wait the maximum time between each
 			 * iteration and increase the max iterations when
@@ -7367,6 +7408,7 @@ wm_init_locked(struct ifnet *ifp)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		reg = CSR_READ(sc, WMREG_PBECCSTS);
 		reg |= PBECCSTS_UNCORR_ECC_ENABLE;
 		CSR_WRITE(sc, WMREG_PBECCSTS, reg);
@@ -11061,6 +11103,7 @@ wm_gmii_reset(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		/* Generic reset */
 		CSR_WRITE(sc, WMREG_CTRL, sc->sc_ctrl | CTRL_PHY_RESET);
 		CSR_WRITE_FLUSH(sc);
@@ -11120,6 +11163,7 @@ wm_gmii_reset(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		wm_phy_post_reset(sc);
 		break;
 	default:
@@ -11361,7 +11405,7 @@ wm_gmii_setup_phytype(struct wm_softc *s
 		new_readreg = wm_gmii_bm_readreg;
 		new_writereg = wm_gmii_bm_writereg;
 	}
-	if ((sc->sc_type >= WM_T_PCH) && (sc->sc_type <= WM_T_PCH_CNP)) {
+	if ((sc->sc_type >= WM_T_PCH) && (sc->sc_type <= WM_T_PCH_TGP)) {
 		/* All PCH* use _hv_ */
 		new_readreg = wm_gmii_hv_readreg;
 		new_writereg = wm_gmii_hv_writereg;
@@ -11480,7 +11524,7 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 	/* get PHY control from SMBus to PCIe */
 	if ((sc->sc_type == WM_T_PCH) || (sc->sc_type == WM_T_PCH2)
 	    || (sc->sc_type == WM_T_PCH_LPT) || (sc->sc_type == WM_T_PCH_SPT)
-	    || (sc->sc_type == WM_T_PCH_CNP))
+	    || (sc->sc_type == WM_T_PCH_CNP) || (sc->sc_type == WM_T_PCH_TGP))
 		wm_init_phy_workarounds_pchlan(sc);
 
 	wm_gmii_reset(sc);
@@ -11544,9 +11588,9 @@ wm_gmii_mediainit(struct wm_softc *sc, p
 	 * If the MAC is PCH2 or PCH_LPT and failed to detect MII PHY, call
 	 * wm_set_mdio_slow_mode_hv() for a workaround and retry.
 	 */
-	if (((sc->sc_type == WM_T_PCH2) || (sc->sc_type == WM_T_PCH_LPT)
-		|| (sc->sc_type == WM_T_PCH_SPT)
-		|| (sc->sc_type == WM_T_PCH_CNP))
+	if (((sc->sc_type == WM_T_PCH2) || (sc->sc_type == WM_T_PCH_LPT) ||
+		(sc->sc_type == WM_T_PCH_SPT) || (sc->sc_type == WM_T_PCH_CNP)
+		|| (sc->sc_type == WM_T_PCH_TGP))
 	    && (LIST_FIRST(&mii->mii_phys) == NULL)) {
 		wm_set_mdio_slow_mode_hv(sc);
 		mii_attach(sc->sc_dev, &sc->sc_mii, 0xffffffff, MII_PHY_ANY,
@@ -14068,6 +14112,7 @@ wm_nvm_valid_bank_detect_ich8lan(struct 
 	switch (sc->sc_type) {
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		bank1_offset = sc->sc_ich8_flash_bank_size * 2;
 		act_offset = ICH_NVM_SIG_WORD * 2;
 
@@ -14719,8 +14764,8 @@ wm_nvm_validate_checksum(struct wm_softc
 		return 0;
 
 #ifdef WM_DEBUG
-	if ((sc->sc_type == WM_T_PCH_LPT) || (sc->sc_type == WM_T_PCH_SPT)
-	    || (sc->sc_type == WM_T_PCH_CNP)) {
+	if ((sc->sc_type == WM_T_PCH_LPT) || (sc->sc_type == WM_T_PCH_SPT) ||
+	    (sc->sc_type == WM_T_PCH_CNP) || (sc->sc_type == WM_T_PCH_TGP)) {
 		csum_wordaddr = NVM_OFF_COMPAT;
 		valid_checksum = NVM_COMPAT_VALID_CHECKSUM;
 	} else {
@@ -14856,6 +14901,7 @@ wm_nvm_version(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		check_version = true;
 		have_build = true;
 		have_uid = false;
@@ -15501,6 +15547,7 @@ wm_check_mng_mode(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		rv = wm_check_mng_mode_ich8lan(sc);
 		break;
 	case WM_T_82574:
@@ -15621,6 +15668,7 @@ wm_phy_resetisblocked(struct wm_softc *s
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		do {
 			reg = CSR_READ(sc, WMREG_FWSM);
 			if ((reg & FWSM_RSPCIPHY) == 0) {
@@ -15739,6 +15787,7 @@ wm_init_phy_workarounds_pchlan(struct wm
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		if (wm_phy_is_accessible_pchlan(sc))
 			break;
 
@@ -15908,6 +15957,7 @@ wm_get_wakeup(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		sc->sc_flags |= WM_F_HAS_AMT;
 		sc->sc_flags |= WM_F_ASF_FIRMWARE_PRES;
 		break;
@@ -16341,7 +16391,8 @@ wm_enable_wakeup(struct wm_softc *sc)
 	if ((sc->sc_type == WM_T_ICH8) || (sc->sc_type == WM_T_ICH9) ||
 	    (sc->sc_type == WM_T_ICH10) || (sc->sc_type == WM_T_PCH) ||
 	    (sc->sc_type == WM_T_PCH2) || (sc->sc_type == WM_T_PCH_LPT) ||
-	    (sc->sc_type == WM_T_PCH_SPT) || (sc->sc_type == WM_T_PCH_CNP))
+	    (sc->sc_type == WM_T_PCH_SPT) || (sc->sc_type == WM_T_PCH_CNP) ||
+	    (sc->sc_type == WM_T_PCH_TGP))
 		wm_suspend_workarounds_ich8lan(sc);
 
 #if 0	/* For the multicast packet */
@@ -16486,6 +16537,7 @@ wm_lplu_d0_disable(struct wm_softc *sc)
 	case WM_T_PCH_LPT:
 	case WM_T_PCH_SPT:
 	case WM_T_PCH_CNP:
+	case WM_T_PCH_TGP:
 		reg = wm_gmii_hv_readreg(sc->sc_dev, 1, HV_OEM_BITS);
 		reg &= ~(HV_OEM_BITS_A1KDIS | HV_OEM_BITS_LPLU);
 		if (wm_phy_resetisblocked(sc) == false)
@@ -17355,7 +17407,7 @@ wm_legacy_irq_quirk_spt(struct wm_softc 
 	DPRINTF(sc, WM_DEBUG_INIT, ("%s: %s called\n",
 		device_xname(sc->sc_dev), __func__));
 	KASSERT((sc->sc_type == WM_T_PCH_SPT)
-	    || (sc->sc_type == WM_T_PCH_CNP));
+	    || (sc->sc_type == WM_T_PCH_CNP) || (sc->sc_type == WM_T_PCH_TGP));
 
 	reg = CSR_READ(sc, WMREG_FEXTNVM7);
 	reg |= FEXTNVM7_SIDE_CLK_UNGATE;

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.98.6.17 src/sys/dev/pci/if_wmreg.h:1.98.6.18
--- src/sys/dev/pci/if_wmreg.h:1.98.6.17	Tue Jun 27 18:36:53 2023
+++ src/sys/dev/pci/if_wmreg.h	Wed Oct 18 14:41:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.98.6.17 2023/06/27 18:36:53 martin Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.98.6.18 2023/10/18 14:41:54 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -1466,6 +1466,8 @@ struct livengood_tcpip_ctxdesc {
 #define	WMREG_FEXTNVM11	0x5bbc	/* Future Extended NVM 11 */
 #define	FEXTNVM11_DIS_MULRFIX	__BIT(13)	/* Disable MULR fix */
 
+#define	WMREG_FFLT_DBG	0x05F04 /* Debug Register */
+
 #define	WMREG_CRC_OFFSET 0x5f50
 
 #define	WMREG_B2OSPC	0x8fe0	/* BMC2OS packets sent by BMC */

Index: src/sys/dev/pci/if_wmvar.h
diff -u src/sys/dev/pci/if_wmvar.h:1.33.6.11 src/sys/dev/pci/if_wmvar.h:1.33.6.12
--- src/sys/dev/pci/if_wmvar.h:1.33.6.11	Mon Sep  4 17:57:49 2023
+++ src/sys/dev/pci/if_wmvar.h	Wed Oct 18 14:41:55 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmvar.h,v 1.33.6.11 2023/09/04 17:57:49 martin Exp $	*/
+/*	$NetBSD: if_wmvar.h,v 1.33.6.12 2023/10/18 14:41:55 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -163,6 +163,7 @@ typedef enum {
 	WM_T_PCH_LPT,			/* PCH "Lynx Point" LAN (I217, I218) */
 	WM_T_PCH_SPT,			/* PCH "Sunrise Point" LAN (I219) */
 	WM_T_PCH_CNP,			/* (I219) */
+	WM_T_PCH_TGP			/* (I219) */
 } wm_chip_type;
 
 /*

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1289.2.29 src/sys/dev/pci/pcidevs:1.1289.2.30
--- src/sys/dev/pci/pcidevs:1.1289.2.29	Fri Oct 13 18:44:59 2023
+++ src/sys/dev/pci/pcidevs	Wed Oct 18 14:41:55 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1289.2.29 2023/10/13 18:44:59 martin Exp $
+$NetBSD: pcidevs,v 1.1289.2.30 2023/10/18 14:41:55 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -3934,6 +3934,10 @@ product INTEL I219_LM10		0x0d4e	I219-LM 
 product INTEL I219_V10		0x0d4f	I219-V (10) Ethernet Connection
 product INTEL I219_LM12		0x0d53	I219-LM (12) Ethernet Connection
 product INTEL I219_V12		0x0d55	I219-V (12) Ethernet Connection
+product INTEL I219_LM23		0x0dc5	I219-LM (23) Ethernet Connection
+product INTEL I219_V23		0x0dc6	I219-V (23) Ethernet Connection
+product INTEL I219_LM22		0x0dc7	I219-LM (22) Ethernet Connection
+product INTEL I219_V22		0x0dc8	I219-V (22) Ethernet Connection
 product INTEL E5V2_DMI2		0x0e00	E5 v2 DMI2
 product INTEL E5V2_PCIE_1	0x0e01	E5 v2 PCIe x4 (DMI2 Mode)
 product INTEL E5V2_PCIE_2	0x0e02	E5 v2 PCIe

Reply via email to