FPGARM4U Linux
From Fpga4u
Configure the Linux kernel and write device driver to run the opensource operating system on the FPGARM4U board.
Contents
Setup the Cross-toolchain
The developer needs a crosstoolchain to compile the Linux Kernel and the other software for the target ARM architecture. See here for details.
Get the Kernel sources
The kernel sources used are the one from the official "Vanilla" repository http://www.kernel.org .
Create a directory and enter in it:
# mkdir /srv/ # cd /srv/
On the developer machine, download the kernel source tarball using the command:
# wget ftp://ftp.eu.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.tar.gz
During the development I choose to use the 2.6.24 because that was the "stable" version, but you are encouraged to use always the newest available version of the kernel.
You have to get the Linux kernel patch for the AT91 architecture are from the Andrew Victor page http://maxim.org.za/at91_26.html that correspond to the kernel version that you choose.
# wget http://maxim.org.za/AT91RM9200/2.6/2.6.24-at91.patch.gz
The last source tarball that you need is the patch developed at LAP that contain all the information about the FPGARM4U board.
# wget ... 2.6.24-at91-Fpgarm4U.patch.gz ...
The Linux kernel patch for the FPGARM4U board are to be used against the Andrew Victor's patches.
Now you have all the necessary source code to configure and compile the Linux Kernel.
Untar and patch the Linux kernel
You need to decompress the kernel source tarball
# tar xjf linux-2.6.24.tar.gz
Copy the patche gzipped file where you decompressed the kernel source
# cp 2.6.24-at91.patch.gz linux-2.6.24/
enter in the kernel source directory
# cd linux-2.6.24/
apply the patch. This means that tht information stored in the patch file are used to modify the files in the kernel source directory
# zcat 2.6.24-at91.patch.gz ¦ patch -p1
with the same procedure copy the FPGARM4U patch and apply it to the kernel tree.
# zcat 2.6.24-at91-Fpgarm4U.patch.gz ¦ patch -p1
At this point all the files are modified to fit the FPGARM4U board.
Configure and compile the Linux kernel
You need to configure and compile the whole Linux Kernel.
If you do not know the "make menuconfig" tool I suggest to just copy the FPGARM4U configuration file at the right place
# cp .config_FPGRAM4U .config
than you have to check the correctness of the information written in the .config file
# make ARCH=arm oldconfig
(if you are not sure, give the default answer). Try to get familiar with the "make menuconfig" tool,... it has to be your friend.
# make ARCH=arm menuconfig
you can go through the kernel tree and select or deselect the drivers and the software that you want to compile inside the kernel.
Select the "exit" button (Rember to save if you made any modification!).
You are ready to start the process that will give you the compiled Linux Kernel
# make ARCH=arm CROSS_COMPILE=arm-linux-gnu-
the compiling process could the some time depending on your developer machine.
At the end the Image of the Kernel is available in the ./linux-2.6.24/arch/arm/boot/ directory.
Prepare the Kernel Image for Das U-Boot
To be able to use the "bootm" command in U-Boot, you need to add some headers and CRC information to your kernel image.
Create the working directory and enter in it
# cd .. # mkdir uImages # cd uImages
Get the utility for the conversion from the directory where you compile Das U-Boot
cp u-boot-1.1.5/tools/mkimage ./mkimage.bin
or from
# wget http://www.linux4sam.org/twiki/pub/Linux4SAM/SoftwareTools/mkimage.bin
Make it executable changing the access permission to the file (owner and group)
# chmod 554 mkimage.bin
Add the headers the Kernel Image
# ./mkimage.bin -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-2.6.24-FPGARM4U \ -d ../linux-2.6.24/arch/arm/boot/Image uImage-2.6.24-FPGARM4U
Check if the new headers are ok
# ./mkimage.bin -l uImage-2.6.24-FPGARM4U
you should see something with the information that you typed in the last command.
Now you have the "FPGARM4U - uImage Linux Kernel" binary file ready to be downloaded on the FPGARM4U board.
++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++
Upload the software to the FPGARM4U card
... Bootstrap @address DF "Send Boot File" ... ... U-Boot @address DF 0x00008000 ... ... U-Boot environment @address DF 0x00004000 ... Root Filesystem @address SDRAM 0x21100000 ... ... Linux Kernel uImage @address SDRAM 0x22200000 ...