Bug 211484 - Zynq/Zybo cannot mount USB drives as root
Summary: Zynq/Zybo cannot mount USB drives as root
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:
Depends on:
Blocks:
 
Reported: 2016-07-31 19:21 UTC by Thomas Skibo
Modified: 2016-08-08 17:54 UTC (History)
1 user (show)

See Also:


Attachments
patch to zynq-7000.dtsi (481 bytes, text/plain)
2016-07-31 19:21 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 2016-07-31 19:21:13 UTC
Created attachment 173141 [details]
patch to zynq-7000.dtsi

A Zynq/Zybo system cannot mount a USB drive/stick as the root filesystem.  The problem is the the ehci driver tries to DMA to a location in the first half megabyte of memory space which has several caveats on Zynq including a hole between 256K-512K that is inaccessible by bus masters.

Originally, I tried to avoid something like this happening by starting memory at 0x100000 in the Zynq DTS file.  But, ubldr "fixes up" memory ranges using information from u-boot (retrieved by a sysinfo call to the API).  That causes the kernel to allocate the first megabyte.

The simplest work-around seems to be to add a “memreserve” property to the DTS.  Also, It turns out that only the first half megabyte needs to be excluded.
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-08-03 18:03:24 UTC
A commit references this bug:

Author: gonzo
Date: Wed Aug  3 18:03:14 UTC 2016
New revision: 303726
URL: https://svnweb.freebsd.org/changeset/base/303726

Log:
  Fix EHCI driver by excluding first 512K from available memory

  On Zynq 256K-512K memory region is not accessible by all bus masters.
  EHCI driver fails when trying to use it for DMA transfers. Patching
  memory node does not help because ubldr overrides values there with
  the ones obtained from u-boot. So as a workaround we just mark first
  512K as reserved.

  PR:		211484
  Submitted by:	Thomas Skibo <thoma555-bsd@yahoo.com>
  MFC after:	3 days

Changes:
  head/sys/boot/fdt/dts/arm/zynq-7000.dtsi
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-08-08 17:54:20 UTC
A commit references this bug:

Author: gonzo
Date: Mon Aug  8 17:53:51 UTC 2016
New revision: 303839
URL: https://svnweb.freebsd.org/changeset/base/303839

Log:
  MFC r303726

  Fix EHCI driver by excluding first 512K from available memory

  On Zynq 256K-512K memory region is not accessible by all bus masters.
  EHCI driver fails when trying to use it for DMA transfers. Patching
  memory node does not help because ubldr overrides values there with
  the ones obtained from u-boot. So as a workaround we just mark first
  512K as reserved.

  PR:		211484
  Submitted by:	Thomas Skibo <thoma555-bsd@yahoo.com>
  Approved by:	re (gjb)

Changes:
_U  stable/11/
  stable/11/sys/boot/fdt/dts/arm/zynq-7000.dtsi