Compiling AT91Bootstrap for Aria G25

AT91Bootstrap is the 2nd level bootloader for Atmel AT91 SoC providing a set of algorithms to manage the hardware initialization such as clock speed configuration, PIO settings, DDR2 DRAM initialization. After that it downloads your main application, usually the Linux Kernel image, from the first microSD partition to DDR2 RAM main memory and runs it from there.

The binary executable file of AT91Bootstrap must be stored in the first FAT32 partition of the bootable SD card with the name boot.bin.

At startup is RomBOOT (the 1st levet booloader saved in the CPU ROM) that searches and loads boot.ini from microSD card to the 32KB SRAM located inside the CPU itself and runs it from there.

How to compile AT91Bootstrap:

Install the cross compiler and the toolchain required on your Linux Ubuntu PC following this article (Tested on Ubuntu 13.10):

Clone the Linux4Sam AT91Bootstrap git repository from GitHub:

~$ git clone git://github.com/linux4sam/at91bootstrap.git

Move inside the at91bootstrap directory and launch these commands to use the default configuration used for the Atmel SAM9X5EK evaluation board:

~$ cd at91bootstrap
~/at91bootstrap$ make mrproper
...
~/at91bootstrap$ make at91sam9x5eksd_linux_uimage_dt_defconfig
...

Launch the configuration menu to setup some parameters:

~/at91boostrap$ make menuconfig

Select:

Linux Image Storage Setup -->

and set the right DRAM memory size of your Aria G25 board:

ARIAG25-128 (128 MByte of RAM)
 (0x20000000) Extern Memory Bank Base Address
 (0x8000000) Extern Memory Bank Size
 (mem=128M console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootdelay=1) Linux kernel param
 (0x22000000) The External Ram Address to Load Kernel Image
 [*] Flattened Device Tree Support
 (0x21000000) The External Ram Address to Load Device Tree Blob
ARIAG25-256 (256 MByte of RAM)
 (0x20000000) Extern Memory Bank Base Address
 (0x10000000) Extern Memory Bank Size
 (mem=256M console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootdelay=1) Linux kernel param
 (0x22000000) The External Ram Address to Load Kernel Image
 [*] Flattened Device Tree Support
 (0x21000000) The External Ram Address to Load Device Tree Blob

When the configuration is ready save and launch the compilation by typing:

~/at91boostrap$ make CROSS_COMPILE=arm-linux-gnueabi-

Copy the binary file generated on the first partition of SD card and rename it in boot.bin:

~/at91bootstrap$ cp binaries/at91sam9x5ek-sdcardboot-linux-uimage-dt-3.6.0.bin /media/$USER/KERNEL/boot.bin

If you are using an Ubuntu release older than 13.10 remove $USER in the path

A compiled version of AT91Bootstrap is available on:

Related links