#AriaBoot - A tiny bootloader for the Aria G25 SoM

AriaBoot is a tiny bootloader located on the first FAT32 partition of the bootable SD card that is 
devoted to setup the Aria G25 hardware and load the Linux Kernel uImage saved on the same first partition.

@note Use AriaBoot with Linux Kernel 2.6.39. If you are using the Linux Kernel 3.11 or higher please 
use [AT91Bootstrap](/at91bootstrap).

<img src="./ariaboot.jpg">

AriaBoot is a fork of the [Atmel (c) AT91Bootstrap 5 series version 1.2](https://github.com/linux4sam/at91bootstrap/tree/at91bootstrap_3.x/board).

It must be stored in the first FAT32 partition of the bootable SD card with the 
name **boot.bin**.

This is a special file name that **RomBOOT** searchs at start up on the SD card. 
RomBOOT is the very first piece of code launched by the CPU after reset and burned directly inside the CPU ROM.

RomBOOT loads **boot.ini** (aka AriaBoot) inside the 32KB of RAM located inside the CPU itself called **SRAM** and runs it from there.

AriaBoot initializates the **DDR2 RAM** (the main 128 or 256 MBytes RAM memory) and the CPU internal 
peripherals then tries to load the Linux Kernel **uImage** from microSD to the DDR2 RAM and runs it 
from there.    

The AriaBoot source files are available on:

*  [AriaBoot repository on GitHub](https://github.com/tanzilli/AriaBoot) 

AriaBoot read also another file called **macaddr.txt** contains the MAC address
for the Aria G25 ethernet port.

This is a normal ASCII file with 6 hexdecimal digit like this:

<pre class="minicom">
00:04:25:12:34:56
</pre>

Acme Systems will set it on each microSD delivered but you can change it as you like.

#FAQ: Is this MAC address unique ?

The MAC address saved by Acme Systems on the bootable micro SD or the binary repository images 
belongs to an Atmel pool of MAC address because the first 3 digits are from the Atmel IEEE MAC 
pool registrered on the [IEEE Registration Authority](http://standards.ieee.org/develop/regauth/oui/public.html)
so other devices based on Atmel CPU could have the same MAC.

If you want to be sure that your device has a world wide unique MAC number you can follow two ways:

* Use on your product a chip like the [AT24MAC made by Atmel](http://www.electronicspecifier.com/memory/at24mac-at24cs-atmel-serial-eeprom-products-introduced.asp) or similar-
* Buy your private pool of address from the [IEEE Registration Authority](http://standards.ieee.org/develop/regauth/oui/public.html)

#No-Linux applications

Atmel provides for free a software package to write no-Linux applications available here:

* [SAM9X25-EK GNU Software Package](http://www.atmel.com/tools/AT91SAMSOFTWAREPACKAGE.aspx)

If you create a stand-alone program with this toolchain and store the executable on a file called **userapp.bin** on the SD card deleting the Linux **uImage** file, it will be loaded and executed by AriaBoot 
at the startup instead of Linux image. 

#How to compile AriaBoot from sources:

Clone the git repository on your Linux PC:

<pre class="minicom">
~$ git clone git://github.com/tanzilli/AriaBoot.git
</pre>

Install the ARM9 toolchain on your PC following this article: @article='arm9_toolchain'

Move inside the AriaBoot directory and launch Make:

<pre class="minicom">
~$ cd AriaBoot
~/AriaBoot$ make
...
...
Size of at91sam9x5ek-sdcardboot-3.1.bin is 14116 bytes
[Succeeded] It's OK to fit into SRAM area
</pre>

The file

<pre>
binaries/at91sam9x5ek-sdcardboot-3.1.bin
</pre>

contains AriaBoot. Rename it in **boot.bin** and save it on the first microSD partition of your AriaG25.

#The .config file

Inside the **.config** file it is possible to change some parameters. The most importat probably is
**CONFIG_LINUX_KERNEL_ARG_STRING** which contains the command line arguments used by the Linux Kernel.

If you are using an AriaG25-128 use this string:

<pre class="minicom">
"mem=128M console=ttyS0,115200 noinitrd root=/dev/mmcblk0p2 rw rootwait init=/sbin/init"
</pre>

If you are using an AriaG25-256 use this string:

<pre class="minicom">
"mem=256M console=ttyS0,115200 noinitrd root=/dev/mmcblk0p2 rw rootwait init=/sbin/init"
</pre>

and compile again AriaBoot.

