Get and patch the Linux kernel
To get an experimental Linux4SAM kernel up and running on an AT91 product, you have to go through the following steps:
1. identify on which linux kernel revision the experimental patches will apply
2. download the corresponding Linux kernel
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.33.tar.bz2 tar xvjf linux-2.6.33.tar.bz2 cd linux-2.6.xx
3. download the AT91 Maintainer's patch and apply it
wget http://maxim.org.za/AT91RM9200/2.6/2.6.33-at91.patch.gz zcat 2.6.33-at91.patch.gz | patch -p1
4.Compile kernel ( a prebuilt image is provided : linux-sam9260-cn.img)
-wget http://www.at91.com/linux4sam/pub/Linux4SAM/LinuxKernel/at91sam926yek_defconfig
- make ARCH=arm at91sam9260ek_defconfig
- make ARCH=arm CROSS_COMPILE=arm-linux-gcc
- the cmdline is mem=64M console=ttyS0,115200 initrd=0x21100000,17000000 root=/dev/ram0 rw
- this kernel includes following drivers :
- USART (ttySx)
- Ethernet
- USB host (Mass storage)
- USB device
- I2C
5. Build a u-boot kernel image
- mkimage -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-2.6 -d arch/arm/boot/Image linux-2.6.15.4-sam9260ek.img
Command to generate an uncompressed uImage file 2 :mkimage -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-2.6 -d arch/arm/boot/Image uImageCommands to generate a compressed uImage file 2 :
mkimage -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-2.6 -d arch/arm/boot/zImage uImage6. booting the kernel with a tftp server - copy kernel image (linux-2.6.15.4-sam9260ek.img) & ramdisk (armv5l-uclibc-sam9260.gz) on tftp server - Set u-boot environment variables U-Boot> setenv ethaddr the_device_mac_address (ex:12:34:56:78:99:aa) U-Boot> setenv serverip the_tftp_server_ip_address U-Boot> setenv ipaddr the_device_ip_address U-Boot> saveenv - Load kernel & ramdisk U-Boot> tftp 21400000 linux-2.6.15.4-sam9260ek.img U-Boot> tftp 21100000 armv5l-uclibc-sam9260.gz - Boot kernel U-Boot> bootm 21400000 (none) login: root 7. booting the kernel with a USB drive - copy kernel image(linux-sam9260-cn.img) & ramdisk (armv5l-uclibc-sam9260.gz) on an USB drive - Load kernel & ramdisk U-Boot> usb start U-Boot> fatload usb 0:1 21400000 linux-2.6.15.4-sam9260ek.img U-Boot> fatload usb 0:1 21100000 armv5l-uclibc-sam9260.gz - Boot kernel U-Boot> bootm 21400000 (none) login: root 8.- Using Ethernet - After login enter the command : ifconfig eth0 board_ip_address - command available : telnet wget ftpput ftpget telnetd (daemon) 9. Using USB Gadget - g_file_storage enter the command : insmod g_file_storage file=your_block_device stall=0 plug usb cable on a PC computer for example you can use an USB driver; Plug an USB drive on EK board. Do not mount the device enter the command : insmod g_file_storage file=/dev/sda1 stall=0 plug usb cable