Bug 225713 - Zynq/Zedboard GPIO driver can reset USB port on some boards
Summary: Zynq/Zedboard GPIO driver can reset USB port on some boards
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm Any
: --- Affects Only Me
Assignee: Oleksandr Tymoshenko
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2018-02-06 21:44 UTC by Thomas Skibo
Modified: 2018-05-15 02:27 UTC (History)
1 user (show)

See Also:


Attachments
patch for sys/arm/xilinx/zy7_gpio.c (941 bytes, text/plain)
2018-02-06 21:44 UTC, Thomas Skibo
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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