From owner-freebsd-arm@FreeBSD.ORG Tue Sep 5 17:04:28 2006 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C52CF16A4DA for ; Tue, 5 Sep 2006 17:04:28 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4190043D67 for ; Tue, 5 Sep 2006 17:04:20 +0000 (GMT) (envelope-from andre@freebsd.org) Received: (qmail 34062 invoked from network); 5 Sep 2006 16:49:31 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 5 Sep 2006 16:49:31 -0000 Message-ID: <44FDAE15.1010400@freebsd.org> Date: Tue, 05 Sep 2006 19:04:21 +0200 From: Andre Oppermann User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: "M. Warner Losh" References: <44FC3626.701@freebsd.org> <20060904.115205.-626772610.imp@bsdimp.com> In-Reply-To: <20060904.115205.-626772610.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org Subject: Re: ARM boot process X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 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, 05 Sep 2006 17:04:28 -0000 M. Warner Losh wrote: > In message: <44FC3626.701@freebsd.org> > Andre Oppermann writes: > : I'm new to the embedded system world and have got some Atmel > : at91rm9200 eval boards I'm playing with. Most of them came > : with Linux and some boot loader to it. > : > : The supplied boot loaders can't load a FreeBSD arm kernel and > : complain about wrong magic. > > Which kernel were you using? After I sent the original email I tried a couple of things and got some help on developers IRC as well (missing you there lately). What I did was to check out the arm tree from p4 and do a 'make TARGET_ARCH=arm kernel-toolchain' followed by a 'make TARGET_ARCH= arm KERNCONF=KB920X buildkernel'. The KB920X is modified such that it includes the hints.at91rm9200. One step I somehow did but can't reproduce today was the 'make trampoline' target. Every time and way I try it now fails in elf_trampoline.c because it doesn't have proper sys/* includes as seen from the kernel compile directory. There I'm stuck right now. The kernel from yesterday successfully boots on the KB9202 and mounts root over NFS. The loader is the super-primitive one that comes with the board. I'm setting mac, ip and tftp server address, do the tftp download to 0x20000000 and start from that address. What I've got no clue yet is how to build a MFS image that gets fused with the kernel so I may skip NFS and boot with only TFTP or even put it on flash. > boot0* is to bootstrap the board. boot0 lets you load an arbitrary > program to execute. boot0iic allows you to load an image to put in > the iic eeprom (maybe on only on the KB9202). boot0spi allows you to > load an image into the SPI part. > > bootiic is usually what you put in the iic part to boot. It's fully > functional. If you have different eeprom parts, you'll need to tweak > it. OK, this looks pretty much like the Kwikbyte loader. > bootspi is what I put in the SPI part. It is presently optimized for > the part that I have, and might need some tweaks. > > bootsd will boot off a SD card. It doesn't quite work yet, there's > some unaligned accesses that I'm still working on sorting out... SD is the interesting part. ;-) I included the qdmmc driver in my working kernel as well but it fails to detect an inserted SD (1GB) or MMC (16MB) card. How does the IO pin setup on the AT91RM9200 work? Where are the IOs assigned to the functions? > : For the at91rm9200 a number of boot loaders are in boot/arm/ > : but so far I haven't figured out which one to use. Eventually > : I'd like to have it boot from the SD card. > > That's not yet in the tree. I'm working on booting off a UFS > partition. Perfect. > I've not looked at integrating the SD support with things like redboot > or uboot yet. What does boot2 do? And how can I boot an ARM kernel w/o doing the trampoline step? Is that possible at all? Once I'm up to speed and familiar with ARM/AT91RM9200 I'm ready to help on improving it. The devices/ports I'll primarily care about and will use are SPI, TWI, 8bit parallel bus, SD/MMC, SSC, EMAC. -- Andre