Bug 225713

Summary: Zynq/Zedboard GPIO driver can reset USB port on some boards
Product: Base System Reporter: Thomas Skibo <thoma555-bsd>
Component: armAssignee: Oleksandr Tymoshenko <gonzo>
Status: Closed FIXED    
Severity: Affects Only Me CC: gonzo
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: arm   
OS: Any   
Attachments:
Description Flags
patch for sys/arm/xilinx/zy7_gpio.c none

Description Thomas Skibo 2018-02-06 21:44:52 UTC
Created attachment 190368 [details]
patch for sys/arm/xilinx/zy7_gpio.c

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.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-04-03 04:32:35 UTC
A commit references this bug:

Author: gonzo
Date: Tue Apr  3 04:31:55 UTC 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

Changes:
  head/sys/arm/xilinx/zy7_gpio.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-05-15 02:27:17 UTC
A commit references this bug:

Author: gonzo
Date: Tue May 15 02:26:50 UTC 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>

Changes:
_U  stable/11/
  stable/11/sys/arm/xilinx/zy7_gpio.c