Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 May 2018 02:26:50 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r333619 - stable/11/sys/arm/xilinx
Message-ID:  <201805150226.w4F2QoZe027176@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Tue May 15 02:26:50 2018
New Revision: 333619
URL: https://svnweb.freebsd.org/changeset/base/333619

Log:
  MFC r331906:
  
  Approved by:	re (gjb)
  
  Fix accidental USB port resets by GPIO on Zynq/Zedboard boards
  
  The Zynq/Zedboard GPIO driver attempts to tri-state all GPIO pins on
  boot up but the order in which I reset the hardware can cause the pins
  to be briefly held low before being tri-stated.  This is a problem on
  boards that use GPIO pins to reset devices.
  
  In particular, the Zybo and ZC-706 boards use a GPIO pin as a USB PHY
  reset.  If U-boot enables the USB port before booting the kernel, the
  GPIO driver attach causes a glitch on the USB PHY reset and the USB
  port loses power.  My fix is to have the GPIO driver leave the pins in
  whatever configuration U-boot placed them.
  
  PR:		225713
  Submitted by:	Thomas Skibo <thoma555-bsd@yahoo.com>

Modified:
  stable/11/sys/arm/xilinx/zy7_gpio.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/arm/xilinx/zy7_gpio.c
==============================================================================
--- stable/11/sys/arm/xilinx/zy7_gpio.c	Tue May 15 00:50:09 2018	(r333618)
+++ stable/11/sys/arm/xilinx/zy7_gpio.c	Tue May 15 02:26:50 2018	(r333619)
@@ -297,24 +297,6 @@ zy7_gpio_probe(device_t dev)
 	return (0);
 }
 
-static void
-zy7_gpio_hw_reset(struct zy7_gpio_softc *sc)
-{
-	int i;
-
-	for (i = 0; i < NUMBANKS; i++) {
-		WR4(sc, ZY7_GPIO_DATA(i), 0);
-		WR4(sc, ZY7_GPIO_DIRM(i), 0);
-		WR4(sc, ZY7_GPIO_OEN(i), 0);
-		WR4(sc, ZY7_GPIO_INT_DIS(i), 0xffffffff);
-		WR4(sc, ZY7_GPIO_INT_POLARITY(i), 0);
-		WR4(sc, ZY7_GPIO_INT_TYPE(i),
-		    i == 1 ? 0x003fffff : 0xffffffff);
-		WR4(sc, ZY7_GPIO_INT_ANY(i), 0);
-		WR4(sc, ZY7_GPIO_INT_STAT(i), 0xffffffff);
-	}
-}
-
 static int zy7_gpio_detach(device_t dev);
 
 static int
@@ -336,9 +318,6 @@ zy7_gpio_attach(device_t dev)
 		zy7_gpio_detach(dev);
 		return (ENOMEM);
 	}
-
-	/* Completely reset. */
-	zy7_gpio_hw_reset(sc);
 
 	sc->busdev = gpiobus_attach_bus(dev);
 	if (sc->busdev == NULL) {



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