From owner-freebsd-arm@FreeBSD.ORG Sun Feb 18 18:01:47 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org 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 DF8A116A401 for ; Sun, 18 Feb 2007 18:01:47 +0000 (UTC) (envelope-from xride@x12.dk) Received: from swip.net (mailfe06.tele2.dk [212.247.154.163]) by mx1.freebsd.org (Postfix) with ESMTP id BC38E13C461 for ; Sun, 18 Feb 2007 18:01:46 +0000 (UTC) (envelope-from xride@x12.dk) X-Cloudmark-Score: 0.000000 [] Received: from x12.dk (account mu12272@get2net.dk [83.72.97.231] verified) by mailfe06.swip.net (CommuniGate Pro SMTP 5.0.12) with ESMTPA id 416100387; Sun, 18 Feb 2007 19:01:43 +0100 Received: by x12.dk (Postfix, from userid 666) id B9A1350845; Sun, 18 Feb 2007 19:01:42 +0100 (CET) Date: Sun, 18 Feb 2007 19:01:42 +0100 From: Soeren Straarup To: "M. Warner Losh" Message-ID: <20070218180142.GC66059@x12.dk> References: <20070215192810.GC78895@x12.dk> <20070215.134941.104122801.imp@bsdimp.com> <20070217201021.GB66059@x12.dk> <20070217.192205.547446193.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070217.192205.547446193.imp@bsdimp.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-arm@freebsd.org Subject: Re: At91rm9200 boot? 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: Sun, 18 Feb 2007 18:01:48 -0000 On Sat, Feb 17, 2007 at 07:22:05PM -0700, M. Warner Losh wrote: > In message: <20070217201021.GB66059@x12.dk> > Soeren Straarup writes: > : On Thu, Feb 15, 2007 at 01:49:41PM -0700, Warner Losh wrote: > : > From: Soeren Straarup > : > Subject: Re: At91rm9200 boot? > : > Date: Thu, 15 Feb 2007 20:28:10 +0100 > : > > : > > On Thu, Feb 15, 2007 at 09:46:42AM -0700, M. Warner Losh wrote: > : > > > In message: <45D45269.4050509@bulinfo.net> > : > > > Krassimir Slavchev writes: > : > > > : M. Warner Losh wrote: > : > > > : > In message: <45D3119F.4020302@bulinfo.net> > : > > > : > Krassimir Slavchev writes: > : > > > : > : I have board with at91rm9200, 64Mb SDRAM, 4Mb dataflash and 64kb iic. > : > > > : > : There is bootloader installed in iic which boots linux kernel from > : > > > : > : dataflash. > : > > > : > : What I need to know for this bootloader to be able to boot FreeBSD kernel? > : > > > : > > : > > > : > How to install the FreeBSD kernel in place of the linux kernel > : > > > : > currently in dataflash. > : > > > : > > : > > > : > Depending on the dataflash, you may also be able to do any or all of > : > > > : > the following: > : > > > : > (1) install the freebsd boot loader that boots from SD cards (boot2) > : > > > : > (2) install the freebsd boot loader that boots from dataflash (bootspi) > : > > > : > > : > > > : These boot loaders can't be fitted in the 8kbytes eeprom (24C64). > : > > > > : > > > Well, they could be made to fit into 8KB, but they don't right now. A > : > > > lot of effort has been made to make them small. bootspi likely is the > : > > > easiest candidate, since it is closest. I tried really hard to make > : > > > boot2 fit into 8k, but ran out of time. I did manage to slim down the > : > > > boot loaders from about 48k when I started to 9-10k after all was said > : > > > and done. The at91rm9200 parts have 16k of SRAM, of which 12k are > : > > > useful. > : > > > > : > > > The newer AT91SAM926x parts have only 4kb of SRAM, so I'm unsure what > : > > > I'll be doing there. > : > > > : > > Is there support at all for AT91SAM9260? Or should i stick to > : > > AT91RM9200 ? > : > > : > only in my trees. Atmel gave me a board a couple of weeks ago to add > : > support for it, but I've not yet had time to integrate it into the p4 > : > tree or to -current. Short term at91rm9200 is what is there and > : > supported. > : > > : > The work will be at my own pace, since I'm not funded to do it at the > : > moment... If that changes, the pace will pick up. > : > > : > Warner > : > > : > > : > > > : > (3) Use the FreeBSD dataflash support to manage this situation. > : > > > : > > : > > > : Where to find more information about this support? > : > > > > : > > > At the moment there's only source. src/sys/dev/flash/at45d.c has the > : > > > main support for dataflash. SPI infrastructure is in src/sys/dev/spi > : > > > and src/sys/arm/at91/at91_spi.c. /dev/flash/spi0, etc, appears when > : > > > these devices are active. The block size that the dataflash supports > : > > > is, alas, hard coded into at45d.c file at the moment, but I think that > : > > > most parts have at least some support in there. > : > > > > : > > > Warner > : > > > : > > /Soeren > : > > > : > : Hmm.. i can't really get started, looked through how linux is beeing booted > : via u-boot, but that doesn't seem to be the same for this board: > : http://www.mechatronicbrick.dk/index.php?option=com_content&task=view&id=13&Itemid=35 > > OK. I have a u-boot based board that I should try to get FreeBSD > booting on. Maybe a good project for the lurkers would be to document > how each of the different boot systems work and write some guidance on > how to pick the one that's right for you... > > : If i wanna test boot it at first without placing anything in flash how can i > : then make it boot, supply a patched version of bootspi or should it be boot0spi? > > If you put the board into recovery mode, you can download bootspi to > the SRAM using xmodem. It will then execute there. Once executing, > it can pull down a kernel via tftp (you'll likely have to hack the > locations in the sources). There's no bootp/dhcp client built into > these sources. > This might be a newbie question, but how do i compile bootspi: bugs# make ARCH=arm TARGET_ARCH=arm Warning: Object directory not changed from original /usr/src/sys/boot/arm/at91/bootspi cc -Os -mcpu=arm9 -ffreestanding -I/usr/src/sys/boot/arm/at91/bootspi/../libat91 -I/usr/src/sys/boot/arm/at91/bootspi/../../../.. -I/usr/src/sys/boot/arm/at91/bootspi/../../../../arm -D_KERNEL -Wall -Waggregate-return -Wnested-externs -Wpointer-arith -Wshadow -Wwrite-strings -Werror -Wmissing-prototypes -Wmissing-declarations -DBOOT_KB920X -DBOOT_COMMANDS -c /usr/src/sys/boot/arm/at91/bootspi/../libat91/arm_init.S `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead. /usr/src/sys/boot/arm/at91/bootspi/../libat91/arm_init.S:0: error: bad value (arm9) for -mtune= switch *** Error code 1 Stop in /usr/src/sys/boot/arm/at91/bootspi. > : And then tftp the kernel down? and then nfs mount everything? > > The kernel can be configured to get its data via bootp, etc. These > parameters include where to boot from. > > Warner /Soeren -- Soeren Straarup | aka OZ2DAK aka Xride FreeBSD committer | FreeBSD since 2.2.6-R If a program is not working right, then send a patch