[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARM boot process

In message: <44FDAE15_(_dot_)_1010400_(_at_)_freebsd_(_dot_)_org>
            Andre Oppermann <andre_(_at_)_freebsd_(_dot_)_org> writes:
: M. Warner Losh wrote:
: > In message: <44FC3626_(_dot_)_701_(_at_)_freebsd_(_dot_)_org>
: >             Andre Oppermann <andre_(_at_)_freebsd_(_dot_)_org> 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.

I've done that, but I'll have to check my notes.  I've use mkfs to
creaet the ramdisk image, and then frobbed some knob in the config
file to included when I built kernel.tramp.

: > 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.

Except that it works... :-)  There's lots of bugs in the kwikbyte

: > 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?

Chances are good that the I/O stuff isn't configured correctly.  We're
getting close to the point of needing different I/O config for
different boards.  All that's done right now in kb920x_machdep.c.  In
an ideal world, the boot loader would pass us a board type (I think it
may already), we'd save it (which we don't right now) and then use it
later to do board specific things.

: > : 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?

boot2 doesn't do anything.  bootsd is a copy of boot2 that's been
augmented to be the only stage.

I don't think that we've investigated getting /boot/loader working
on the arm.  With that, we'd not need the trampoline stuff at all.
That's there to trick the kernel into thinking it was booted with

My bootsd code won't care...

I'm not sure what this has to do with redboot or uboot support.  There
I think one would have to boot off a ext2fs partition.

: 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.

Same for us, except not parallel bus.

freebsd-arm_(_at_)_freebsd_(_dot_)_org mailing list
To unsubscribe, send any mail to "freebsd-arm-unsubscribe_(_at_)_freebsd_(_dot_)_org"

Visit your host, monkey.org