diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-11-14 14:11:09 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-11-14 14:11:09 +0000 |
commit | 62c16fc9776532c0a1a209db6f5932448b6c7eaa (patch) | |
tree | 6d3338dde213dc5813c6ae776ce1377ebdcdf426 /sys/dev/fdt/if_mvpp.c | |
parent | 9e87acdad227fdcb41d21f0b73683b8d49008be8 (diff) |
Add 10G media support. This makes the 10G ports on the "single shot" model
work. The "double shot" model needs more work (support for "clause 45"
PHYs).
ok patrick@
Diffstat (limited to 'sys/dev/fdt/if_mvpp.c')
-rw-r--r-- | sys/dev/fdt/if_mvpp.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/fdt/if_mvpp.c b/sys/dev/fdt/if_mvpp.c index 2fc4a781148..9ac7bccaefd 100644 --- a/sys/dev/fdt/if_mvpp.c +++ b/sys/dev/fdt/if_mvpp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mvpp.c,v 1.40 2020/11/13 22:46:20 kettenis Exp $ */ +/* $OpenBSD: if_mvpp.c,v 1.41 2020/11/14 14:11:08 kettenis Exp $ */ /* * Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org> * Copyright (c) 2017, 2020 Patrick Wildt <patrick@blueri.se> @@ -1574,6 +1574,15 @@ mvpp2_port_attach_sfp(struct device *self) rw_exit(&mvpp2_sff_lock); switch (IFM_SUBTYPE(sc->sc_mii.mii_media_active)) { + case IFM_10G_SR: + case IFM_10G_LR: + case IFM_10G_LRM: + case IFM_10G_ER: + case IFM_10G_SFP_CU: + sc->sc_phy_mode = PHY_MODE_10GBASER; + sc->sc_mii.mii_media_status = IFM_AVALID; + sc->sc_inband_status = 1; + break; case IFM_2500_SX: sc->sc_phy_mode = PHY_MODE_2500BASEX; sc->sc_mii.mii_media_status = IFM_AVALID; @@ -1931,7 +1940,7 @@ mvpp2_inband_statchg(struct mvpp2_port *sc) if (reg & MV_XLG_MAC_PORT_STATUS_LINKSTATUS) sc->sc_mii.mii_media_status |= IFM_ACTIVE; sc->sc_mii.mii_media_active |= IFM_FDX; - sc->sc_mii.mii_media_active |= IFM_10G_SR; + sc->sc_mii.mii_media_active |= subtype; } else { reg = mvpp2_gmac_read(sc, MVPP2_PORT_STATUS0_REG); if (reg & MVPP2_PORT_STATUS0_LINKUP) |