summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-08-15 18:31:29 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-08-15 18:31:29 +0000
commit622d9897ce7ceaf2ec243754c9c3e881684e7499 (patch)
treef9462c4bf3f484b2d52b3c9654ee3006b58c562f /sys/dev/ic
parent3d965ea40e30b5fb451fa11dc757513ff40159bd (diff)
For some reason the RTL8211E PHY on the Banana Pi responds to both address 0
and 1. As a result rgephy(4) attaches twice. Prevent this from happening by passing the PHY address, which is part of the device tree, down from the bus-specific glue to the generic driver code.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/dwc_gmac.c6
-rw-r--r--sys/dev/ic/dwc_gmac_var.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ic/dwc_gmac.c b/sys/dev/ic/dwc_gmac.c
index 8d66ec7c669..a52f831bfa3 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.1 2016/08/13 20:35:57 kettenis Exp $ */
+/* $OpenBSD: dwc_gmac.c,v 1.2 2016/08/15 18:31:28 kettenis Exp $ */
/* $NetBSD: dwc_gmac.c,v 1.34 2015/08/21 20:12:29 jmcneill Exp $ */
/*-
@@ -141,7 +141,7 @@ struct cfdriver dwge_cd = {
};
void
-dwc_gmac_attach(struct dwc_gmac_softc *sc, uint32_t mii_clk)
+dwc_gmac_attach(struct dwc_gmac_softc *sc, uint32_t mii_clk, int phyloc)
{
uint8_t enaddr[ETHER_ADDR_LEN];
struct mii_data * const mii = &sc->sc_mii;
@@ -228,7 +228,7 @@ dwc_gmac_attach(struct dwc_gmac_softc *sc, uint32_t mii_clk)
ifmedia_init(&mii->mii_media, 0, dwc_gmac_ifmedia_upd,
dwc_gmac_ifmedia_sts);
- mii_attach((void *)sc, mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY,
+ mii_attach((void *)sc, mii, 0xffffffff, phyloc, MII_OFFSET_ANY,
MIIF_DOPAUSE);
if (LIST_EMPTY(&mii->mii_phys)) {
diff --git a/sys/dev/ic/dwc_gmac_var.h b/sys/dev/ic/dwc_gmac_var.h
index e2b2d2887ca..87b63a41a38 100644
--- a/sys/dev/ic/dwc_gmac_var.h
+++ b/sys/dev/ic/dwc_gmac_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc_gmac_var.h,v 1.1 2016/08/13 20:35:57 kettenis Exp $ */
+/* $OpenBSD: dwc_gmac_var.h,v 1.2 2016/08/15 18:31:28 kettenis Exp $ */
/* $NetBSD: dwc_gmac_var.h,v 1.6 2014/11/22 18:31:03 jmcneill Exp $ */
/*-
@@ -91,5 +91,5 @@ struct dwc_gmac_softc {
uint16_t sc_mii_clk;
};
-void dwc_gmac_attach(struct dwc_gmac_softc*, uint32_t /*mii_clk*/);
+void dwc_gmac_attach(struct dwc_gmac_softc*, uint32_t, int);
int dwc_gmac_intr(struct dwc_gmac_softc*);