[Ben's home]
[Nias home]


Squidgit's Kernel Repo
AVR32 kernels of all shapes and sizes

One of the things most asked on 'freaks is "How do I compile my kernel so I can do x".  What they actually _want_ though, is just to be able to do x.  This site hosts a bunch of prebuild kernels for the AVR32 AT32AP machine, customized to do common tasks.  I will keep these as up-to-date with the current .atmel branch as I can.  Despite this being hosted on the Nias Digital website, I am not being paid for this so please be patient with me :-).

If you've got a kernel image you think others would find useful, please fire it through to bn@niasdigital.com and I can put it up here.  For preference, you should also email through the base kernel version you've used and a patch between that version and your kernel.  This way I can (try to) keep it up to date with newer kernel releases along with the rest of them.

Note that if you've got your own custom kernel for your own custom board and can't be bothered keeping it up to date, send me the patches and config and I'll stick it in my build system for you!  Then all you need to do is check back here occasionally and grab the latest version of your kernel build just for you.

Using the Kernels
Using these kernels is really very simple.  Kernel images bootable by u-boot are, by default, called uImage.  You need to find your existing uImage file (it will be in / or /boot) and rename it uImage.old or something.  Then download a kernel from here, copy it in to the same directory as uImage.old and rename it uImage.

If you've downloaded the monolithic image (everything built in) then you're done, reboot!  If you have the standard image you'll still need to install the modules.  Download the modules associated with that kernel version, copy the folder in the archive to /lib/modules.  Reboot.  Done!

If something breaks due to your kernel upgrade, you can boot in to your old image.  Assuming you've done as I told you and backed it up.  When your board starts up and the "Press SPACE" prompt comes up, press space.  To boot in to uImage.old, simply type "fsload /uImage.old; bootm" or "fsload /boot/uImage.old; bootm" depending where your kernel images live.


The Kernels!

The descriptions of each kernel is found below, the kernels themselves are found in the download directory.  I used to have them all linked from here, but I can't be bothered.  Please just go to the download directory and Ctrl-f for what you want :-)

All these kernels are based on 2.6.24.atmel.3
Old kernels are found in the archive.


ATSTK1002 defconfig Default configuration for the Atmel ATSTK1002 starter kit.  This is a modular build, remember to install the modules to your target board.
ATSTK1002 defconfig monolithic Same as above but with all features built in, nothing built as modules.
ATNGW100 defconfig Default configuration for the Atmel ATNGW100 reference design.  This is a modular build, remember to install the modules to your target board.
ATNGW100 defconfig monolithic Same as above but with all features built in, nothing built as modules.
ATSTK1002 spidev Default configuration for the ATSTK1002 but with all spare chip selects on the SPI0 controller wired up to SPIDEV for userspace access
ATSTK1002 spidev monolithic Same as above but built without external modules
ATNGW100 spidev Default configuration for the ATNGW100 but with all spare chip selects on the SPI0 controller wired up to SPIDEV for userspace access
ATNGW100 spidev monolithic Same as above but built without external modules
ATNGW100 usarts Default configuration for the ATNGW100 but with all USARTs wired up and running.  This means that the USART peripheral reserves the pins and you can no longer use them as gpio.
ATNGW100 usarts monolithic Same as above but built without external modules
ATNGW100 usarts/spidev Default configuration for the ATNGW100 but with all USARTs wired up and all spare chip selects wired to spidev
ATNGW100 usarts/spidev monolithic Same as above but built without external modules
ATSTK1002 tinyconf nonet A kernel configuration with no network support, no debug features and a swag of other space savers.  All the critical parts should be there but the binary size is just 600KB (as compared to a defconfig around 1.2MB)
ATSTK1002 tinyconf network Same as above but with networking enabled bringing the binary size of around 900KB


Troubleshooting


Probing modules [failed]
Often after upgrading your kernel you will see that the startup scripts will fail to load all modules.  This may or may not be an actual problem.  If you're running a kernel marked "Monolithic" then there are actually no modules to load and the errors can be ignored.  If they annoy you you can edit your startup scripts to not even try and load the modules.

If you're running a modular kernel, the first thing I reccomend is to upgrade to the latest Atmel startup scripts, most often found in the AVR32 Buildroot distribution.  The issue here is that the startup scripts from the Board Support Package try and load the MMC driver as a module.  In newer kernels this is built in to the kernel, not as a module, so the load fails even though you still have the functionality.

If you still see errors on the latest startup scripts and/or you find you're missing functionality or seeing weird behaviour, it's time to check your module installation. If you haven't installed modules at all (and you're running a modular kernel) then there's your problem right there.  Download the module tarball and extract it to the root of your board's filesystem.

If you think you have installed modules, ensure they're installed to the correct place.  On your board, run

uname -r

This will tell you the exact version string of the kernel you're running.  You should have a folder under /lib/modules whose name _exactly_ matches the string as output above.  If not, reinstall your modules making sure you have the ones matching your kernel version and confirm that they do indeed go in to the correct folder.

It just keeps rebooting!
One of the more common problems, especially if running a large kernel like the monolithic ones, is that uboot will load to too low an address and the compressed kernel will be overwritten by the result of the decompression.  This manifests itself as the board continually rebooting with nothing interesting on the console except 'MMU Error' followed by a bunch of stack trace.

The way to fix this is to change the uboot load address to something larger than the default 0x10200000.  Something like 0x10400000 should do fine.  To change this, enter the uboot promt by hitting space when prompted, type 'printenv' and make note of your bootcmd.  If this already specifies a load address (somewhere in the command you see a number like the above one) then type 'askenv bootcmd' and enter the new bootcmd the same as the old one but with the address changed.

If there is no load address specified, you will need to do so.  How to do this varies depending on your boot method.  For example, booting a kernel over tftp using DHCP to get your IP addy the bootcmd might change from

dhcp /boot/uImage;bootm

to

dhcp 0x10400000 /boot/uImage;bootm

If you don't feel comfortable crafting your own bootcmd (though you can't really break anything by playing around), post the output of 'printenv' on 'freaks and I'll see if I can help :-)

Now that you've got your new bootcmd (you can confirm it's OK by printenv'ing again) you must run 'saveenv' to save it then 'boot' will, of course, boot.