NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/37809: new version of dev/ic/gem.c doesn't work on Apple Powerbook5,8
The following reply was made to PR kern/37809; it has been noted by GNATS.
From: Julian Coleman <jdc%coris.org.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: macallan%NetBSD.org@localhost
Subject: Re: kern/37809: new version of dev/ic/gem.c doesn't work on Apple
Powerbook5,8
Date: Sat, 19 Jan 2008 19:18:08 +0000
--i0/AhcQY5QxfSsSZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
> rev 1.68 of dev/ic/gem.c introduces a regression which prevents gem from
> correctly working on my powerbook. It still works fine on my iBook.
Do either of them have a gigabit PHY? I have also broken gem in the PowerMac
G4 (gem + gigabit brgphy).
Can you try the attached patch, please? It reverts some of the changes that
came in with 1.68. However, I'm not sure why any of the changes should be
stopping RX interrupts, so if this doesn't work, I'll do a patch that reverts
more.
Thanks,
J
--
My other computer also runs NetBSD / Sailing at Newbiggin
http://www.netbsd.org/ / http://www.newbigginsailingclub.org/
--i0/AhcQY5QxfSsSZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gem.c.diffs"
--- sys/dev/ic/gem.c.dist 2008-01-05 20:27:44.000000000 +0000
+++ sys/dev/ic/gem.c 2008-01-19 19:03:22.000000000 +0000
@@ -321,20 +321,24 @@
}
if (sc->sc_mif_config & GEM_MIF_CONFIG_MDI0) {
+printf("%s: using PHY at MDIO_0\n", sc->sc_dev.dv_xname);
#ifdef GEM_DEBUG
aprint_debug("%s: using PHY at MDIO_0\n",
sc->sc_dev.dv_xname);
#endif
} else {
+printf("%s: using PHY at MDIO_1\n", sc->sc_dev.dv_xname);
#ifdef GEM_DEBUG
aprint_debug("%s: using PHY at MDIO_1\n",
sc->sc_dev.dv_xname);
#endif
}
+/* XXX jdc
if (sc->sc_variant != GEM_SUN_ERI)
bus_space_write_4(t, h, GEM_MII_DATAPATH_MODE,
GEM_MII_DATAPATH_MII);
+*/
/*
* XXX - we can really do the following ONLY if the
* PHY indeed has the auto negotiation capability!!
@@ -1045,10 +1049,12 @@
gem_mifinit(sc);
/* Set up correct datapath for non-SERDES/Serialink */
+/* XXX jdc
if ((sc->sc_flags & (GEM_SERDES | GEM_SERIAL)) == 0 &&
sc->sc_variant != GEM_SUN_ERI)
bus_space_write_4(t, h, GEM_MII_DATAPATH_MODE,
GEM_MII_DATAPATH_MII);
+*/
/* Call MI reset function if any */
if (sc->sc_hwreset)
@@ -1079,10 +1085,13 @@
bus_space_write_4(t, h, GEM_RX_RING_PTR_LO, GEM_CDRXADDR(sc, 0));
/* step 8. Global Configuration & Interrupt Mask */
+/* XXX jdc
if ((sc->sc_flags & (GEM_SERDES | GEM_SERIAL)) != 0)
v = GEM_INTR_PCS;
else
v = GEM_INTR_MIF;
+*/
+v = GEM_INTR_PCS | GEM_INTR_MIF;
bus_space_write_4(t, h, GEM_INTMASK,
~(GEM_INTR_TX_INTME |
GEM_INTR_TX_EMPTY |
@@ -1093,8 +1102,11 @@
bus_space_write_4(t, h, GEM_MAC_RX_MASK,
GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT);
bus_space_write_4(t, h, GEM_MAC_TX_MASK, 0xffff); /* XXX */
+/* XXX jdc
bus_space_write_4(t, h, GEM_MAC_CONTROL_MASK,
GEM_MAC_PAUSED | GEM_MAC_PAUSE | GEM_MAC_RESUME);
+*/
+bus_space_write_4(t, h, GEM_MAC_CONTROL_MASK, 0);
/* step 9. ETX Configuration: use mostly default values */
@@ -1209,7 +1221,10 @@
bus_space_write_4(t, h, GEM_MAC_RX_CODE_VIOL, 0);
/* Set XOFF PAUSE time. */
+/* XXX jdc
bus_space_write_4(t, h, GEM_MAC_SEND_PAUSE_CMD, 0x1BF0);
+*/
+bus_space_write_4(t, h, GEM_MAC_SEND_PAUSE_CMD, 0);
/*
* Set the internal arbitration to "infinite" bursts of the
@@ -1218,10 +1233,12 @@
* especially RX performance.
* Enable silicon bug workarounds for the Apple variants.
*/
+/* XXX jdc
bus_space_write_4(t, h, GEM_CONFIG,
GEM_CONFIG_TXDMA_LIMIT | GEM_CONFIG_RXDMA_LIMIT |
GEM_CONFIG_BURST_INF | (GEM_IS_APPLE(sc) ?
GEM_CONFIG_RONPAULBIT | GEM_CONFIG_BUG2FIX : 0));
+*/
/*
* Set the station address.
@@ -1235,7 +1252,11 @@
*/
v = GEM_MAC_XIF_TX_MII_ENA;
if (sc->sc_flags & GEM_GIGABIT)
+/* XXX jdc */
+{
+printf("%s: gem_init_regs: gigabit phy\n", sc->sc_dev.dv_xname);
v |= GEM_MAC_XIF_GMII_MODE;
+}
bus_space_write_4(t, h, GEM_MAC_XIF_CONFIG, v);
}
--i0/AhcQY5QxfSsSZ--
Home |
Main Index |
Thread Index |
Old Index