From owner-freebsd-stable@FreeBSD.ORG Thu Nov 22 02:09:07 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 934A3BF4 for ; Thu, 22 Nov 2012 02:09:07 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 581D08FC12 for ; Thu, 22 Nov 2012 02:09:07 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id kp6so5704782pab.13 for ; Wed, 21 Nov 2012 18:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=+1dFY7TAjPmi00f5epsexUAmhHEO+dVnFVr3Pc2McZg=; b=M/GRaV1ZsioBPS8moYBvO7QdrHjP90xRzMC4blWaPxlnXxMY0zcUtrv5MdpbHAExzQ jiai3CmAkF/aOLdVKaAeOJcG6aC00BcpgI3XfYq8xOTssIV6MsE1srEoPQgFIQewbIHW 67Y4CpdaGbZM2Q9m19vpD0vG1wV/1KwYLNJSM/62G+o+hIPoJsQG3dUosCUZv0V5kCWt TVbSh/UBTxpdQtYUeplX4b0SHIv+rN6CEWLs0/m1w2lCjFTDA6Dj5LbqvazwZLNi1PKu fgdXOdUv+osfv3HnSEnWXrmVoB/JDttJ+VgAqAHAvVeG2f0cWPmWjA25nCKAqDQTjLHM FXHw== Received: by 10.66.81.42 with SMTP id w10mr22686466pax.66.1353550141045; Wed, 21 Nov 2012 18:09:01 -0800 (PST) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPS id i4sm976165pav.20.2012.11.21.18.08.57 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 18:08:59 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 22 Nov 2012 11:08:51 +0900 From: YongHyeon PYUN Date: Thu, 22 Nov 2012 11:08:51 +0900 To: Richard Kuhns Subject: Re: bge on the new Mac Mini Message-ID: <20121122020851.GB3180@michelle.cdnetworks.com> References: <50A65BFC.7030406@wintek.com> <20121120085200.GB1778@michelle.cdnetworks.com> <50AD32A6.8080209@wintek.com> <20121122014921.GA3180@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline In-Reply-To: <20121122014921.GA3180@michelle.cdnetworks.com> User-Agent: Mutt/1.4.2.3i Cc: "freebsd-stable@freebsd.org" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 02:09:07 -0000 --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 22, 2012 at 10:49:21AM +0900, YongHyeon PYUN wrote: > On Wed, Nov 21, 2012 at 02:59:34PM -0500, Richard Kuhns wrote: > > On 11/20/12 03:52, YongHyeon PYUN wrote: > > > On Fri, Nov 16, 2012 at 10:30:04AM -0500, Richard Kuhns wrote: > > >> Hi all, > > >> > > >> Over the last month or so I've installed FreeBSD 9 (-stable) on several Mac > > >> Minis via the memstick image; they seem to be pretty good little boxes for > > >> things like offsite secondary nameservers, for example, and they're easily > > >> replaced in case of problems. > > >> > > >> However, the newest minis have slightly different hardware, and FreeBSD can't > > >> find the built-in NIC. pciconf -lv on the new mini shows it as > > >> > > >> none3@pci0:1:0:0: class=0x020000 card=0x168614e4 chip=0x168614e4 rev=0x01 > > > > > > It seems this controller is BCM57766. > > > > > >> hdr=0x00 > > >> vendor = 'Broadcom Corporation' > > >> class = network > > >> subclass = ethernet > > >> > > >> The previous edition mini (that works) reports > > >> > > >> bge0@pci0:2:0:0: class=0x020000 card=0x16b414e4 chip=0x16b414e4 rev=0x10 hdr=0x00 > > >> vendor = 'Broadcom Corporation' > > >> device = 'NetXtreme BCM57765 Gigabit Ethernet PCIe' > > >> class = network > > >> subclass = ethernet > > >> > > >> Is there a chance that adding the new card/chip info to the current driver would > > >> allow it to work? I'll be happy to test and report back. I'm afraid I'm not > > >> familiar enough with hardware at that level to figure out the patch myself. > > >> > > > > > > Try attached patch and let me know whether the patch works or not. > > > If the patch works please share dmesg output(bge(4) and brgphy(4) > > > output only). > > > Note, the patch was generated against CURRENT. > > > > > > > I'm afraid it didn't help. I ended up grabbing if_bge.c and if_bgereg.h from > > I guess you also need to copy brgphy.c from HEAD to > /usr/src/sys/dev/mii directory. > > > HEAD using svnweb.freebsd.org. The patch installed cleanly and there were no > > errors during the build, but still no NIC. > > Does it mean you're not seeing bge0 interface? Or you can't pass > any traffic via bge0? Oops, it seems I've not included your device ID in the diff. Try attach one instead. Make sure you use brgphy.c from HEAD. --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bge.57766.diff2" Index: sys/dev/bge/if_bgereg.h =================================================================== --- sys/dev/bge/if_bgereg.h (revision 243366) +++ sys/dev/bge/if_bgereg.h (working copy) @@ -360,6 +360,7 @@ #define BGE_ASICREV_BCM5784 0x5784 #define BGE_ASICREV_BCM5785 0x5785 #define BGE_ASICREV_BCM57765 0x57785 +#define BGE_ASICREV_BCM57766 0x57766 #define BGE_ASICREV_BCM57780 0x57780 /* chip revisions */ @@ -2483,7 +2484,9 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5906M 0x1713 #define BCOM_DEVICEID_BCM57760 0x1690 #define BCOM_DEVICEID_BCM57761 0x16B0 +#define BCOM_DEVICEID_BCM57762 0x1682 #define BCOM_DEVICEID_BCM57765 0x16B4 +#define BCOM_DEVICEID_BCM57766 0x1686 #define BCOM_DEVICEID_BCM57780 0x1692 #define BCOM_DEVICEID_BCM57781 0x16B1 #define BCOM_DEVICEID_BCM57785 0x16B5 @@ -2961,6 +2964,7 @@ struct bge_softc { #define BGE_FLAG_5755_PLUS 0x00100000 #define BGE_FLAG_5788 0x00200000 #define BGE_FLAG_5717_PLUS 0x00400000 +#define BGE_FLAG_57765_PLUS 0x00800000 #define BGE_FLAG_40BIT_BUG 0x01000000 #define BGE_FLAG_4G_BNDRY_BUG 0x02000000 #define BGE_FLAG_RX_ALIGNBUG 0x04000000 Index: sys/dev/bge/if_bge.c =================================================================== --- sys/dev/bge/if_bge.c (revision 243366) +++ sys/dev/bge/if_bge.c (working copy) @@ -216,7 +216,9 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5906M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57760 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57761 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57762 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57765 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57766 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57780 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57781 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM57785 }, @@ -347,6 +349,7 @@ static const struct bge_revision bge_majorrevs[] = { BGE_ASICREV_BCM5787, "unknown BCM5754/5787" }, { BGE_ASICREV_BCM5906, "unknown BCM5906" }, { BGE_ASICREV_BCM57765, "unknown BCM57765" }, + { BGE_ASICREV_BCM57766, "unknown BCM57766" }, { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { BGE_ASICREV_BCM5717, "unknown BCM5717" }, { BGE_ASICREV_BCM5719, "unknown BCM5719" }, @@ -362,6 +365,7 @@ static const struct bge_revision bge_majorrevs[] = #define BGE_IS_575X_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_575X_PLUS) #define BGE_IS_5755_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5755_PLUS) #define BGE_IS_5717_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5717_PLUS) +#define BGE_IS_57765_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_57765_PLUS) const struct bge_revision * bge_lookup_rev(uint32_t); const struct bge_vendor * bge_lookup_vendor(uint16_t); @@ -2243,7 +2247,7 @@ bge_blockinit(struct bge_softc *sc) } else if (!BGE_IS_5705_PLUS(sc)) limit = BGE_RX_RINGS_MAX; else if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM57765) + BGE_IS_57765_PLUS(sc)) limit = 4; else limit = 1; @@ -2658,6 +2662,7 @@ bge_probe(device_t dev) break; case BCOM_DEVICEID_BCM57761: case BCOM_DEVICEID_BCM57765: + case BCOM_DEVICEID_BCM57766: case BCOM_DEVICEID_BCM57781: case BCOM_DEVICEID_BCM57785: case BCOM_DEVICEID_BCM57791: @@ -3321,10 +3326,13 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM57765: + case BGE_ASICREV_BCM57766: + sc->bge_flags |= BGE_FLAG_57765_PLUS; + /* FALLTHROUGH */ case BGE_ASICREV_BCM5717: case BGE_ASICREV_BCM5719: case BGE_ASICREV_BCM5720: - case BGE_ASICREV_BCM57765: sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO | BGE_FLAG_JUMBO_FRAME; @@ -3738,12 +3746,9 @@ bge_attach(device_t dev) sc->bge_phy_flags |= BGE_PHY_NO_3LED; if ((BGE_IS_5705_PLUS(sc)) && sc->bge_asicrev != BGE_ASICREV_BCM5906 && - sc->bge_asicrev != BGE_ASICREV_BCM5717 && - sc->bge_asicrev != BGE_ASICREV_BCM5719 && - sc->bge_asicrev != BGE_ASICREV_BCM5720 && sc->bge_asicrev != BGE_ASICREV_BCM5785 && - sc->bge_asicrev != BGE_ASICREV_BCM57765 && - sc->bge_asicrev != BGE_ASICREV_BCM57780) { + sc->bge_asicrev != BGE_ASICREV_BCM57780 && + !BGE_IS_5717_PLUS(sc)) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || --M9NhX3UHpAaciwkO--