Make network ports work on Shasta.
authorvisa <visa@openbsd.org>
Sat, 8 Apr 2017 10:53:48 +0000 (10:53 +0000)
committervisa <visa@openbsd.org>
Sat, 8 Apr 2017 10:53:48 +0000 (10:53 +0000)
sys/arch/octeon/dev/cn30xxgmx.c
sys/arch/octeon/dev/cn30xxgmxreg.h

index eaad8dc..2d8d65f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cn30xxgmx.c,v 1.32 2017/01/22 10:17:37 dlg Exp $      */
+/*     $OpenBSD: cn30xxgmx.c,v 1.33 2017/04/08 10:53:48 visa Exp $     */
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -428,6 +428,21 @@ cn30xxgmx_init(struct cn30xxgmx_softc *sc)
                }
                break;
        }
+       case OCTEON_MODEL_FAMILY_CN71XX:
+               switch (inf_mode & INF_MODE_MODE) {
+               case INF_MODE_MODE_SGMII:
+                       sc->sc_nports = 4;
+                       for (i = 0; i < sc->sc_nports; i++)
+                               sc->sc_port_types[i] = GMX_SGMII_PORT;
+                       break;
+#ifdef notyet
+               case INF_MODE_MODE_XAUI:
+#endif
+               default:
+                       sc->sc_nports = 0;
+                       result = 1;
+               }
+               break;
        case OCTEON_MODEL_FAMILY_CN38XX:
        case OCTEON_MODEL_FAMILY_CN56XX:
        case OCTEON_MODEL_FAMILY_CN58XX:
index e1e650a..037c6ab 100644 (file)
@@ -3,7 +3,7 @@
  * DONT EDIT THIS FILE
  */
 
-/*     $OpenBSD: cn30xxgmxreg.h,v 1.5 2016/06/22 13:09:35 visa Exp $   */
+/*     $OpenBSD: cn30xxgmxreg.h,v 1.6 2017/04/08 10:53:48 visa Exp $   */
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
 #define        INF_MODE_EN                             0x0000000000000002ULL
 #define        INF_MODE_TYPE                           0x0000000000000001ULL
 
+/* Interface mode, applicable on CN68xx and CN7xxx (?) */
+#define        INF_MODE_MODE                           0x0000000000000070ULL
+#define        INF_MODE_MODE_SGMII                     0x0000000000000020ULL
+#define        INF_MODE_MODE_XAUI                      0x0000000000000030ULL
+
 #define        MIO_QLM_CFG(x)                          (0x0001180000001590ULL + (x)*8)
 
 #define        MIO_QLM_CFG_CFG                         0x000000000000000fULL