aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mii
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2007-02-21 18:17:44 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2007-02-21 18:17:44 +0000
commitf7a66f06ec7f6c834bb6edbb49cea7de61151cae (patch)
tree3076263f608486e26ab04e525a5ae2f7cdc6883f /sys/dev/mii
parentb824b7d86a4d20b9b67d581d344353e5e4aade3a (diff)
Notes
Diffstat (limited to 'sys/dev/mii')
-rw-r--r--sys/dev/mii/brgphy.c53
-rw-r--r--sys/dev/mii/miidevs3
2 files changed, 54 insertions, 2 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index 247e83fb70dc..06a3d6fdd687 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -97,6 +97,7 @@ static void brgphy_status(struct mii_softc *);
static int brgphy_mii_phy_auto(struct mii_softc *);
static void brgphy_reset(struct mii_softc *);
static void brgphy_loop(struct mii_softc *);
+static int bcm5706_is_tbi(device_t);
static void bcm5401_load_dspcode(struct mii_softc *);
static void bcm5411_load_dspcode(struct mii_softc *);
static void brgphy_fixup_5704_a0_bug(struct mii_softc *);
@@ -122,6 +123,7 @@ static const struct mii_phydesc brgphys[] = {
MII_PHY_DESC(xxBROADCOM, BCM5752),
MII_PHY_DESC(xxBROADCOM, BCM5754),
MII_PHY_DESC(xxBROADCOM, BCM5780),
+ MII_PHY_DESC(xxBROADCOM, BCM5708C),
MII_PHY_DESC(xxBROADCOM_ALT1, BCM5787),
MII_PHY_END
};
@@ -129,8 +131,29 @@ static const struct mii_phydesc brgphys[] = {
static int
brgphy_probe(device_t dev)
{
+ struct mii_attach_args *ma;
+ int error;
- return (mii_phy_dev_probe(dev, brgphys, BUS_PROBE_DEFAULT));
+ error = mii_phy_dev_probe(dev, brgphys, BUS_PROBE_DEFAULT);
+ if (error != BUS_PROBE_DEFAULT)
+ return (error);
+
+ ma = device_get_ivars(dev);
+ if (MII_OUI(ma->mii_id1, ma->mii_id2) == MII_OUI_xxBROADCOM &&
+ MII_MODEL(ma->mii_id2) == MII_MODEL_xxBROADCOM_BCM5706C) {
+ /*
+ * Broadcom uses the same MII model ID on two
+ * different types of phys. The first is found on the
+ * BCM 5706 and is supported by this driver. The
+ * other is found on the BCM 5706S and 5708S and is
+ * supported by the gentbi(4) driver, so we check to
+ * see if this phy is supported by gentbi(4) and fail
+ * the probe if so.
+ */
+ if (bcm5706_is_tbi(dev))
+ return (ENXIO);
+ }
+ return (error);
}
static int
@@ -488,6 +511,34 @@ brgphy_loop(struct mii_softc *sc)
}
}
+/*
+ * Check to see if a 5706 phy is really a SerDes phy. Copied from
+ * gentbi_probe().
+ */
+static int
+bcm5706_is_tbi(device_t dev)
+{
+ device_t parent;
+ struct mii_attach_args *ma;
+ int bmsr, extsr;
+
+ parent = device_get_parent(dev);
+ ma = device_get_ivars(dev);
+
+ bmsr = MIIBUS_READREG(parent, ma->mii_phyno, MII_BMSR);
+ if ((bmsr & BMSR_EXTSTAT) == 0 || (bmsr & BMSR_MEDIAMASK) != 0)
+ return (0);
+
+ extsr = MIIBUS_READREG(parent, ma->mii_phyno, MII_EXTSR);
+ if (extsr & (EXTSR_1000TFDX|EXTSR_1000THDX))
+ return (0);
+
+ if (extsr & (EXTSR_1000XFDX|EXTSR_1000XHDX))
+ return (1);
+
+ return (0);
+}
+
/* Turn off tap power management on 5401. */
static void
bcm5401_load_dspcode(struct mii_softc *sc)
diff --git a/sys/dev/mii/miidevs b/sys/dev/mii/miidevs
index 705f5e87c5ac..bee3fc25f268 100644
--- a/sys/dev/mii/miidevs
+++ b/sys/dev/mii/miidevs
@@ -123,13 +123,14 @@ model xxBROADCOM BCM5411 0x0007 BCM5411 10/100/1000baseTX PHY
model xxBROADCOM BCM5754 0x000e BCM5754 10/100/1000baseTX PHY
model xxBROADCOM BCM5752 0x0010 BCM5752 10/100/1000baseTX PHY
model xxBROADCOM BCM5701 0x0011 BCM5701 10/100/1000baseTX PHY
+model xxBROADCOM BCM5706C 0x0015 BCM5706C 10/100/1000baseTX PHY
model xxBROADCOM BCM5703 0x0016 BCM5703 10/100/1000baseTX PHY
model xxBROADCOM BCM5704 0x0019 BCM5704 10/100/1000baseTX PHY
model xxBROADCOM BCM5705 0x001a BCM5705 10/100/1000baseTX PHY
model xxBROADCOM BCM5750 0x0018 BCM5750 10/100/1000baseTX PHY
model xxBROADCOM BCM5714 0x0034 BCM5714 10/100/1000baseTX PHY
model xxBROADCOM BCM5780 0x0035 BCM5780 10/100/1000baseTX PHY
-model xxBROADCOM BCM5706C 0x0036 BCM5706C/5708C 10/100/1000baseTX PHY
+model xxBROADCOM BCM5708C 0x0036 BCM5708C 10/100/1000baseTX PHY
model xxBROADCOM_ALT1 BCM5787 0x000e BCM5787 10/100/1000baseTX PHY
/* Cicada Semiconductor PHYs (now owned by Vitesse?) */