brgphy fixes for bge NICs

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

brgphy fixes for bge NICs

Brad Smith-14
Addition of some DSP init code for some brgphy models that come
on BCM5703 and BCM5704 copper based bge NICs.

Derived from Linux's tg3 driver.

Index: brgphy.c
===================================================================
RCS file: /cvs/src/sys/dev/mii/brgphy.c,v
retrieving revision 1.41
diff -u -p -r1.41 brgphy.c
--- brgphy.c 6 Nov 2005 21:51:55 -0000 1.41
+++ brgphy.c 6 Nov 2005 21:52:37 -0000
@@ -481,15 +481,16 @@ brgphy_reset(struct mii_softc *sc)
  brgphy_load_dspcode(sc);
 
  /*
- * Don't enable Ethernet@WireSpeed for the 5700 or the
- * 5705 A1 and A2 chips. Make sure we only do this test
- * on "bge" NICs, since other drivers may use this same
- * PHY subdriver.
+ * Don't enable Ethernet@WireSpeed for the 5700 or 5705
+ * other than A0 and A1 chips. Make sure we only do this
+ * test on "bge" NICs, since other drivers may use this
+ * same PHY subdriver.
  */
  if (strncmp(ifp->if_xname, "bge", 3) == 0 &&
     (BGE_ASICREV(bge_sc->bge_chipid) == BGE_ASICREV_BCM5700 ||
-    bge_sc->bge_chipid == BGE_CHIPID_BCM5705_A1 ||
-    bge_sc->bge_chipid == BGE_CHIPID_BCM5705_A2))
+    (BGE_ASICREV(bge_sc->bge_chipid) == BGE_ASICREV_BCM5750 &&
+     (bge_sc->bge_chipid != BGE_CHIPID_BCM5705_A0 &&
+      bge_sc->bge_chipid != BGE_CHIPID_BCM5705_A1))))
  return;
 
  /* Enable Ethernet@WireSpeed. */
@@ -598,6 +599,9 @@ brgphy_bcm5703_dspcode(struct mii_softc
  { BRGPHY_MII_AUXCTL, 0x0c00 },
  { BRGPHY_MII_DSP_ADDR_REG, 0x201f },
  { BRGPHY_MII_DSP_RW_PORT, 0x2aaa },
+ { BRGPHY_MII_DSP_ADDR_REG, 0x000a },
+ { BRGPHY_MII_DSP_RW_PORT, 0x0323 },
+ { BRGPHY_MII_AUXCTL, 0x0400 },
  { 0, 0 },
  };
  int i;
@@ -613,6 +617,12 @@ brgphy_bcm5704_dspcode(struct mii_softc
  int reg;
  uint16_t val;
  } dspcode[] = {
+ { BRGPHY_MII_AUXCTL, 0x0c00 },
+ { BRGPHY_MII_DSP_ADDR_REG, 0x201f },
+ { BRGPHY_MII_DSP_RW_PORT, 0x2aaa },
+ { BRGPHY_MII_DSP_ADDR_REG, 0x000a },
+ { BRGPHY_MII_DSP_RW_PORT, 0x0323 },
+ { BRGPHY_MII_AUXCTL, 0x0400 },
  { 0x1c, 0x8d68 },
  { 0x1c, 0x8d68 },
  { 0, 0 },

Reply | Threaded
Open this post in threaded view
|

Re: brgphy fixes for bge NICs

dimitry (Bugzilla)
Brad wrote:
> Addition of some DSP init code for some brgphy models that come
> on BCM5703 and BCM5704 copper based bge NICs.

Just for luck, I also tried this on my problematic BCM5751 (bge NIC on
a ThinkPad X41).  It doesn't seem to make much difference, the link
still goes down as soon as the driver initializes, and must be forced
up with ifconfig to be able to do anything with it...

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]

Reply | Threaded
Open this post in threaded view
|

Re: brgphy fixes for bge NICs

Brad Smith-14
On Mon, Nov 07, 2005 at 08:28:41PM +0100, Dimitry Andric wrote:
> Brad wrote:
> > Addition of some DSP init code for some brgphy models that come
> > on BCM5703 and BCM5704 copper based bge NICs.
>
> Just for luck, I also tried this on my problematic BCM5751 (bge NIC on
> a ThinkPad X41).  It doesn't seem to make much difference, the link
> still goes down as soon as the driver initializes, and must be forced
> up with ifconfig to be able to do anything with it...

Ya. Don't expect any change in beavior with this diff. I'll look into this
and see what I can do.