Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Nov 2006 00:30:18 -0800 (PST)
From:      Zuy <zaitsevbros@mail.ru>
To:        freebsd-arm@freebsd.org
Subject:   Re: At91rm9200 how to start with FreeBSD
Message-ID:  <7395689.post@talk.nabble.com>
In-Reply-To: <20061116.093638.63053940.imp@bsdimp.com>
References:  <7380637.post@talk.nabble.com> <20061116.093638.63053940.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Thank you very much.
I was realy impressed to get such a quick and detailed answer.

My board includes SD card and 1mb Serial DataFlash. I'm  going to use
dataflash to store bootstrap tools which will load kernel from SD card. But
your board has 16 MB parallel NOR Flash and 32 MB parallel NAND Flash. 
Why you do not use this flash memory for storing and runing bootstrap tools?

You mentioned bootstrap tools such as boot0, boot0iic, boot0spi and boot2.
Where can I get them?
Boot0 and boot2 I found in /usr/src/sys/boot but there is no folder for ARM.
I use FreeBSD 6.0 (6.2 is downloading now) may be that is the reason.

And the last question about compilation process. As you wrote, following
sequence will give the compiled OS for arm architecture:
        % setenv TARGET arm 
        % setenv TARGET_ARCH arm 
        % make buildworld 
        % make distribution DESTDIR=/mnt 
        % make installworld DESTDIR=/mnt 

But how the system will know that I need compilation for ARM9. Where it will
get drivers for basic internal peripherals of AR91RM9200? I think that I
have to prepare configuration file like I do for compiling kernel for I386,
but I cannot find it. It looks like they are in the /usr/src/sys/arm/conf. I
found there two files IQ31244 and SIMICS. Probably they are configuration
files for IQ31244 and SIMICS development boards. So I think I have to make
the same file for AT91RM9200. May be you can give me the idea where to get
such file like an example?

Best regards,
Ivan Zaitsev.


M. Warner Losh wrote:
> 
> In message: <7380637.post@talk.nabble.com>
>             Zuy <zaitsevbros@mail.ru> writes:
> : How I'm soldering board based on AT91RM9200 with 16mb SDRAM and othe
> : standartpPeripherals(USB, SD, UART ...). I'm going to run FreeBSD on
> this
> : board, but unfortunately I do not know how to start.
> : I havn't found any files connected with AT91RM9200 in FreeBSD6.0 Stable
> : source files directory.
> : I found from this board that freebsd works on at91rm9200.
> 
> Yes.  It does.  FreeBSD-current has the most up to date tested code
> for this platform.  FreeBSD 6.2 will contain the tools you need to
> build it, as well as a slightly less advanced version (the freeze date
> for 6.2 was a while ago).  6.3 is likely to have even more advanced
> support.
> 
> : I will deeply appreciate if someone could give me any information how to
> : start working with freebsd on this controller. May any type of tutorial
> is
> : available.
> : I also interesting in main spets I have to do to get freeBSD working on
> : at91rm9200.
> 
> At this point there's no "how to" tutorial.  Each of the different
> boards based on the at91rm9200 seem to have different boot processes.
> This makes it hard to write something that's generic, but I may try.
> 
> Here's the broad outlines.
> 
> First, your board will need to have some kind of bootstrap media.
> The atmel part supports parallel flash, iic flash, and spi flash.
> Once you have the basic bootstrap loaded, you will need to load a
> kernel and file system from somewhere.
> 
> Given that your board is small, and that you have only 16MB of SDRAM,
> I'd recommend using the SD card for your main storage.  If you do
> this, then all you need in your bootstrap is enough storage to load
> from the SD card, as well as storing the MAC address.  The bootloader
> is responsible for progarmming the NIC's MAC address.  The 'boot2'
> program allows for one to customize how things are done with it and
> load off of an SD card.  It takes about 9kB of space right now.  The
> Kwikbyte KB9202 board that I used has a 16kB IIC EEPROM that this
> loader will fit into.  I use the upper part (last 256bytes) of the IIC
> to store the MAC address.  This program should be fairly easy to
> modify and adapt to your needs.  I've tried to make it as generic
> possible, but some custom work might be needed.
> 
> There's some bootstrap tools called boot0, boot0iic and boot0spi that
> will load and run a program, load and burn to iic an image and load
> and burn to spi flash respectively.  The AT91RM9200 goes into 'baby
> bird' mode if none of its boot images are good.  This is nothing more
> than xmodem.  When I bring a board up, I usually load boot0iic and
> boot2 using xmodem.  It turns out to be quiet simple.  Each board has
> some low-level init that is the hardest part to get right since you
> have to know the base clock frequency as well as the organization of
> the SDRAM.
> 
> Once you have 'boot2' loading from some media, then you need to get it
> loading a kernel from an SD card.  Today, you have to load a kernel
> linked to be loaded at a physical address (cognet sent me patches to
> allow virtual too, but my KB9202's iic eeprom is dead).  There's a
> special kernel target call 'trampoline' or 'kernel.tramp' that will
> create a compressed image suitable for booting (use kernel.gz.tramp).
> 
> An alternative is to use bootiic or bootspi to load a kernel image
> from somewhere and jump to it.
> 
> To make the bootable SD card, I've been using some custom scripts that
> I've had laying around forever for some semi-embedded FreeBSD/i386
> work that my company has been doing for the past 10 or so years.  Most
> other people I know do some variation on:
> 
> 	# plug in the SD card to a usb whatsit and load umass
> 	% fdisk -I da0
> 	% disklabel -w -r da0s1 auto
> 	% newfs /dev/da0s1a
> 	% mount /dev/da0s1a /mnt
> 	% cd /usr/src
> 	% setenv TARGET arm
> 	% setenv TARGET_ARCH arm
> 	% make buildworld
> 	% make distribution DESTDIR=/mnt
> 	% make installworld DESTDIR=/mnt
> 	# hack /etc/rc.conf, /etc/fstab and /etc/ttys
> 	% umount /mnt
> 
> But others have also used NanoBSD to automate things somewhat.
> Freesbie also has some basic cross compilation support.  FreeBSD
> -current will give you the most support, but 6.2-release will have
> most of the basics, including the build tools.  After the RELENG_6
> branch is unfrozen, I'll be doing another merge of all the goodies
> that I've done.
> 
> One caveat.  The usb support is minimal at this stage.  There's some
> issues that we're trying to track down that keep it from working.  My
> company doesn't need usb (but that may change after the latest
> hardware review), so I've spent no energy there.
> 
> Feel free to ask questions.  the more people that ask, the bigger my
> collection of email on the topic gets, and the easier it will be for
> me to synthesize a tutorial.  Also, if there are areas that I've been
> vague, please don't hesitate to let me know.
> 
> Warner
> _______________________________________________
> freebsd-arm@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"
> 
> 

-- 
View this message in context: http://www.nabble.com/At91rm9200-how-to-start-with-FreeBSD-tf2643928.html#a7395689
Sent from the freebsd-arm mailing list archive at Nabble.com.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7395689.post>