From owner-freebsd-arm@freebsd.org Sun Jul 31 17:58:48 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA208BAA0C3 for ; Sun, 31 Jul 2016 17:58:48 +0000 (UTC) (envelope-from thomasskibo@yahoo.com) Received: from nm18-vm0.bullet.mail.bf1.yahoo.com (nm18-vm0.bullet.mail.bf1.yahoo.com [98.139.213.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9333C1632 for ; Sun, 31 Jul 2016 17:58:48 +0000 (UTC) (envelope-from thomasskibo@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1469987748; bh=6CS13mXpR3AksJfnz1dfJieTHkpoItjhJcJrA1ksQ2Q=; h=From:Subject:Date:To:From:Subject; b=P+6FKZZDWvE7UT9dSq/KAXb58iPUSrYyBu8wc0vEkzdPu2duKkulXVC2jogjWR2rVvVtm7gEkQcHD00hYz/FmtJFH+CB8/eZTuFbyPUYr1juYyBEOhgGVHXa0cuRf5OtMoNXxOsFJcDlIU5v7h6fnxnB5gqP8WZv5kJml8LVHYd9uikSELgPcOTfVKJPEzctQzLGQKBfD3G+H3kwM+CB8KGb0TBh5wCH6DrZNuKZG1Evt9gQmhpKbNvJpVNMKJw75zxgSzV7ks0YHdAhbk10HE3XP/gKe/wO9g+Tip8Sa/5v4Ml7dQLLVDUcXVyE4CzJmQ6R2K5fyuMny0D08lYYGw== Received: from [66.196.81.171] by nm18.bullet.mail.bf1.yahoo.com with NNFMP; 31 Jul 2016 17:55:48 -0000 Received: from [98.139.213.9] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 31 Jul 2016 17:55:48 -0000 Received: from [127.0.0.1] by smtp109.mail.bf1.yahoo.com with NNFMP; 31 Jul 2016 17:55:48 -0000 X-Yahoo-Newman-Id: 822394.69264.bm@smtp109.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: I_tdAjsVM1neYTqXS7mRZw774R5uGxRgPl6os.d_uRkJUc5 NBVya9IpxOiqOx_ucQ2em4qcWVUtE81_y_CmJ8uuOBzSALicPqfVruOKpLuE Z6IQef2P7avll9nsrHGZNpzeevdE1ff1VkTXaQ890e9.vYsUh7wP0qNlymiJ 0FhH1775bYNZTgdXc3wpOrrUei7dTq6hvlmHW0trzF_l8N8i3sd9K6j.jQ9P KicEvDQMqWdjaVO6G4shThfmNkK5Pd_gcx5UkgbSuXS5vLsgeKXetU9wMOX1 vfq3gEjC8hD9Cf.0ZrdJczgENXVLVHiFRA4skwP6ehISv0XhfaaN3Kh9ovPJ 9DV4F3YIV5xEe18NE.9xA0ZTNMTT4GZ8JeyY.E5UVrYwsxJsD2EzRijtVDM8 CEXJX4Oo5413aVxeY120cA9qXXfra7CarSnwwA76Cp8G2FTQbI7D8KNJjinj Q5HpbuHsrAtFbE0Zxxa_qkxxYBGwpbJtzHIanXfq.7hxTh4GwjMhSzgHLhAG 5OwLDvli0X3AswuPC70HxqkQ17Ku1XOZOMrms47FdOI3isiUkq_wNYUUrutd u8XD4TxyIfr_MxQ-- X-Yahoo-SMTP: .8Dytk6swBAeTUTcf.ezO8BKaYfn.mUV From: Thomas Skibo Content-Type: multipart/mixed; boundary="Apple-Mail=_34DF7300-D6FF-4EC6-B814-8C6A63818DEE" Subject: Zynq/Zybo USB bug: ubldr "fixes" my device tree Message-Id: <7C4D45AC-3DDB-46FE-85AB-5F692E5C1283@yahoo.com> Date: Sun, 31 Jul 2016 10:55:47 -0700 To: freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jul 2016 17:58:48 -0000 --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--