From owner-freebsd-arm@FreeBSD.ORG Sun Feb 10 08:20:22 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 573C4526 for ; Sun, 10 Feb 2013 08:20:22 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp4.clear.net.nz (smtp4.clear.net.nz [203.97.37.64]) by mx1.freebsd.org (Postfix) with ESMTP id 25E05EA9 for ; Sun, 10 Feb 2013 08:20:21 +0000 (UTC) Received: from mxin2-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp4.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MHZ0085SWHWQF10@smtp4.clear.net.nz> for freebsd-arm@freebsd.org; Sun, 10 Feb 2013 21:20:21 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO bender) ([202.0.48.19]) by smtpin2.paradise.net.nz with ESMTP; Sun, 10 Feb 2013 21:20:20 +1300 Date: Sun, 10 Feb 2013 21:20:25 +1300 From: Andrew Turner Subject: Re: building RaspPi Images In-reply-to: <8087503F-BE98-45B9-888B-044D9DA58B80@bsdimp.com> To: Warner Losh Message-id: <20130210212025.009ee482@bender> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit References: <5116CB50.9080303@ceetonetechnology.com> <7757848F-45C6-4DEF-A4A2-5F900EB10A06@kientzle.com> <20130210012052.4d7e1a46@ivory.local> <58DCA6BE-8C06-4F69-81A2-A3582FBB5B12@kientzle.com> <8087503F-BE98-45B9-888B-044D9DA58B80@bsdimp.com> Cc: Tim Kientzle , freebsd-arm@freebsd.org, Brett Wynkoop X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Feb 2013 08:20:22 -0000 On Sun, 10 Feb 2013 00:47:38 -0700 Warner Losh wrote: > > On Feb 10, 2013, at 12:18 AM, Tim Kientzle wrote: > > > On Feb 9, 2013, at 11:07 PM, Warner Losh wrote: > > > >>> * For RPi, this already happens: the first-stage boot > >>> loads a DTB, ubldr uses "fdt addr" to access that DTB > >>> in a known location and then passes it to the kernel. > >> > >> Doesn't the RPi's boot loader give our /boot/loader enough info to > >> get this without the fdt addr command? > > > > I haven't dug into this yet, but there's a mismatch somewhere > > between the RPi first-stage boot loader, U-Boot, and our ubldr. > > > > I briefly tried loading our kernel straight from the RPi > > first stage boot loader (dropping U-Boot and ubldr > > phases) but didn't get very far with it. > > Our ubldr currently ignores r2 on boot, and tries to get the FDT via > a different uboot interface, but I'm thinking that part is broken... As I understand it ubldr is an elf image. We use the bootelf command from U-Boot to jump into it. This command executes entry(argc, argv); to run ubldr. As argc is an int and argv is a pointer these will be in r0 and r1 respectively, as such is shouldn't look at r2. It looks like ubldr doesn't look at argc and argv, and should have no need to unless we decide to have it take the address of the dtb on the command line, or have some other data passed in from U-Boot. Andrew