Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci port basic match support for several more Yukon ...
details: https://anonhg.NetBSD.org/src/rev/9d5c26adde34
branches: trunk
changeset: 319761:9d5c26adde34
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Sat Jun 09 18:53:16 2018 +0000
description:
port basic match support for several more Yukon variants from OpenBSD, together
with some basic conditionals I've found in that driver; only compile-tested, so
very likely needs further work to actually work
adresses also PR kern/43507
diffstat:
sys/dev/pci/if_msk.c | 143 ++++++++++++++++++++++++++++++++++++++++++++----
sys/dev/pci/if_skreg.h | 24 +++++++-
2 files changed, 152 insertions(+), 15 deletions(-)
diffs (truncated from 309 to 300 lines):
diff -r 6a801ed532a2 -r 9d5c26adde34 sys/dev/pci/if_msk.c
--- a/sys/dev/pci/if_msk.c Sat Jun 09 18:48:31 2018 +0000
+++ b/sys/dev/pci/if_msk.c Sat Jun 09 18:53:16 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.55 2017/10/20 12:01:43 christos Exp $ */
+/* $NetBSD: if_msk.c,v 1.56 2018/06/09 18:53:16 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.55 2017/10/20 12:01:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.56 2018/06/09 18:53:16 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -154,31 +154,39 @@
{ PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE550SX },
{ PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE560SX },
{ PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE560T },
- { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_1 },
- { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_C032 },
- { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_C033 },
- { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_C034 },
- { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_C036 },
- { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_C042 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8021CU },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8021X },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8022CU },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8022X },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8035 },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8036 },
{ 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_8048 },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8050 },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8052 },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8053 },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8055 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8055_2 },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8056 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8057 },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8058 },
- { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8021CU },
- { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8021X },
- { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8022CU },
- { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8022X },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8059 },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8061CU },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8061X },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8062CU },
{ PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKONII_8062X },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8070 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8071 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8072 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8075 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_8079 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_C032 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_C033 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_C034 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_C036 },
+ { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_YUKON_C042 },
{ PCI_VENDOR_SCHNEIDERKOCH, PCI_PRODUCT_SCHNEIDERKOCH_SK_9SXX },
{ PCI_VENDOR_SCHNEIDERKOCH, PCI_PRODUCT_SCHNEIDERKOCH_SK_9E21 }
};
@@ -754,6 +762,12 @@
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:
@@ -825,7 +839,8 @@
else
reg1 &= ~(SK_Y2_REG1_PHY1_COMA | SK_Y2_REG1_PHY2_COMA);
- if (sc->sk_type == SK_YUKON_EC_U) {
+ if (sc->sk_type == SK_YUKON_EC_U || sc->sk_type == SK_YUKON_EX ||
+ sc->sk_type >= SK_YUKON_FE_P) {
uint32_t our;
CSR_WRITE_2(sc, SK_CSR, SK_CSR_WOL_ON);
@@ -862,6 +877,11 @@
CSR_WRITE_2(sc, SK_LINK_CTRL, SK_LINK_RESET_CLEAR);
CSR_WRITE_2(sc, SK_LINK_CTRL + SK_WIN_LEN, SK_LINK_RESET_CLEAR);
+ if (sc->sk_type == SK_YUKON_EX || sc->sk_type == SK_YUKON_SUPR) {
+ CSR_WRITE_2(sc, SK_GMAC_CTRL, SK_GMAC_BYP_MACSECRX |
+ SK_GMAC_BYP_MACSECTX | SK_GMAC_BYP_RETR_FIFO);
+ }
+
sk_win_write_1(sc, SK_TESTCTL1, 1);
DPRINTFN(2, ("msk_reset: sk_csr=%x\n", CSR_READ_1(sc, SK_CSR)));
@@ -971,9 +991,15 @@
switch (sa->skc_type) {
case SK_YUKON_XL:
case SK_YUKON_EC_U:
+ case SK_YUKON_EX:
case SK_YUKON_EC:
case SK_YUKON_FE:
case SK_YUKON_FE_P:
+ case SK_YUKON_SUPR:
+ case SK_YUKON_ULTRA2:
+ case SK_YUKON_OPTIMA:
+ case SK_YUKON_PRM:
+ case SK_YUKON_OPTIMA2:
return (1);
}
@@ -1333,12 +1359,33 @@
case SK_YUKON_EC_U:
sc->sk_name = "Yukon-2 EC Ultra";
break;
+ case SK_YUKON_EX:
+ sc->sk_name = "Yukon-2 Extreme";
+ break;
case SK_YUKON_EC:
sc->sk_name = "Yukon-2 EC";
break;
case SK_YUKON_FE:
sc->sk_name = "Yukon-2 FE";
break;
+ case SK_YUKON_FE_P:
+ sc->sk_name = "Yukon-2 FE+";
+ break;
+ case SK_YUKON_SUPR:
+ sc->sk_name = "Yukon-2 Supreme";
+ break;
+ case SK_YUKON_ULTRA2:
+ sc->sk_name = "Yukon-2 Ultra 2";
+ break;
+ case SK_YUKON_OPTIMA:
+ sc->sk_name = "Yukon-2 Optima";
+ break;
+ case SK_YUKON_PRM:
+ sc->sk_name = "Yukon-2 Optima Prime";
+ break;
+ case SK_YUKON_OPTIMA2:
+ sc->sk_name = "Yukon-2 Optima 2";
+ break;
default:
sc->sk_name = "Yukon (Unknown)";
}
@@ -1414,12 +1461,73 @@
case SK_YUKON_EC_U_REV_B0:
revstr = "B0";
break;
+ case SK_YUKON_EC_U_REV_B1:
+ revstr = "B1";
+ break;
default:
sc->sk_workaround = 0;
break;
}
}
+ if (sc->sk_type == SK_YUKON_FE) {
+ switch (sc->sk_rev) {
+ case SK_YUKON_FE_REV_A1:
+ revstr = "A1";
+ break;
+ case SK_YUKON_FE_REV_A2:
+ revstr = "A2";
+ break;
+ default:
+ ;
+ }
+ }
+
+ if (sc->sk_type == SK_YUKON_FE_P && sc->sk_rev == SK_YUKON_FE_P_REV_A0)
+ revstr = "A0";
+
+ if (sc->sk_type == SK_YUKON_EX) {
+ switch (sc->sk_rev) {
+ case SK_YUKON_EX_REV_A0:
+ revstr = "A0";
+ break;
+ case SK_YUKON_EX_REV_B0:
+ revstr = "B0";
+ break;
+ default:
+ ;
+ }
+ }
+
+ if (sc->sk_type == SK_YUKON_SUPR) {
+ switch (sc->sk_rev) {
+ case SK_YUKON_SUPR_REV_A0:
+ revstr = "A0";
+ break;
+ case SK_YUKON_SUPR_REV_B0:
+ revstr = "B0";
+ break;
+ case SK_YUKON_SUPR_REV_B1:
+ revstr = "B1";
+ break;
+ default:
+ ;
+ }
+ }
+
+ if (sc->sk_type == SK_YUKON_PRM) {
+ switch (sc->sk_rev) {
+ case SK_YUKON_PRM_REV_Z1:
+ revstr = "Z1";
+ break;
+ case SK_YUKON_PRM_REV_A0:
+ revstr = "A0";
+ break;
+ default:
+ ;
+ }
+ }
+
/* Announce the product name. */
aprint_normal(", %s", sc->sk_name);
if (revstr != NULL)
@@ -2053,7 +2161,8 @@
YU_SMR_MFL_VLAN |
YU_SMR_IPG_DATA(0x1e);
- if (sc->sk_type != SK_YUKON_FE)
+ if (sc->sk_type != SK_YUKON_FE &&
+ sc->sk_type != SK_YUKON_FE)
reg |= YU_SMR_MFL_JUMBO;
SK_YU_WRITE_2(sc_if, YUKON_SMR, reg);
@@ -2200,6 +2309,12 @@
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:
diff -r 6a801ed532a2 -r 9d5c26adde34 sys/dev/pci/if_skreg.h
--- a/sys/dev/pci/if_skreg.h Sat Jun 09 18:48:31 2018 +0000
+++ b/sys/dev/pci/if_skreg.h Sat Jun 09 18:53:16 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_skreg.h,v 1.15 2014/10/10 14:23:06 christos Exp $ */
+/* $NetBSD: if_skreg.h,v 1.16 2018/06/09 18:53:16 jdolecek Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -388,9 +388,15 @@
#define SK_YUKON_LP 0xB2
#define SK_YUKON_XL 0xB3
#define SK_YUKON_EC_U 0xB4
+#define SK_YUKON_EX 0xB5
#define SK_YUKON_EC 0xB6
#define SK_YUKON_FE 0xB7
#define SK_YUKON_FE_P 0xB8
+#define SK_YUKON_SUPR 0xB9
+#define SK_YUKON_ULTRA2 0xBA
+#define SK_YUKON_OPTIMA 0xBC
+#define SK_YUKON_PRM 0xBD
+#define SK_YUKON_OPTIMA2 0xBE
#define SK_YUKON_FAMILY(x) ((x) & 0xB0)
#define SK_IS_GENESIS(sc) \
@@ -417,10 +423,23 @@
#define SK_YUKON_EC_U_REV_A0 0x1
#define SK_YUKON_EC_U_REV_A1 0x2
#define SK_YUKON_EC_U_REV_B0 0x3
+#define SK_YUKON_EC_U_REV_B1 0x5
#define SK_YUKON_FE_REV_A1 0x1
#define SK_YUKON_FE_REV_A2 0x3
+#define SK_YUKON_FE_P_REV_A0 0x0
+
+#define SK_YUKON_EX_REV_A0 0x1
+#define SK_YUKON_EX_REV_B0 0x2
+
+#define SK_YUKON_SUPR_REV_A0 0x0
+#define SK_YUKON_SUPR_REV_B0 0x1
+#define SK_YUKON_SUPR_REV_B1 0x3
+
+#define SK_YUKON_PRM_REV_Z1 0x1
+#define SK_YUKON_PRM_REV_A0 0x2
+
/* Workaround */
#define SK_WA_43_418 0x01
#define SK_WA_4109 0x02
@@ -1323,6 +1342,9 @@
Home |
Main Index |
Thread Index |
Old Index