From owner-freebsd-ppc@FreeBSD.ORG Wed Apr 2 18:38:55 2008 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24C54106564A for ; Wed, 2 Apr 2008 18:38:55 +0000 (UTC) (envelope-from nathanw@uchicago.edu) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id EB0F18FC1D for ; Wed, 2 Apr 2008 18:38:54 +0000 (UTC) (envelope-from nathanw@uchicago.edu) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-1; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 6.3-5.02 (built Oct 12 2007; 32bit)) id <0JYP00G0CNSU4V00@smtpauth1.wiscmail.wisc.edu> for freebsd-ppc@freebsd.org; Wed, 02 Apr 2008 13:38:54 -0500 (CDT) Received: from [72.33.107.137] (dyn-107-137.uwnet.wisc.edu [72.33.107.137]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 6.3-5.02 (built Oct 12 2007; 32bit)) with ESMTPSA id <0JYP00EZ6NSS3I10@smtpauth1.wiscmail.wisc.edu>; Wed, 02 Apr 2008 13:38:52 -0500 (CDT) Date: Wed, 02 Apr 2008 13:38:52 -0500 From: Nathan Whitehorn In-reply-to: To: Marcel Moolenaar Message-id: <47F3D2BC.7060001@uchicago.edu> X-Spam-Report: AuthenticatedSender=yes, SenderIP=72.33.107.137 X-Spam-PmxInfo: Server=avs-8, Version=5.4.1.325704, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.4.2.111931, SenderIP=72.33.107.137 References: <47E06B23.7060400@uchicago.edu> <20080325023040.ab0daa19.stas@FreeBSD.org> <47E8527B.2050002@uchicago.edu> <47F39EF4.8040800@uchicago.edu> User-Agent: Thunderbird 1.5.0.12 (X11/20080213) Cc: freebsd-ppc@freebsd.org Subject: Re: BMAC Ethernet Driver X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2008 18:38:55 -0000 Marcel Moolenaar wrote: > > On Apr 2, 2008, at 7:57 AM, Nathan Whitehorn wrote: >> I've refreshed the BMAC tarball at >> http://home.physics.wisc.edu/~nwhitehorn/bm.tgz. >> >> It supports multicast and full-duplex operation now, the code is a >> little more style(9) compliant, and I don't think I have anything >> left to do unless someone finds some bugs. The patch to macio is also >> now included in the tarball. >> >> To support full-duplex operation, I had to do a hack to reset >> autonegotiation on the PHY (firmware puts the PHY in a weird state >> where its registers claim it did autonegotiation, but it always ends >> up in half-duplex mode). This is done in this way: >> >> sc->sc_mii = device_get_softc(sc->sc_miibus); >> LIST_FOREACH(child, &sc->sc_mii->mii_phys, mii_list) { >> mii_phy_auto(child); >> } >> >> Is a better course to modify lxtphy's attach routine to do this >> there? Or should this stay in bm? > > I lean towards putting it in the PHY driver itself. I expect > a PHY reset to do the right thing and in this case it doesn't > seem to do that. That does seem less hackish. What I don't know is whether Apple ever shipped machines with other PHYs and the BMAC chip, and whether those have the same problem. > From what you say it seems that the driver is commitable at > this time. I can't test it, but I can definitely commit. > Just let me know... I would like some tests with one of the other two revisions of the chip, of course, but any fixes should be minor. The real concern, on my part, for committing it is whether the macio IRQ patch breaks anything. If you have both an interrupts property and an AAPL,interrupts in OF, with multiple interrupts listed, it will cause all of the AAPL,interrupts IRQ resources to be renumbered. At the moment, we only support two devices (SCC and macio ATA) hanging off macio, so the set of things to be checked is limited. I know that the ATA code still works, but I suspect it might break the scc UART support, since it has several interrupts. So if you have any mac hardware at all with an SCC part you can test, it might be good to check that before committing. -Nathan