From 204304b294883c999c1e8bc93abcf2cfc34bb0e5 Mon Sep 17 00:00:00 2001 From: visa Date: Sat, 8 Apr 2017 10:53:48 +0000 Subject: [PATCH] Make network ports work on Shasta. --- sys/arch/octeon/dev/cn30xxgmx.c | 17 ++++++++++++++++- sys/arch/octeon/dev/cn30xxgmxreg.h | 7 ++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/sys/arch/octeon/dev/cn30xxgmx.c b/sys/arch/octeon/dev/cn30xxgmx.c index eaad8dc3dd2..2d8d65fea27 100644 --- a/sys/arch/octeon/dev/cn30xxgmx.c +++ b/sys/arch/octeon/dev/cn30xxgmx.c @@ -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: diff --git a/sys/arch/octeon/dev/cn30xxgmxreg.h b/sys/arch/octeon/dev/cn30xxgmxreg.h index e1e650a6bd5..037c6ab4ba4 100644 --- a/sys/arch/octeon/dev/cn30xxgmxreg.h +++ b/sys/arch/octeon/dev/cn30xxgmxreg.h @@ -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. @@ -628,6 +628,11 @@ #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 -- 2.20.1