From owner-svn-src-stable@freebsd.org Tue May 15 02:26:51 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9941CEB1428; Tue, 15 May 2018 02:26:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2221C77844; Tue, 15 May 2018 02:26:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF41224CE7; Tue, 15 May 2018 02:26:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4F2Qo0a027177; Tue, 15 May 2018 02:26:50 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4F2QoZe027176; Tue, 15 May 2018 02:26:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201805150226.w4F2QoZe027176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 15 May 2018 02:26:50 +0000 (UTC) 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 X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/arm/xilinx X-SVN-Commit-Revision: 333619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2018 02:26:51 -0000 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 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) {