From owner-p4-projects@FreeBSD.ORG Wed Sep 26 22:29:07 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2799816A419; Wed, 26 Sep 2007 22:29:07 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC0EC16A417 for ; Wed, 26 Sep 2007 22:29:06 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8C76613C458 for ; Wed, 26 Sep 2007 22:29:06 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l8QMT60p002100 for ; Wed, 26 Sep 2007 22:29:06 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l8QMT5Qq002097 for perforce@freebsd.org; Wed, 26 Sep 2007 22:29:05 GMT (envelope-from jb@freebsd.org) Date: Wed, 26 Sep 2007 22:29:05 GMT Message-Id: <200709262229.l8QMT5Qq002097@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 126843 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 22:29:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=126843 Change 126843 by jb@jb_freebsd1 on 2007/09/26 22:28:15 IFC Affected files ... .. //depot/projects/dtrace/doc/en_US.ISO8859-1/articles/contributors/contrib.committers.sgml#29 integrate .. //depot/projects/dtrace/doc/en_US.ISO8859-1/articles/contributors/contrib.staff.sgml#9 integrate .. //depot/projects/dtrace/doc/en_US.ISO8859-1/share/sgml/authors.ent#22 integrate .. //depot/projects/dtrace/doc/fr_FR.ISO8859-1/books/handbook/basics/chapter.sgml#5 integrate .. //depot/projects/dtrace/doc/fr_FR.ISO8859-1/books/handbook/ports/chapter.sgml#6 integrate .. //depot/projects/dtrace/doc/share/pgpkeys/pgpkeys-developers.sgml#23 integrate .. //depot/projects/dtrace/doc/share/pgpkeys/pgpkeys.ent#23 integrate .. //depot/projects/dtrace/doc/share/pgpkeys/rpaulo.key#1 branch .. //depot/projects/dtrace/ports/MOVED#39 integrate .. //depot/projects/dtrace/ports/Mk/bsd.perl.mk#2 integrate .. //depot/projects/dtrace/ports/UPDATING#31 integrate .. //depot/projects/dtrace/src/gnu/usr.bin/binutils/ld/Makefile#4 integrate .. //depot/projects/dtrace/src/gnu/usr.bin/man/man/man.c#5 integrate .. //depot/projects/dtrace/src/release/doc/en_US.ISO8859-1/hardware/article.sgml#2 integrate .. //depot/projects/dtrace/src/release/doc/share/misc/dev.archlist.txt#13 integrate .. //depot/projects/dtrace/src/share/man/man4/cxgb.4#2 integrate .. //depot/projects/dtrace/src/share/man/man4/gem.4#6 integrate .. //depot/projects/dtrace/src/sys/amd64/conf/GENERIC#21 integrate .. //depot/projects/dtrace/src/sys/boot/forth/loader.conf#12 integrate .. //depot/projects/dtrace/src/sys/conf/NOTES#29 integrate .. //depot/projects/dtrace/src/sys/dev/gem/if_gem.c#7 integrate .. //depot/projects/dtrace/src/sys/dev/gem/if_gem_pci.c#5 integrate .. //depot/projects/dtrace/src/sys/dev/gem/if_gemreg.h#5 integrate .. //depot/projects/dtrace/src/sys/dev/gem/if_gemvar.h#6 integrate .. //depot/projects/dtrace/src/sys/dev/usb/if_axe.c#8 integrate .. //depot/projects/dtrace/src/sys/dev/usb/if_axereg.h#6 integrate .. //depot/projects/dtrace/src/sys/i386/conf/GENERIC#21 integrate .. //depot/projects/dtrace/src/sys/ia64/conf/GENERIC#10 integrate .. //depot/projects/dtrace/src/sys/kern/vfs_bio.c#11 integrate .. //depot/projects/dtrace/src/sys/modules/Makefile#23 integrate .. //depot/projects/dtrace/src/sys/nfsclient/nfs_bio.c#7 integrate .. //depot/projects/dtrace/src/sys/nfsclient/nfs_nfsiod.c#5 integrate .. //depot/projects/dtrace/src/sys/pc98/conf/GENERIC#11 integrate .. //depot/projects/dtrace/src/sys/powerpc/conf/GENERIC#10 integrate .. //depot/projects/dtrace/src/sys/powerpc/conf/NOTES#9 integrate .. //depot/projects/dtrace/src/sys/sparc64/conf/GENERIC#13 integrate .. //depot/projects/dtrace/src/sys/sparc64/pci/ofw_pcibus.c#7 integrate .. //depot/projects/dtrace/src/sys/sun4v/conf/GENERIC#17 integrate .. //depot/projects/dtrace/src/sys/vm/vm_object.c#13 integrate .. //depot/projects/dtrace/www/de/Makefile#7 integrate .. //depot/projects/dtrace/www/de/about.sgml#7 integrate .. //depot/projects/dtrace/www/de/administration.sgml#2 integrate .. //depot/projects/dtrace/www/de/art.sgml#1 branch .. //depot/projects/dtrace/www/de/developers.sgml#2 integrate .. //depot/projects/dtrace/www/de/features.sgml#5 integrate .. //depot/projects/dtrace/www/de/internet.sgml#6 integrate .. //depot/projects/dtrace/www/de/share/sgml/navibar.l10n.ent#6 integrate .. //depot/projects/dtrace/www/de/share/sgml/news.xml#11 integrate .. //depot/projects/dtrace/www/de/share/sgml/press.xml#10 integrate .. //depot/projects/dtrace/www/en/developers.sgml#19 integrate .. //depot/projects/dtrace/www/share/sgml/news.xml#19 integrate Differences ... ==== //depot/projects/dtrace/doc/en_US.ISO8859-1/articles/contributors/contrib.committers.sgml#29 (text+ko) ==== @@ -1,4 +1,4 @@ - + + The &os; Documentation Engineering Team @@ -309,10 +309,6 @@ &a.murray; - - - &a.rwatson; - @@ -429,9 +425,5 @@ &a.murray; - - - &a.rwatson; - ==== //depot/projects/dtrace/doc/en_US.ISO8859-1/share/sgml/authors.ent#22 (text+ko) ==== @@ -13,7 +13,7 @@ builds for the other languages, and we will poke fun of you in public. - $FreeBSD: doc/en_US.ISO8859-1/share/sgml/authors.ent,v 1.429 2007/08/22 01:09:22 tabthorpe Exp $ + $FreeBSD: doc/en_US.ISO8859-1/share/sgml/authors.ent,v 1.430 2007/09/26 09:52:39 rpaulo Exp $ --> aaron@FreeBSD.org"> @@ -846,6 +846,8 @@ roger@FreeBSD.org"> +rpaulo@FreeBSD.org"> + rpratt@FreeBSD.org"> rrs@FreeBSD.org"> ==== //depot/projects/dtrace/doc/fr_FR.ISO8859-1/books/handbook/basics/chapter.sgml#5 (text+ko) ==== @@ -2,8 +2,8 @@ The FreeBSD Documentation Project The FreeBSD French Documentation Project - $FreeBSD: doc/fr_FR.ISO8859-1/books/handbook/basics/chapter.sgml,v 1.23 2007/07/14 17:53:04 blackend Exp $ - Original revision: 1.148 + $FreeBSD: doc/fr_FR.ISO8859-1/books/handbook/basics/chapter.sgml,v 1.24 2007/09/26 19:44:32 blackend Exp $ + Original revision: 1.149 --> @@ -1888,16 +1888,6 @@ - nodev - - - Ne pas prendre en compte les périphériques - spéciaux sur le système de fichiers. C'est une - option de sécurité utile. - - - - noexec ==== //depot/projects/dtrace/doc/fr_FR.ISO8859-1/books/handbook/ports/chapter.sgml#6 (text+ko) ==== @@ -2,8 +2,8 @@ The FreeBSD Documentation Project The FreeBSD French Documentation Project - $FreeBSD: doc/fr_FR.ISO8859-1/books/handbook/ports/chapter.sgml,v 1.21 2007/07/08 16:48:53 blackend Exp $ - Original revision: 1.265 + $FreeBSD: doc/fr_FR.ISO8859-1/books/handbook/ports/chapter.sgml,v 1.22 2007/09/26 19:44:33 blackend Exp $ + Original revision: 1.268 --> @@ -1433,7 +1433,7 @@ portés, spécifiez l'option . - &prompt.root; portupgrade -PR gnome2 + &prompt.root; portupgrade -PP gnome2 Pour juste récupérer les sources (ou les paquetages, si l'option est ==== //depot/projects/dtrace/doc/share/pgpkeys/pgpkeys-developers.sgml#23 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -769,6 +769,11 @@ &pgpkey.sat; + &a.rpaulo; + &pgpkey.rpaulo; + + &a.mp; &pgpkey.mp; ==== //depot/projects/dtrace/doc/share/pgpkeys/pgpkeys.ent#23 (text+ko) ==== @@ -1,5 +1,5 @@ - + @@ -214,6 +214,7 @@ + ==== //depot/projects/dtrace/ports/MOVED#39 (text+ko) ==== @@ -1,7 +1,7 @@ # # MOVED - a list of (recently) moved or removed ports # -# $FreeBSD: ports/MOVED,v 1.1484 2007/09/24 08:41:09 rafan Exp $ +# $FreeBSD: ports/MOVED,v 1.1485 2007/09/26 11:17:06 rafan Exp $ # # Each entry consists of a single line containing the following four # fields in the order named, separated with the pipe (`|') character: @@ -3242,5 +3242,5 @@ japanese/netypesv||2007-09-18|Has expired: Depends on obsolete version of jdk net-im/micq|net-im/climm|2007-09-18|Project renamed graphics/blender-devel|graphics/blender|2007-09-21|Not needed since binary version is gone -print/ghostscript-afpl||2007-09-24|Replaced by print/ghostscript-gpl -print/ghostscript-afpl-nox11||2007-09-24|Replaced by print/ghostscript-gpl-nox11 +print/ghostscript-afpl|print/ghostscript-gpl|2007-09-24|Replaced by print/ghostscript-gpl +print/ghostscript-afpl-nox11|print/ghostscript-gpl-nox11|2007-09-24|Replaced by print/ghostscript-gpl-nox11 ==== //depot/projects/dtrace/ports/Mk/bsd.perl.mk#2 (text+ko) ==== @@ -1,7 +1,7 @@ #-*- mode: makefile; tab-width: 4; -*- # ex:ts=4 # -# $FreeBSD: ports/Mk/bsd.perl.mk,v 1.4 2007/09/24 23:05:56 linimon Exp $ +# $FreeBSD: ports/Mk/bsd.perl.mk,v 1.6 2007/09/26 00:36:44 linimon Exp $ # # bsd.perl.mk - Support for Perl-based ports. # @@ -73,6 +73,8 @@ # port. The version requirement can be specified # here, as well. # +# WANT_PERL5 - Set this is your port conditionally depends on Perl. +# This MUST appear before the inclusion of bsd.port.pre.mk. .if !defined(_POSTMKINCLUDED) && !defined(Perl_Pre_Include) @@ -182,6 +184,10 @@ .endif # defined(_PERL_REFACTORING_COMPLETE) +.if !defined(PERL) || !defined(PERL5) || !defined(PERL_PORT) || !defined(SITE_PERL) +IGNORE= missing define for WANT_PERL, USE_PERL5, or similar before bsd.port.pre.mk inclusion +.endif + .if defined(PERL_MODBUILD) PERL_CONFIGURE= yes CONFIGURE_SCRIPT?= Build.PL ==== //depot/projects/dtrace/ports/UPDATING#31 (text+ko) ==== @@ -6,6 +6,18 @@ time you update your ports collection, before attempting any port upgrades. +20070926: + AFFECTS: users of devel/p5-gearmand + AUTHOR: clsung@FreeBSD.org + + The port p5-gearmand has been splited up, so Gearman servers can + be embedded into other processes. The Gearman::Server class is + located at devel/p5-Gearman-Server, if you have devel/p5-gearmand + installed, perform an upgrade devel/p5-Gearman-Server with a + command like: + + # portupgrade -o devel/p5-Gearman-Server devel/p5-gearmand + 20070923: AFFECTS: users of emulators/linux_base-fc7 AUTHOR: bsam@FreeBSD.org @@ -5666,4 +5678,4 @@ 2) Update all p5-* modules. portupgrade -f p5-\* -$FreeBSD: ports/UPDATING,v 1.548 2007/09/23 16:33:56 bsam Exp $ +$FreeBSD: ports/UPDATING,v 1.549 2007/09/26 01:23:30 clsung Exp $ ==== //depot/projects/dtrace/src/gnu/usr.bin/binutils/ld/Makefile#4 (text+ko) ==== @@ -1,9 +1,13 @@ -# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.31 2004/12/21 09:59:40 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.32 2007/09/26 01:31:28 marcel Exp $ .include "../Makefile.inc0" .PATH: ${SRCDIR}/ld +.if ${TARGET_ARCH} == "ia64" +CFLAGS+= -O1 +.endif + PROG= ld SCRIPTDIR= /usr/libdata/ldscripts SRCS+= ldcref.c ldctor.c ldemul.c ldemul-list.h ldexp.c ldfile.c \ ==== //depot/projects/dtrace/src/gnu/usr.bin/man/man/man.c#5 (text+ko) ==== @@ -16,7 +16,7 @@ #ifndef lint static const char rcsid[] = - "$FreeBSD: src/gnu/usr.bin/man/man/man.c,v 1.64 2007/09/20 21:37:29 edwin Exp $"; + "$FreeBSD: src/gnu/usr.bin/man/man/man.c,v 1.65 2007/09/25 21:41:22 edwin Exp $"; #endif /* not lint */ #define MAN_MAIN @@ -898,7 +898,7 @@ #endif #if HAVE_LIBZ > 0 - gzgets (fp, buf, BUFSIZ); + end = gzgets (fp, buf, BUFSIZ); gzclose(fp); #else end = fgets (buf, BUFSIZ, fp); ==== //depot/projects/dtrace/src/release/doc/en_US.ISO8859-1/hardware/article.sgml#2 (text+ko) ==== @@ -18,7 +18,7 @@ The &os; Documentation Project - $FreeBSD: src/release/doc/en_US.ISO8859-1/hardware/article.sgml,v 1.325 2007/09/10 17:58:16 brueffer Exp $ + $FreeBSD: src/release/doc/en_US.ISO8859-1/hardware/article.sgml,v 1.326 2007/09/26 21:30:50 brueffer Exp $ 2000 @@ -633,6 +633,8 @@ &hwlist.cue; + &hwlist.cxgb; + &hwlist.dc; &hwlist.de; ==== //depot/projects/dtrace/src/release/doc/share/misc/dev.archlist.txt#13 (text+ko) ==== @@ -23,7 +23,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/release/doc/share/misc/dev.archlist.txt,v 1.99 2007/09/10 17:58:16 brueffer Exp $ +# $FreeBSD: src/release/doc/share/misc/dev.archlist.txt,v 1.100 2007/09/26 21:22:56 brueffer Exp $ # # @@ -72,7 +72,6 @@ ex i386,amd64 fe i386,pc98,amd64 fwohci i386,sparc64,ia64,amd64,powerpc -gem sparc64,powerpc hifn i386,pc98,amd64 hptiop i386,amd64 hptmv i386,amd64 ==== //depot/projects/dtrace/src/share/man/man4/cxgb.4#2 (text+ko) ==== @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.\" $FreeBSD: src/share/man/man4/cxgb.4,v 1.7 2007/03/16 16:07:49 bmah Exp $ +.\" $FreeBSD: src/share/man/man4/cxgb.4,v 1.8 2007/09/26 21:31:47 brueffer Exp $ .\" .Dd March 14, 2007 .Dt CXGB 4 @@ -47,7 +47,7 @@ .Ed .Pp To load the driver as a -module at boot time, place the following lines in +module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent if_cxgb_load="YES" ==== //depot/projects/dtrace/src/share/man/man4/gem.4#6 (text+ko) ==== @@ -31,9 +31,9 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man4/gem.4,v 1.7 2007/06/04 16:59:11 brueffer Exp $ +.\" $FreeBSD: src/share/man/man4/gem.4,v 1.8 2007/09/26 21:14:16 marius Exp $ .\" -.Dd June 4, 2007 +.Dd September 26, 2007 .Dt GEM 4 .Os .Sh NAME @@ -74,6 +74,17 @@ .It Sun GEM Gigabit Ethernet .El +.Pp +The +following add-on cards are known to work with the +.Nm +driver at this time: +.Pp +.Bl -bullet -compact +.It +Sun Gigabit Ethernet PCI 2.0/3.0 (GBE/P) +(part no.\& 501-4373) +.El .Sh NOTES On sparc64 the .Nm @@ -100,11 +111,7 @@ .Sh CAVEATS Currently the .Nm -driver fails to attach to Sun Gigabit Ethernet 2.0/3.0 (GBE/P) cards, -as the SERDES used on these cards is not supported so far. -The -.Nm -driver will also fail to probe and attach to Sun Gigabit Ethernet 2.0/3.0 (GBE/S) cards, +driver fails to attach to Sun Gigabit Ethernet SBus 2.0/3.0 (GBE/S) cards, as no SBus front-end has been written so far. .Sh SEE ALSO .Xr altq 4 , ==== //depot/projects/dtrace/src/sys/amd64/conf/GENERIC#21 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.483 2007/07/01 21:47:45 njl Exp $ +# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.484 2007/09/26 20:05:06 brueffer Exp $ cpu HAMMER ident GENERIC @@ -30,7 +30,7 @@ options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols -options SCTP # Stream Transmission Control Protocol +options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists ==== //depot/projects/dtrace/src/sys/boot/forth/loader.conf#12 (text+ko) ==== @@ -6,7 +6,7 @@ # # All arguments must be in double quotes. # -# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.121 2007/06/25 05:06:55 rafan Exp $ +# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.122 2007/09/26 08:38:25 ru Exp $ ############################################################## ### Basic configuration options ############################ @@ -44,7 +44,8 @@ #autoboot_delay="10" # Delay in seconds before autobooting, # set to -1 if you don't want user to be # allowed to interrupt autoboot process and - # escape to the loader prompt + # escape to the loader prompt, set to + # "NO" to disable autobooting #beastie_disable="NO" # Turn the beastie boot menu on and off #loader_logo="fbsdbw" # Desired logo: fbsdbw, beastiebw, beastie, none #comconsole_speed="9600" # Set the current serial console speed ==== //depot/projects/dtrace/src/sys/conf/NOTES#29 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1453 2007/09/23 07:34:22 pjd Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1454 2007/09/26 21:14:17 marius Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -1766,6 +1766,7 @@ # fpa: Support for the Digital DEFPA PCI FDDI. `device fddi' is also needed. # fxp: Intel EtherExpress Pro/100B # (hint of prefer_iomap can be done to prefer I/O instead of Mem mapping) +# gem: Apple GMAC/Sun ERI/Sun GEM # hme: Sun HME (Happy Meal Ethernet) # le: AMD Am7900 LANCE and Am79C9xx PCnet # lge: Support for PCI gigabit ethernet adapters based on the Level 1 @@ -1880,6 +1881,7 @@ device dc # DEC/Intel 21143 and various workalikes device fxp # Intel EtherExpress PRO/100B (82557, 82558) hint.fxp.0.prefer_iomap="0" +device gem # Apple GMAC/Sun ERI/Sun GEM device hme # Sun HME (Happy Meal Ethernet) device lge # Level 1 LXT1001 gigabit Ethernet device my # Myson Fast Ethernet (MTD80X, MTD89X) ==== //depot/projects/dtrace/src/sys/dev/gem/if_gem.c#7 (text+ko) ==== @@ -28,10 +28,10 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/gem/if_gem.c,v 1.43 2007/06/16 23:27:59 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/gem/if_gem.c,v 1.44 2007/09/26 21:14:17 marius Exp $"); /* - * Driver for Sun GEM ethernet controllers. + * Driver for Apple GMAC, Sun ERI and Sun GEM Ethernet controllers */ #if 0 @@ -80,7 +80,11 @@ #include #include +CTASSERT(powerof2(GEM_NRXDESC) && GEM_NRXDESC >= 32 && GEM_NRXDESC <= 8192); +CTASSERT(powerof2(GEM_NTXDESC) && GEM_NTXDESC >= 32 && GEM_NTXDESC <= 8192); + #define TRIES 10000 + /* * The GEM hardware support basic TCP/UDP checksum offloading. However, * the hardware doesn't compensate the checksum for UDP datagram which @@ -102,14 +106,16 @@ static void gem_init(void *); static void gem_init_locked(struct gem_softc *); static void gem_init_regs(struct gem_softc *); -static int gem_ringsize(int sz); +static u_int gem_ringsize(u_int); static int gem_meminit(struct gem_softc *); static struct mbuf *gem_defrag(struct mbuf *, int, int); static int gem_load_txmbuf(struct gem_softc *, struct mbuf **); static void gem_mifinit(struct gem_softc *); static int gem_bitwait(struct gem_softc *, bus_addr_t, u_int32_t, u_int32_t); +static void gem_reset(struct gem_softc *); static int gem_reset_rx(struct gem_softc *); +static void gem_reset_rxdma(struct gem_softc *sc); static int gem_reset_tx(struct gem_softc *); static int gem_disable_rx(struct gem_softc *); static int gem_disable_tx(struct gem_softc *); @@ -124,9 +130,6 @@ static void gem_rint_timeout(void *); #endif static void gem_tint(struct gem_softc *); -#ifdef notyet -static void gem_power(int, void *); -#endif devclass_t gem_devclass; DRIVER_MODULE(miibus, gem, miibus_driver, miibus_devclass, 0, 0); @@ -149,7 +152,6 @@ struct gem_softc *sc; { struct ifnet *ifp; - struct mii_softc *child; int i, error; u_int32_t v; @@ -164,10 +166,7 @@ /* Make sure the chip is stopped. */ ifp->if_softc = sc; - GEM_LOCK(sc); - gem_stop(ifp, 0); gem_reset(sc); - GEM_UNLOCK(sc); error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, @@ -257,11 +256,73 @@ sc->sc_rxsoft[i].rxs_mbuf = NULL; } + /* Bad things will happen when touching this register on ERI. */ + if (sc->sc_variant != GEM_SUN_ERI) + bus_write_4(sc->sc_res[0], GEM_MII_DATAPATH_MODE, + GEM_MII_DATAPATH_MII); + gem_mifinit(sc); - if ((error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, gem_mediachange, - gem_mediastatus)) != 0) { - device_printf(sc->sc_dev, "phy probe failed: %d\n", error); + /* + * Look for an external PHY. + */ + error = ENXIO; + v = bus_read_4(sc->sc_res[0], GEM_MIF_CONFIG); + if ((v & GEM_MIF_CONFIG_MDI1) != 0) { + v |= GEM_MIF_CONFIG_PHY_SEL; + bus_write_4(sc->sc_res[0], GEM_MIF_CONFIG, v); + switch (sc->sc_variant) { + case GEM_SUN_ERI: + sc->sc_phyad = GEM_PHYAD_EXTERNAL; + break; + default: + sc->sc_phyad = -1; + break; + } + error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, + gem_mediachange, gem_mediastatus); + } + + /* + * Fall back on an internal PHY if no external PHY was found. + */ + if (error != 0 && (v & GEM_MIF_CONFIG_MDI0) != 0) { + v &= ~GEM_MIF_CONFIG_PHY_SEL; + bus_write_4(sc->sc_res[0], GEM_MIF_CONFIG, v); + switch (sc->sc_variant) { + case GEM_SUN_ERI: + case GEM_APPLE_K2_GMAC: + sc->sc_phyad = GEM_PHYAD_INTERNAL; + break; + case GEM_APPLE_GMAC: + sc->sc_phyad = GEM_PHYAD_EXTERNAL; + break; + default: + sc->sc_phyad = -1; + break; + } + error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, + gem_mediachange, gem_mediastatus); + } + + /* + * Try the external PCS SERDES if we didn't find any PHYs. + */ + if (error != 0 && sc->sc_variant == GEM_SUN_GEM) { + bus_write_4(sc->sc_res[0], GEM_MII_DATAPATH_MODE, + GEM_MII_DATAPATH_SERDES); + bus_write_4(sc->sc_res[0], GEM_MII_SLINK_CONTROL, + GEM_MII_SLINK_LOOPBACK | GEM_MII_SLINK_EN_SYNC_D); + bus_write_4(sc->sc_res[0], GEM_MII_CONFIG, + GEM_MII_CONFIG_ENABLE); + sc->sc_flags |= GEM_SERDES; + sc->sc_phyad = GEM_PHYAD_EXTERNAL; + error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, + gem_mediachange, gem_mediastatus); + } + + if (error != 0) { + device_printf(sc->sc_dev, "PHY probe failed: %d\n", error); goto fail_rxd; } sc->sc_mii = device_get_softc(sc->sc_miibus); @@ -293,64 +354,10 @@ IFQ_SET_MAXLEN(&ifp->if_snd, GEM_TXQUEUELEN); ifp->if_snd.ifq_drv_maxlen = GEM_TXQUEUELEN; IFQ_SET_READY(&ifp->if_snd); - /* - * Walk along the list of attached MII devices and - * establish an `MII instance' to `phy number' - * mapping. We'll use this mapping in media change - * requests to determine which phy to use to program - * the MIF configuration register. - */ - for (child = LIST_FIRST(&sc->sc_mii->mii_phys); child != NULL; - child = LIST_NEXT(child, mii_list)) { - /* - * Note: we support just two PHYs: the built-in - * internal device and an external on the MII - * connector. - */ - if (child->mii_phy > 1 || child->mii_inst > 1) { - device_printf(sc->sc_dev, "cannot accomodate " - "MII device %s at phy %d, instance %d\n", - device_get_name(child->mii_dev), - child->mii_phy, child->mii_inst); - continue; - } - sc->sc_phys[child->mii_inst] = child->mii_phy; - } - - /* - * Now select and activate the PHY we will use. - * - * The order of preference is External (MDI1), - * Internal (MDI0), Serial Link (no MII). - */ - if (sc->sc_phys[1]) { -#ifdef GEM_DEBUG - printf("using external phy\n"); -#endif - sc->sc_mif_config |= GEM_MIF_CONFIG_PHY_SEL; - } else { -#ifdef GEM_DEBUG - printf("using internal phy\n"); -#endif - sc->sc_mif_config &= ~GEM_MIF_CONFIG_PHY_SEL; - } - bus_write_4(sc->sc_res[0], GEM_MIF_CONFIG, - sc->sc_mif_config); /* Attach the interface. */ ether_ifattach(ifp, sc->sc_enaddr); -#ifdef notyet - /* - * Add a suspend hook to make sure we come back up after a - * resume. - */ - sc->sc_powerhook = powerhook_establish(gem_power, sc); - if (sc->sc_powerhook == NULL) - device_printf(sc->sc_dev, "WARNING: unable to establish power " - "hook\n"); -#endif - /* * Tell the upper layer(s) we support long frames/checksum offloads. */ @@ -455,7 +462,7 @@ * On resume all registers have to be initialized again like * after power-on. */ - sc->sc_inited = 0; + sc->sc_flags &= ~GEM_INITED; if (ifp->if_flags & IFF_UP) gem_init_locked(sc); GEM_UNLOCK(sc); @@ -580,7 +587,7 @@ return; if (nsegs != 1) { /* can't happen... */ - panic("gem_cddma_callback: bad control buffer segment count"); + panic("%s: bad control buffer segment count", __func__); } sc->sc_cddma = segs[0].ds_addr; } @@ -638,7 +645,7 @@ return (0); } -void +static void gem_reset(sc) struct gem_softc *sc; { @@ -651,11 +658,11 @@ /* Do a full reset */ bus_write_4(sc->sc_res[0], GEM_RESET, GEM_RESET_RX | GEM_RESET_TX); + bus_barrier(sc->sc_res[0], GEM_RESET, 4, BUS_SPACE_BARRIER_WRITE); if (!gem_bitwait(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, 0)) device_printf(sc->sc_dev, "cannot reset device\n"); } - /* * gem_rxdrain: * @@ -698,7 +705,7 @@ callout_stop(&sc->sc_tick_ch); #ifdef GEM_RINT_TIMEOUT callout_stop(&sc->sc_rx_ch); -#endif +#endif /* XXX - Should we reset these instead? */ gem_disable_tx(sc); @@ -728,13 +735,14 @@ * Mark the interface down and cancel the watchdog timer. */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->sc_flags &= ~GEM_LINK; sc->sc_wdog_timer = 0; } /* * Reset the receiver */ -int +static int gem_reset_rx(sc) struct gem_softc *sc; { @@ -745,24 +753,63 @@ */ gem_disable_rx(sc); bus_write_4(sc->sc_res[0], GEM_RX_CONFIG, 0); - /* Wait till it finishes */ - if (!gem_bitwait(sc, GEM_RX_CONFIG, 1, 0)) - device_printf(sc->sc_dev, "cannot disable read dma\n"); + bus_barrier(sc->sc_res[0], GEM_RX_CONFIG, 4, BUS_SPACE_BARRIER_WRITE); + if (!gem_bitwait(sc, GEM_RX_CONFIG, GEM_RX_CONFIG_RXDMA_EN, 0)) + device_printf(sc->sc_dev, "cannot disable RX DMA\n"); - /* Wait 5ms extra. */ - DELAY(5000); - /* Finally, reset the ERX */ bus_write_4(sc->sc_res[0], GEM_RESET, GEM_RESET_RX); - /* Wait till it finishes */ - if (!gem_bitwait(sc, GEM_RESET, GEM_RESET_RX, 0)) { + bus_barrier(sc->sc_res[0], GEM_RESET, 4, BUS_SPACE_BARRIER_WRITE); + if (!gem_bitwait(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, 0)) { device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } return (0); } +/* + * Reset the receiver DMA engine. + * + * Intended to be used in case of GEM_INTR_RX_TAG_ERR, GEM_MAC_RX_OVERFLOW + * etc in order to reset the receiver DMA engine only and not do a full + * reset which amongst others also downs the link and clears the FIFOs. + */ +static void +gem_reset_rxdma(struct gem_softc *sc) +{ + int i; + if (gem_reset_rx(sc) != 0) + return (gem_init_locked(sc)); + for (i = 0; i < GEM_NRXDESC; i++) + if (sc->sc_rxsoft[i].rxs_mbuf != NULL) + GEM_UPDATE_RXDESC(sc, i); + sc->sc_rxptr = 0; + GEM_CDSYNC(sc, BUS_DMASYNC_PREWRITE); + GEM_CDSYNC(sc, BUS_DMASYNC_PREREAD); + + /* NOTE: we use only 32-bit DMA addresses here. */ + bus_write_4(sc->sc_res[0], GEM_RX_RING_PTR_HI, 0); + bus_write_4(sc->sc_res[0], GEM_RX_RING_PTR_LO, GEM_CDRXADDR(sc, 0)); + bus_write_4(sc->sc_res[0], GEM_RX_KICK, GEM_NRXDESC - 4); + bus_write_4(sc->sc_res[0], GEM_RX_CONFIG, + gem_ringsize(GEM_NRXDESC /*XXX*/) | + ((ETHER_HDR_LEN + sizeof(struct ip)) << + GEM_RX_CONFIG_CXM_START_SHFT) | + (GEM_THRSH_1024 << GEM_RX_CONFIG_FIFO_THRS_SHIFT) | + (2 << GEM_RX_CONFIG_FBOFF_SHFT)); + bus_write_4(sc->sc_res[0], GEM_RX_BLANKING, + (6 << GEM_RX_BLANKING_TIME_SHIFT) | 6); + bus_write_4(sc->sc_res[0], GEM_RX_PAUSE_THRESH, + (3 * sc->sc_rxfifosize / 256) | ((sc->sc_rxfifosize / 256) << 12)); + bus_write_4(sc->sc_res[0], GEM_RX_CONFIG, + bus_read_4(sc->sc_res[0], GEM_RX_CONFIG) | GEM_RX_CONFIG_RXDMA_EN); + bus_write_4(sc->sc_res[0], GEM_MAC_RX_MASK, + GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT); + bus_write_4(sc->sc_res[0], GEM_MAC_RX_CONFIG, + bus_read_4(sc->sc_res[0], GEM_MAC_RX_CONFIG) | GEM_MAC_RX_ENABLE); +} + /* * Reset the transmitter */ @@ -770,7 +817,6 @@ gem_reset_tx(sc) struct gem_softc *sc; { - int i; /* * Resetting while DMA is in progress can cause a bus hang, so we @@ -778,21 +824,15 @@ */ gem_disable_tx(sc); bus_write_4(sc->sc_res[0], GEM_TX_CONFIG, 0); - /* Wait till it finishes */ - if (!gem_bitwait(sc, GEM_TX_CONFIG, 1, 0)) - device_printf(sc->sc_dev, "cannot disable read dma\n"); - - /* Wait 5ms extra. */ - DELAY(5000); + bus_barrier(sc->sc_res[0], GEM_TX_CONFIG, 4, BUS_SPACE_BARRIER_WRITE); + if (!gem_bitwait(sc, GEM_TX_CONFIG, GEM_TX_CONFIG_TXDMA_EN, 0)) + device_printf(sc->sc_dev, "cannot disable TX DMA\n"); /* Finally, reset the ETX */ bus_write_4(sc->sc_res[0], GEM_RESET, GEM_RESET_TX); - /* Wait till it finishes */ - for (i = TRIES; i--; DELAY(100)) - if ((bus_read_4(sc->sc_res[0], GEM_RESET) & GEM_RESET_TX) == 0) - break; - if (!gem_bitwait(sc, GEM_RESET, GEM_RESET_TX, 0)) { - device_printf(sc->sc_dev, "cannot reset receiver\n"); + bus_barrier(sc->sc_res[0], GEM_RESET, 4, BUS_SPACE_BARRIER_WRITE); + if (!gem_bitwait(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, 0)) { + device_printf(sc->sc_dev, "cannot reset transmitter\n"); return (1); } return (0); @@ -811,8 +851,8 @@ cfg = bus_read_4(sc->sc_res[0], GEM_MAC_RX_CONFIG); cfg &= ~GEM_MAC_RX_ENABLE; bus_write_4(sc->sc_res[0], GEM_MAC_RX_CONFIG, cfg); - - /* Wait for it to finish */ + bus_barrier(sc->sc_res[0], GEM_MAC_RX_CONFIG, 4, + BUS_SPACE_BARRIER_WRITE); return (gem_bitwait(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)); } @@ -829,8 +869,8 @@ cfg = bus_read_4(sc->sc_res[0], GEM_MAC_TX_CONFIG); cfg &= ~GEM_MAC_TX_ENABLE; bus_write_4(sc->sc_res[0], GEM_MAC_TX_CONFIG, cfg); - - /* Wait for it to finish */ + bus_barrier(sc->sc_res[0], GEM_MAC_TX_CONFIG, 4, + BUS_SPACE_BARRIER_WRITE); return (gem_bitwait(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)); } @@ -883,45 +923,34 @@ return (0); } -static int +static u_int gem_ringsize(sz) - int sz; + u_int sz; { - int v = 0; switch (sz) { case 32: - v = GEM_RING_SZ_32; - break; + return (GEM_RING_SZ_32); case 64: - v = GEM_RING_SZ_64; - break; + return (GEM_RING_SZ_64); case 128: - v = GEM_RING_SZ_128; - break; + return (GEM_RING_SZ_128); case 256: - v = GEM_RING_SZ_256; - break; + return (GEM_RING_SZ_256); case 512: - v = GEM_RING_SZ_512; - break; + return (GEM_RING_SZ_512); case 1024: - v = GEM_RING_SZ_1024; - break; + return (GEM_RING_SZ_1024); case 2048: - v = GEM_RING_SZ_2048; - break; + return (GEM_RING_SZ_2048); case 4096: - v = GEM_RING_SZ_4096; - break; + return (GEM_RING_SZ_4096); case 8192: - v = GEM_RING_SZ_8192; - break; + return (GEM_RING_SZ_8192); default: - printf("gem: invalid Receive Descriptor ring size\n"); - break; + printf("%s: invalid ring size %d\n", __func__, sz); + return (GEM_RING_SZ_32); } - return (v); } static void @@ -971,7 +1000,8 @@ gem_mifinit(sc); /* step 3. Setup data structures in host memory */ - gem_meminit(sc); + if (gem_meminit(sc) != 0) + return; >>> TRUNCATED FOR MAIL (1000 lines) <<<