Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci match three more variants - DGE550T_B1, 8040T, 8042



details:   https://anonhg.NetBSD.org/src/rev/393a5c378dde
branches:  trunk
changeset: 323366:393a5c378dde
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue Jun 12 20:27:54 2018 +0000

description:
match three more variants - DGE550T_B1, 8040T, 8042

sync more sk_type conditionals from OpenBSD

diffstat:

 sys/dev/pci/if_msk.c   |  30 ++++++++++++++++++++++++++----
 sys/dev/pci/if_skreg.h |   3 ++-
 2 files changed, 28 insertions(+), 5 deletions(-)

diffs (120 lines):

diff -r abc3ac628c46 -r 393a5c378dde sys/dev/pci/if_msk.c
--- a/sys/dev/pci/if_msk.c      Tue Jun 12 20:25:47 2018 +0000
+++ b/sys/dev/pci/if_msk.c      Tue Jun 12 20:27:54 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.59 2018/06/12 19:35:00 jdolecek Exp $ */
+/* $NetBSD: if_msk.c,v 1.60 2018/06/12 20:27:54 jdolecek Exp $ */
 /*     $OpenBSD: if_msk.c,v 1.42 2007/01/17 02:43:02 krw Exp $ */
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.59 2018/06/12 19:35:00 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.60 2018/06/12 20:27:54 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -152,6 +152,7 @@
        pci_product_id_t        msk_product;
 } msk_products[] = {
        { PCI_VENDOR_DLINK,             PCI_PRODUCT_DLINK_DGE550SX },
+       { PCI_VENDOR_DLINK,             PCI_PRODUCT_DLINK_DGE550T_B1 },
        { PCI_VENDOR_DLINK,             PCI_PRODUCT_DLINK_DGE560SX },
        { PCI_VENDOR_DLINK,             PCI_PRODUCT_DLINK_DGE560T },
        { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKONII_8021CU },
@@ -163,6 +164,8 @@
        { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKON_8038 },
        { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKON_8039 },
        { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKON_8040 },
+       { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKON_8040T },
+       { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKON_8042 },
        { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKON_8048 },
        { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKON_8050 },
        { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKON_8052 },
@@ -294,7 +297,8 @@
        gpcr = SK_YU_READ_2(sc_if, YUKON_GPCR);
        gpcr &= (YU_GPCR_TXEN | YU_GPCR_RXEN);
 
-       if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
+       if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO ||
+           sc_if->sk_softc->sk_type == SK_YUKON_FE_P) {
                /* Set speed. */
                gpcr |= YU_GPCR_SPEED_DIS;
                switch (IFM_SUBTYPE(mii->mii_media_active)) {
@@ -859,6 +863,11 @@
        }
 
        /* release PHY from PowerDown/Coma mode. */
+       reg1 = sk_win_read_4(sc, SK_Y2_PCI_REG(SK_PCI_OURREG1));
+       if (sc->sk_type == SK_YUKON_XL && sc->sk_rev > SK_YUKON_XL_REV_A1)
+               reg1 |= (SK_Y2_REG1_PHY1_COMA | SK_Y2_REG1_PHY2_COMA);
+       else
+               reg1 &= ~(SK_Y2_REG1_PHY1_COMA | SK_Y2_REG1_PHY2_COMA);
        sk_win_write_4(sc, SK_Y2_PCI_REG(SK_PCI_OURREG1), reg1);
 
        if (sc->sk_type == SK_YUKON_XL && sc->sk_rev > SK_YUKON_XL_REV_A1)
@@ -926,16 +935,26 @@
        switch (sc->sk_type) {
        case SK_YUKON_EC:
        case SK_YUKON_EC_U:
+       case SK_YUKON_EX:
+       case SK_YUKON_SUPR:
+       case SK_YUKON_ULTRA2:
+       case SK_YUKON_OPTIMA:
+       case SK_YUKON_PRM:
+       case SK_YUKON_OPTIMA2:
                imtimer_ticks = SK_IMTIMER_TICKS_YUKON_EC;
                break;
        case SK_YUKON_FE:
                imtimer_ticks = SK_IMTIMER_TICKS_YUKON_FE;
                break;
+       case SK_YUKON_FE_P:
+               imtimer_ticks = SK_IMTIMER_TICKS_YUKON_FE_P;
+               break;
        case SK_YUKON_XL:
                imtimer_ticks = SK_IMTIMER_TICKS_YUKON_XL;
                break;
        default:
                imtimer_ticks = SK_IMTIMER_TICKS_YUKON;
+               break;
        }
 
        /* Reset status ring. */
@@ -2146,7 +2165,7 @@
              YU_SMR_IPG_DATA(0x1e);
 
        if (sc->sk_type != SK_YUKON_FE &&
-           sc->sk_type != SK_YUKON_FE)
+           sc->sk_type != SK_YUKON_FE_P)
                reg |= YU_SMR_MFL_JUMBO;
 
        SK_YU_WRITE_2(sc_if, YUKON_SMR, reg);
@@ -2304,6 +2323,9 @@
        case SK_YUKON_FE:
                imtimer_ticks = SK_IMTIMER_TICKS_YUKON_FE;
                break;
+       case SK_YUKON_FE_P:
+               imtimer_ticks = SK_IMTIMER_TICKS_YUKON_FE_P;
+               break;
        case SK_YUKON_XL:
                imtimer_ticks = SK_IMTIMER_TICKS_YUKON_XL;
                break;
diff -r abc3ac628c46 -r 393a5c378dde sys/dev/pci/if_skreg.h
--- a/sys/dev/pci/if_skreg.h    Tue Jun 12 20:25:47 2018 +0000
+++ b/sys/dev/pci/if_skreg.h    Tue Jun 12 20:27:54 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_skreg.h,v 1.16 2018/06/09 18:53:16 jdolecek Exp $ */
+/* $NetBSD: if_skreg.h,v 1.17 2018/06/12 20:27:54 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -449,6 +449,7 @@
 #define SK_IMCTL_START         0x04
 
 /* Number of ticks per usec for interrupt moderation */
+#define SK_IMTIMER_TICKS_YUKON_FE_P    50
 #define SK_IMTIMER_TICKS_GENESIS       53
 #define SK_IMTIMER_TICKS_YUKON         156
 #define SK_IMTIMER_TICKS_YUKON_EC      125



Home | Main Index | Thread Index | Old Index