From owner-svn-src-all@FreeBSD.ORG Thu Jun 18 13:29:48 2015 Return-Path: Delivered-To: svn-src-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0167E4D7 for ; Thu, 18 Jun 2015 13:29:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery4.ore.mailhop.org (pmta2.delivery4.ore.mailhop.org [54.200.247.200]) by mx1.freebsd.org (Postfix) with SMTP id B60FECC6 for ; Thu, 18 Jun 2015 13:29:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 18 Jun 2015 13:29:34 +0000 (UTC) Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t5IDTfpH013957; Thu, 18 Jun 2015 07:29:41 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1434634181.1415.88.camel@freebsd.org> Subject: Re: svn: head/sys/boot: common uboot/common uboot/lib From: Ian Lepore To: Maxim Sobolev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 18 Jun 2015 07:29:41 -0600 In-Reply-To: References: Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2015 13:29:48 -0000 On Sat, 2015-06-13 at 14:53 -0700, Maxim Sobolev wrote: > Just in case, my debug code and proposed fix can be found here: > > https://github.com/sobomax/FreeBSD.arm/commit/48509790f82352cb455d0f5029291b917afb985b > > Unless I hear from you I am going to push it into the repository in the > next few days (modulo printf() debug stuff). > > Thanks! > > On Thu, Jun 11, 2015 at 6:21 AM, Maxim Sobolev wrote: > > > Hi Ian, there is some issues with that commit that I've run into when > > trying to get FreeBSD booting on my Xilinx Zinq 7010-based board. > > Basically, the instructions we have on Wiki suggests that the ubldr loading > > address to be 0x100000. That makes ubldr panic with "not enough DRAM" > > error. I've added some debug code into the for loop, you can find the > > output below. As you can see the code is not handling the case when ubldr > > is below 2MB and as such sblock == eubldr. On top of that, this_block and > > this_size may be left uninitialized causing loading at some random address > > and panicing then, instead of DRAM is too small panic. > > > > kernel_addr=0x100000 > > ubldr_addr=0x100000 > > dtb_addr=0x1000 > > dtb_name=system.dtb > > uenvcmd=echo Booting FreeBSD from SD...; mmcinfo && fatload mmc 0 > > ${ubldr_addr} ubldr && fatload mmc 0 ${dtb_addr} ${dtb_name} && fdt addr > > ${dtb_addr} && bootelf ${ubldr_addr} > > I'm sorry for the long delay in responding to this, I'm enmeshed in a crazy-deadline project at $work. To tell you the truth, I had a feeling when I was working on that code that it was "too simple". When I've solved the "do these blocks overlap" problem before the code always ended up looking a lot more like what you propose. I think you should commit your changes, they look more correct than my code. -- Ian