Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 2018 01:54:13 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328964 - head/sys/arm/allwinner
Message-ID:  <201802070154.w171sD4P049906@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Wed Feb  7 01:54:13 2018
New Revision: 328964
URL: https://svnweb.freebsd.org/changeset/base/328964

Log:
  if_awg: Skip emac reset if configured for internal PHY
  
  On the OrangePi One at least, emac reset when an ethernet cable is not
  plugged in seems to break ethernet. Soft reset will fail, even with
  increasing the delay and retries to wait for up to 20 seconds. This can be
  reproduced across at least two different OrangePi One's by simply leaving
  ethernet cable unplugged when awg attaches. Whether it's plugged in or not
  through u-boot process makes no difference.
  
  Skipping the reset in this configuration doesn't seem to cause any problems,
  tried across many many reboots with and without ethernet cable plugged in.
  
  Tested on:	OrangePi One
  Tested on:	Other boards (manu)
  Reviewed by:	manu
  Differential Revision:	https://reviews.freebsd.org/D13974

Modified:
  head/sys/arm/allwinner/if_awg.c

Modified: head/sys/arm/allwinner/if_awg.c
==============================================================================
--- head/sys/arm/allwinner/if_awg.c	Wed Feb  7 01:24:49 2018	(r328963)
+++ head/sys/arm/allwinner/if_awg.c	Wed Feb  7 01:54:13 2018	(r328964)
@@ -1834,9 +1834,11 @@ awg_attach(device_t dev)
 	awg_get_eaddr(dev, eaddr);
 
 	/* Soft reset EMAC core */
-	error = awg_reset(dev);
-	if (error != 0)
-		return (error);
+	if (!awg_has_internal_phy(dev)) {
+		error = awg_reset(dev);
+		if (error != 0)
+			return (error);
+	}
 
 	/* Setup DMA descriptors */
 	error = awg_setup_dma(dev);



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