diff options
author | gonzo <gonzo@FreeBSD.org> | 2018-05-15 02:26:50 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2018-05-15 02:26:50 +0000 |
commit | 42c4d9bf1c4ca85d48cf3e9c77f25483b8d80bc5 (patch) | |
tree | 202c83540af2530daea1f9acf1f1369b1b1670e3 /sys/arm | |
parent | f1afbe1d6861786f718f4d6e1f9788b788d7aa70 (diff) | |
download | FreeBSD-src-42c4d9bf1c4ca85d48cf3e9c77f25483b8d80bc5.zip FreeBSD-src-42c4d9bf1c4ca85d48cf3e9c77f25483b8d80bc5.tar.gz |
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>
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/xilinx/zy7_gpio.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/sys/arm/xilinx/zy7_gpio.c b/sys/arm/xilinx/zy7_gpio.c index 25d22f8..ad2a056 100644 --- a/sys/arm/xilinx/zy7_gpio.c +++ b/sys/arm/xilinx/zy7_gpio.c @@ -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 @@ -337,9 +319,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); |