From owner-freebsd-arm@FreeBSD.ORG Tue Dec 25 23:21:26 2012 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EBAC11B for ; Tue, 25 Dec 2012 23:21:26 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id A07018FC0C for ; Tue, 25 Dec 2012 23:21:25 +0000 (UTC) Received: from [207.6.254.8] (helo=[192.168.1.67]) by id.bluezbox.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1TndoI-0006cd-6S; Tue, 25 Dec 2012 15:21:24 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: Raspberry Pi questions From: Oleksandr Tymoshenko In-Reply-To: <1356476778.1144.20.camel@revolution.hippie.lan> Date: Tue, 25 Dec 2012 15:21:03 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <0F630E03-7A0C-4D56-A580-C7A9ABD2CB0C@bluezbox.com> References: <1356466883.1144.8.camel@revolution.hippie.lan> <08125E73-C46A-4DDF-BFD8-59D5B86136B8@bluezbox.com> <1356476778.1144.20.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1499) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 2012-12-25, at 3:06 PM, Ian Lepore wrote: > On Tue, 2012-12-25 at 12:37 -0800, Oleksandr Tymoshenko wrote: >> On 2012-12-25, at 12:21 PM, Ian Lepore wrote: >> >>> I got my RPi running this morning, more or less. I used the boot >>> partition from the latest image at http://www.peach.ne.jp/archives/rpi/ >>> but I'm loading my own custom built kernel and world. I have a few >>> questions... >>> >>> Can I get ubldr to load a kernel using tftp, bootp, etc? >> >> Yes. ubldr checks U-Boot devices (SD and net), then tries to locate >> FFS partition on SD card and if fails - falls back to NFS/bootp. You can fetch >> my image, boot partition there contains ubldr, FDT blob, config.txt and boot scripts: >> >> http://people.freebsd.org/~gonzo/arm/rpi/freebsd-pi-r243778.img.gz > > This is so close to working. In u-boot I have an env var "usbethaddr" > which contains what seems to be the right address (it's an RPi > foundation oui). But still when booting via ubldr it generates a random > address every time, apparently because smsc_fdt_find_mac() always > returns zeroes (I added a printf to the smsc driver). If I hard-code > the right mac address in the smsc driver I get all the way to multiuser > mode. > > Also, when ubldr launches it immediately begins to load the kernel from > sdcard before I can stop it. I have to wait for that to finish and then > do "unload" then load the kernel from net0:. Can I create a file that > contains different defaults or something? > > The amount of ram reported by kernel startup is only 128mb. u-boot says > 384mb, that's not right either. > [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: freebsd-arm@freebsd.org 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: Tue, 25 Dec 2012 23:21:26 -0000 On 2012-12-25, at 3:06 PM, Ian Lepore = wrote: > On Tue, 2012-12-25 at 12:37 -0800, Oleksandr Tymoshenko wrote: >> On 2012-12-25, at 12:21 PM, Ian Lepore = wrote: >>=20 >>> I got my RPi running this morning, more or less. I used the boot >>> partition from the latest image at = http://www.peach.ne.jp/archives/rpi/ >>> but I'm loading my own custom built kernel and world. I have a few >>> questions... >>>=20 >>> Can I get ubldr to load a kernel using tftp, bootp, etc? =20 >>=20 >> Yes. ubldr checks U-Boot devices (SD and net), then tries to = locate >> FFS partition on SD card and if fails - falls back to NFS/bootp. You = can fetch >> my image, boot partition there contains ubldr, FDT blob, config.txt = and boot scripts: >>=20 >> http://people.freebsd.org/~gonzo/arm/rpi/freebsd-pi-r243778.img.gz >=20 > This is so close to working. In u-boot I have an env var "usbethaddr" > which contains what seems to be the right address (it's an RPi > foundation oui). But still when booting via ubldr it generates a = random > address every time, apparently because smsc_fdt_find_mac() always > returns zeroes (I added a printf to the smsc driver). If I hard-code > the right mac address in the smsc driver I get all the way to = multiuser > mode. >=20 > Also, when ubldr launches it immediately begins to load the kernel = from > sdcard before I can stop it. I have to wait for that to finish and = then > do "unload" then load the kernel from net0:. Can I create a file that > contains different defaults or something? >=20 > The amount of ram reported by kernel startup is only 128mb. u-boot = says > 384mb, that's not right either. >=20 All this means that kernel uses built-int dtb (I think at some point we = should just remove built-in DTB), not the one provided by u-boot. In order to make = ubldr aware of external dub you need to pass "fdt addr 0x100" command to it.=20= Also I don't know about how to set priorities for kernels :( So what I = did was: - Delete /boot/loader.rc and /boot/kernel/kernel on SD card. It makes = ubldr=20 go to NFS server for these files. Or you can just nuke whole = partition - Add "fdt addr 0x100" to /boot/loader.rc in NFS root - Deploy my experimental kernel to /boot/kernel/kernel in NFS root=20 Also make sure that DTB is populated by firmware. Issue following = commands in U-Boot prompt: fdt addr 0x100 fdt print=20 As a result you should get proper DTS with memory regions, MAC address = and board serial.=20