Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Mar 2010 19:13:53 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
Subject:   svn commit: r205191 - stable/6/sys/dev/gem
Message-ID:  <201003151913.o2FJDr3L051815@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Mon Mar 15 19:13:52 2010
New Revision: 205191
URL: http://svn.freebsd.org/changeset/base/205191

Log:
  MFC: r204222
  
  According to the Linux sungem driver, in case of Apple (K2) GMACs
  GEM_MIF_CONFIG_MDI0 cannot be trusted when the firmware has powered
  down the chip so the internal transceiver has to be hardcoded. This
  is also in line with the AppleGMACEthernet driver, which just doesn't
  distinguish between internal/external transceiver and MDIO/MDI1
  respectively in the first place. Tested by: Andreas Tobler

Modified:
  stable/6/sys/dev/gem/if_gem.c
Directory Properties:
  stable/6/sys/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/cxgb/   (props changed)

Modified: stable/6/sys/dev/gem/if_gem.c
==============================================================================
--- stable/6/sys/dev/gem/if_gem.c	Mon Mar 15 19:13:49 2010	(r205190)
+++ stable/6/sys/dev/gem/if_gem.c	Mon Mar 15 19:13:52 2010	(r205191)
@@ -298,8 +298,11 @@ gem_attach(struct gem_softc *sc)
 
 	/*
 	 * Fall back on an internal PHY if no external PHY was found.
+	 * Note that with Apple (K2) GMACs GEM_MIF_CONFIG_MDI0 can't be
+	 * trusted when the firmware has powered down the chip.
 	 */
-	if (error != 0 && (v & GEM_MIF_CONFIG_MDI0) != 0) {
+	if (error != 0 &&
+	    ((v & GEM_MIF_CONFIG_MDI0) != 0 || GEM_IS_APPLE(sc))) {
 		v &= ~GEM_MIF_CONFIG_PHY_SEL;
 		GEM_BANK1_WRITE_4(sc, GEM_MIF_CONFIG, v);
 		switch (sc->sc_variant) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003151913.o2FJDr3L051815>