Date: Sun, 31 Jul 2016 10:55:47 -0700 From: Thomas Skibo <thomasskibo@yahoo.com> To: freebsd-arm@freebsd.org Subject: Zynq/Zybo USB bug: ubldr "fixes" my device tree Message-ID: <7C4D45AC-3DDB-46FE-85AB-5F692E5C1283@yahoo.com>
next in thread | raw e-mail | index | archive | help
--Apple-Mail=_34DF7300-D6FF-4EC6-B814-8C6A63818DEE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello. I finally tracked down a bug that kept me from being able to use a USB = drive as root on a Zybo (or Zedboard). Mounting USB drives has worked = fine before but using one as root would fail. The first megabyte of memory space on Zynq has several caveats including = a hole between 256K-512K that is inaccessible by bus masters. My = solution was to simply ignore the first megabyte by starting memory at = 0x100000 in my DTS file(s). But, I discovered that the first megabyte = was being allocated and the ehci device hung trying to DMA to the hole. = It turns out that ubldr, after loading the board.dtb file, proceeded to = =E2=80=9Cfix up=E2=80=9D the device tree from memory range information = it got in a sysinfo call to u-boot=E2=80=99s API. The memory range = started at 0. The simplest work-around seems to be to add a =E2=80=9Cmemreserve=E2=80=9D= property to the DTS. Also, It turns out that only the first half = megabyte needs to be ignored. Patch attached. =E2=80=94 Thomas Skibo thomasskibo@yahoo.com --Apple-Mail=_34DF7300-D6FF-4EC6-B814-8C6A63818DEE Content-Disposition: attachment; filename=patch.zynq-7000.dtsi.txt Content-Type: text/plain; x-unix-mode=0644; name="patch.zynq-7000.dtsi.txt" Content-Transfer-Encoding: 7bit Index: sys/boot/fdt/dts/arm/zynq-7000.dtsi =================================================================== --- sys/boot/fdt/dts/arm/zynq-7000.dtsi (revision 303418) +++ sys/boot/fdt/dts/arm/zynq-7000.dtsi (working copy) @@ -32,6 +32,10 @@ #size-cells = <1>; interrupt-parent = <&GIC>; + // Reserve first half megabyte because it is not accessible to all + // bus masters. + memreserve = <0x00000000 0x00080000>; + // Zynq PS System registers. // ps7sys@f8000000 { --Apple-Mail=_34DF7300-D6FF-4EC6-B814-8C6A63818DEE--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7C4D45AC-3DDB-46FE-85AB-5F692E5C1283>