Here I will describe what I have found and learned for how to setup for NAND boot of Android image which will be cupcake version in this document.
Summary of aesop6410 board
1. NAND partition information from booting log of Linux version 2.6.29.6 -
Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x000000000000-0x000000060000 : "Bootloader"
0x000000060000-0x000000400000 : "Kernel"
0x000000400000-0x000010000000 : "File System"
2. RAM configuration: [need update]
Precondition:
1. uboot installation as default bootloader.
2. PC host configuration: Refer to this[under construction].
3. [Optional] Busybox for android. Download from here.
4. Linux kernel: AESOP6410 : Kernel 2.6.29.6 + 090905 Android
5. Android root file system. For reference.
Boot via NFS
Assuming the following settings at PC host side
1. IP address: 192.168.0.15
2. Location of Android root file system: /nfsroot/androidfs
3. linux kernel image: /tftpboot/zImage-aESOP6410
and at aesop6410 board
1. IP address: 192.168.0.111
2. u-boot boot loader pre-installed
3. Information for memory map including RAM and NAND flash partition. Refer to the above.
0. Set u-boot environments as followings
setenv gatewayip 192.168.0.1;setenv ipaddr 192.168.0.111;setenv serverip 192.168.0.15
setenv bootcmd tftp c0008000 zImage-aESOP6410\;bootm c0008000;saveenv
setenv bootcmd tftp c0008000 zImage-aESOP6410\;bootm c0008000;saveenv
setenv bootargs console=ttySAC0,115200n81 root=/dev/nfs rw nfsroot=192.168.0.15:/nfsroot/androidfs ip=192.168.0.111:192.168.0.15:192.168.0.1:255.255.255.0::eth0:off mem=128M ethaddr=00:40:5c:26:0a:5b rsize=1024 wsize=1024 timeo=14
saveenv
1. boot and then watch Android loading.
Kernel flashing
0. At uboot prompt,
1. run 'tftp ram_start_address kernel_img'
[ram_start_address]: tftp will store kernel_img transferred via tftp server running on the remote host at this memory address
[kernel_img]: Linux kernel image to be stored in ram address
2. run 'nand erase ram_start_address size'
[ram_start_address]: erase NAND memory before writing kernel image starting at ram_start_addres. Use hexadecial number.
[size]: memory length to delete. need to be big enough to hold full kernel image. Use hexadecimal num.
3. run 'nand write ram_start_addr nand_addr nand_len'
[ram_start_addr]: ram memory which linux kernel image resides on.
[nand_addr]: starting address for mtd's kernel image region.
[nand_len]: Size of nand memory which hold kernel image
For example, at u-boot prompt,
uboot:>tftp c0008000 zImage;nand erase 60000 240000;nand write c0008000 60000 240000
uboot:>setenv bootcmd "nand read c0008000 60000 240000;bootm c0008000"
uboot:>saveenv
Other option for flashing kernel is possible when booted via NFS
cat zImage-aESOP6410 > /dev/block/mtdblock1
Writing root file system to NAND
There may be several ways to write root file system on NAND flash but in this doc, only one is described: mount_and_copy method after booting via NFS.
1. At PC host side, download busybox for Android and copy it to /nfsroot/androidfs/system/bin. This process is required to use some utilities such as cp, tar and so on.
wget http://benno.id.au/android/busybox
sudo chmod 777 busybox
sudo chown root:root busybox
sudo cp busybox /nfsroot/androidfs/system/bin
sudo chmod 777 busybox
sudo chown root:root busybox
sudo cp busybox /nfsroot/androidfs/system/bin
2. Create a tar file consisting of android root file system which will be written to NAND flash. Run below at PC host side.
cd /nfsroot/androidfs
tar cf /tmp/android.tar .
mv /tmp/android.tar /nfsroot/androidfs
tar cf /tmp/android.tar .
mv /tmp/android.tar /nfsroot/androidfs
3. Boot android via NFS and at Android console,
mkdir /mnt
mkdir /mnt/nand
mount -t yaffs2 /dev/block/mtdblock2 /mnt/nand
busybox tar -C /mnt/nand -xvf /android.tar
sync
umount /mnt/nand
mkdir /mnt/nand
mount -t yaffs2 /dev/block/mtdblock2 /mnt/nand
busybox tar -C /mnt/nand -xvf /android.tar
sync
umount /mnt/nand
4. Reboot and at u-boot prompt, type below.
setenv bootargs root=/dev/mtdblock2 rootfstype=yaffs2 console=ttySAC0,115200 init=/init
saveenv
boot
saveenv
boot
Tip
1. How to mount SDCARD
mount -rw -t vfat /dev/block/mmcblk0p1 /sdcard