From 593a4f844b0d6ebc7da70c8631f7efbedda74c7f Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 7 Apr 2018 22:43:13 +0000 Subject: Only attach a single PHY if the PHY address isn't specified. This prevents PHYs that respond at the broadcast address 0 and some other address from attaching twice and isolating themselves from the interface. This makes the network interface on the Theobrama Systems RK3399-Q7 SoM that has a Micrel KZS9031 PHY work. ok patrick@ --- sys/dev/ic/dwc_gmac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ic/dwc_gmac.c b/sys/dev/ic/dwc_gmac.c index 4a511a0cb0f..78fdbf6d301 100644 --- a/sys/dev/ic/dwc_gmac.c +++ b/sys/dev/ic/dwc_gmac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwc_gmac.c,v 1.8 2017/06/29 17:36:16 deraadt Exp $ */ +/* $OpenBSD: dwc_gmac.c,v 1.9 2018/04/07 22:43:12 kettenis Exp $ */ /* $NetBSD: dwc_gmac.c,v 1.34 2015/08/21 20:12:29 jmcneill Exp $ */ /*- @@ -222,8 +222,8 @@ dwc_gmac_attach(struct dwc_gmac_softc *sc, uint32_t mii_clk, int phyloc) ifmedia_init(&mii->mii_media, 0, dwc_gmac_ifmedia_upd, dwc_gmac_ifmedia_sts); - mii_attach((void *)sc, mii, 0xffffffff, phyloc, MII_OFFSET_ANY, - MIIF_DOPAUSE); + mii_attach((void *)sc, mii, 0xffffffff, phyloc, + (phyloc == MII_PHY_ANY) ? 0 : MII_OFFSET_ANY, MIIF_DOPAUSE); if (LIST_EMPTY(&mii->mii_phys)) { printf("%s: no PHY found!\n", sc->sc_dev.dv_xname); -- cgit v1.2.3