From owner-freebsd-arm@FreeBSD.ORG Mon Feb 19 08:01:33 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 5FCE216A409 for ; Mon, 19 Feb 2007 08:01:33 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id AD02A13C494 for ; Mon, 19 Feb 2007 08:01:32 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id 4111116616; Mon, 19 Feb 2007 10:01:31 +0200 (EET) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 90119-06; Mon, 19 Feb 2007 10:01:29 +0200 (EET) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id 497D71660C; Mon, 19 Feb 2007 10:01:29 +0200 (EET) Message-ID: <45D95958.7060402@bulinfo.net> Date: Mon, 19 Feb 2007 10:01:28 +0200 From: Krassimir Slavchev User-Agent: Thunderbird 1.5 (X11/20060201) MIME-Version: 1.0 To: "M. Warner Losh" , freebsd-arm@freebsd.org References: <45D45269.4050509@bulinfo.net> <20070215.094642.1645217654.imp@bsdimp.com> <45D5DFD3.40805@bulinfo.net> <20070216.105436.1723233610.imp@bsdimp.com> In-Reply-To: <20070216.105436.1723233610.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net Cc: 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: Mon, 19 Feb 2007 08:01:33 -0000 M. Warner Losh wrote: > In message: <45D5DFD3.40805@bulinfo.net> > Krassimir Slavchev writes: > : 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. > : > > : > : > (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 > : > > : > > : Okay, I have disabled TFTP code in bootspi and now it is 6712 bytes and > : runs fine. > : I use minicom to upload bootloader but something is wrong with it > : because when it receives 'C' from terminal it can't upload correctly > : (Retry 0: NAK on sector ...). Always I need to start xmodem and power > : off/on the board to be able to upload image but in this case I can't > : upload kernel with 'K' command. > : Is there another xmodem program or I need to change something in the > : minicom settings? > > I forgot to mention that the usualy way that I upload this code is to > use tip and lsx (from the lrzsz port). I hit ~C to get a command > prompt, type 'lsx boot0spi bootspi' which will load the bootspi code > into the spi part. boot0spi is a bootstrap loader. I then reboot and > upload the kernel. I've only done that a few times on my company's > board because it was very slow... > > I'm afraid that I've never used minicom, but here is my /etc/remote > entry that I use for tip: > > ucom0:dv=/dev/cuaU0:br#115200:pa=none: > > or > > arm:dv=/dev/cuad0:br#115200:pa=none: > > depending on if I'm using the usb dongle with level conversion or a > normal serial port. > > This works! Thanks. My board seems to be different because I cant update eeprom with boot0iic nor dataflash with boot0spi. I found that eeprom address is 0x57 not 0x50 ... When try to update dataflash I receive Bad Readback ... This is not a big problem because coming with board bootstrap loader works and I can write bootspi in the dataflash. I try many times to compile working kernel but no luck. I have TARGET=arm and TARGET_ARCH=arm in /etc/make.conf This is the steps I use on CURRENT: 1. cd /usr/src 2. make buildenv 3. make kernel-toolchain 4. cd /usr/src/sys/arm/conf 5. config ARMKERNEL 6. cd ../compile/ARMKERNEL 7. make cleandepend depend all 8. make trampoline And kernel.gz.tramp should be the file suitable for loading on the board. Step 3 may be necessary only once. Is this the correct way to build kernel or I miss something? Also I need some points how to set KERNPHYSADDR, KERNVIRTADDR and PHYSADDR. PS: This is the my board: http://www.harerod.de/centipad/index.html Best Regards