summaryrefslogtreecommitdiff
path: root/sys/dev/ic/gem.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-10-17 03:03:25 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-10-17 03:03:25 +0000
commita4bc1708742c2b2fc8818297716852fb3f2e1564 (patch)
tree19e8aea8e5b7c3a4a243476aaafcba5a108fe425 /sys/dev/ic/gem.c
parent86b78d94d28490f29f3a3d44550cdc00fe951d8c (diff)
Start using the unused sc_variant to identify the GMAC vendor and chipset
model to the MI part of the driver. On Apple systems only attach the PHY to location 0, unless using a K2 GMAC, then use location 1. Tested by drahn@ and kettenis@
Diffstat (limited to 'sys/dev/ic/gem.c')
-rw-r--r--sys/dev/ic/gem.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c
index d168a4b21c6..de52c03abb5 100644
--- a/sys/dev/ic/gem.c
+++ b/sys/dev/ic/gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gem.c,v 1.45 2005/10/11 23:58:36 brad Exp $ */
+/* $OpenBSD: gem.c,v 1.46 2005/10/17 03:03:24 brad Exp $ */
/* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */
/*
@@ -240,8 +240,12 @@ gem_config(sc)
gem_mifinit(sc);
- mii_attach(&sc->sc_dev, mii, 0xffffffff,
- MII_PHY_ANY, MII_OFFSET_ANY, 0);
+ if (sc->sc_tcvr == -1)
+ mii_attach(&sc->sc_dev, mii, 0xffffffff, MII_PHY_ANY,
+ MII_OFFSET_ANY, 0);
+ else
+ mii_attach(&sc->sc_dev, mii, 0xffffffff, sc->sc_tcvr,
+ MII_OFFSET_ANY, 0);
child = LIST_FIRST(&mii->mii_phys);
if (child == NULL) {
@@ -1152,6 +1156,15 @@ gem_mifinit(sc)
bus_space_tag_t t = sc->sc_bustag;
bus_space_handle_t mif = sc->sc_h;
+ if (GEM_IS_APPLE(sc)) {
+ if (sc->sc_variant == GEM_APPLE_K2_GMAC)
+ sc->sc_tcvr = 1;
+ else
+ sc->sc_tcvr = 0;
+ } else {
+ sc->sc_tcvr = -1;
+ }
+
/* Configure the MIF in frame mode */
sc->sc_mif_config = bus_space_read_4(t, mif, GEM_MIF_CONFIG);
sc->sc_mif_config &= ~GEM_MIF_CONFIG_BB_ENA;