Date: Tue, 3 Apr 2018 04:31:55 +0000 (UTC) From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331906 - head/sys/arm/xilinx Message-ID: <201804030431.w334VtSp086654@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gonzo Date: Tue Apr 3 04:31:54 2018 New Revision: 331906 URL: https://svnweb.freebsd.org/changeset/base/331906 Log: 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> MFC after: 1 week Modified: head/sys/arm/xilinx/zy7_gpio.c Modified: head/sys/arm/xilinx/zy7_gpio.c ============================================================================== --- head/sys/arm/xilinx/zy7_gpio.c Tue Apr 3 03:41:55 2018 (r331905) +++ head/sys/arm/xilinx/zy7_gpio.c Tue Apr 3 04:31:54 2018 (r331906) @@ -298,24 +298,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 @@ -337,9 +319,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?201804030431.w334VtSp086654>