From 88574818401000d8d927fbb4acdd32483a1dac94 Mon Sep 17 00:00:00 2001 From: Oleksandr Tymoshenko Date: Tue, 3 Apr 2018 04:31:54 +0000 Subject: [PATCH] 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 MFC after: 1 week --- sys/arm/xilinx/zy7_gpio.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/sys/arm/xilinx/zy7_gpio.c b/sys/arm/xilinx/zy7_gpio.c index b9f6b3c04d99..8f9a1a05af9b 100644 --- a/sys/arm/xilinx/zy7_gpio.c +++ b/sys/arm/xilinx/zy7_gpio.c @@ -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 @@ -338,9 +320,6 @@ zy7_gpio_attach(device_t dev) return (ENOMEM); } - /* Completely reset. */ - zy7_gpio_hw_reset(sc); - sc->busdev = gpiobus_attach_bus(dev); if (sc->busdev == NULL) { zy7_gpio_detach(dev);