Tuesday, March 8, 2011

yaffs2 and nand drivers

The crespo board was booting android with system and data partititons on the Movi-nand. Now the task is to move this to the one-nand memory. The main area to be modified is at the bootloader where partitons are defined. This will be passed to kernel as ATAGS. so modified the partition table to point the system and the data partitions to nand. Then edited the init.herring.rc file to
mount yaffs2 mtd@system /system wait ro
mount yaffs2 mtd@userdata /data wait noatime nosuid nodev

Next is to create yaffs2 filesystem. Initally I used the command,
./out/host/linux-x86/bin/mkyaffs2image out/target/product/crespo/system sytem.img
But file system was not mounting with this. The reason was that by default mkyaffs2image utility used page size as 2048 and spare area(OOM) as 64. Later when I checked the data sheet of the One-nand, it was 4096 and 128 respectively. So modifed the command to,
./out/host/linux-x86/bin/mkyaffs2image -c 4096 -s 128 out target/product/crespo/system system.img

But this time Odin was giving and flashing failure. So I checked the size of the system.img. It was 155MB and compared with the size of the system partitions which was only 152MB. So that was the reason for flashing failure. After stealling some space from data partiton, flashing works. And the yaffs2 filesystem was successfully mounted. :-)

If you want to know more about the NAND and Yaffs2 File System here is a good link.

No comments: