>
>
> A slightly related question, since you're playing with NAND and
> YAFFS2. Do you guys have a procedure handy on how to generate a YAFFS2
> RFS image and flash it to the NAND using U-boot? Also on how you flash
> and load the Kernel from NAND would be great. Appreciate the
> pointers..
>
>
*Procedure*
*Step 01.00:* *Build a basic kernel and a non-gui root file system image.*
Type in the following commands:
$ bitbake omap3-console-image
$ bitbake x-load
$ bitbake u-boot-omap3
*Step 02.00: Create a bootable microSD card using gparted.*
Step 02.01: Download and install gparted
$ su
# yum install gparted
Step 02.02: Launch gparted.
# gparted
Step 02.03: Delete all existing partitions on the microSD card.
Select all existing partition on the microSD card and right click and select
the Delete option.
Step 02.04: Create a 32MB FAT32 partition.
Right click on the unallocated partition and select the New option and enter
the following values:
New Size (MiB): 32
Filesystem: fat32
Label: disk
Step 02.05: Create an ext3 partition.
Right click on the unallocated partition and select the New option and enter
the following values:
New Size (MiB): 1800
Filesystem: ext3
Label: disk-1
Step 02.06: Copy the boot files to the FAT32 partition on the microSD card
$ su
# cd /media/disk
# cp /tool/overo-oe/tmp/deploy/glibc/images/overo/MLO-overo /media/disk/MLO
# cp /tool/overo-oe/tmp/deploy/glibc/images/overo/u-boot-overo.bin
/media/disk/u-boot.bin
# cp /tool/overo-oe/tmp/deploy/glibc/images/overo/uImage-overo.bin
/media/disk/uImage
Step 02.07: Copy the rootfs to the ext3 partition on the microSD card
$ su
# cd /media/disk-1
# tar xvjf /path/to/omap3-console-image-overo.tar.bz2
*Step 03.00: Prepare the NAND images and NAND writing script on the microSD
card.*
Step 03.01: Copy the boot and rootfs images to a folder on the microSD card
$ su
# cd /media/disk-1
# mkdir images
# cp '/tool/overo-oe/tmp/deploy/glibc/images/overo/MLO-overo' MLO
# cp '/tool/overo-oe/tmp/deploy/glibc/images/overo/u-boot-overo.bin'
u-boot.bin
# cp '/tool/overo-oe/tmp/deploy/glibc/images/overo/uImage-overo.bin' uImage
# cp
'/tool/overo-oe/tmp/deploy/glibc/images/overo/omap3-console-image-overo.tar.bz2'
.
Step 03.02: Create a script to write the images to on-board NAND.
Create a script called overo-flash-onboard-nand-yaffs2.sh and place it in
the /images folder on the microSD card.
#!/bin/sh
#
# Flash on-board NAND using YAFFS2 filesystem
#
dir=$PWD
uboot=u-boot.bin
uimage=uImage
rootfs=omap3-console-image-overo.tar.bz2
#rootfs=omap3-android-image-overo.tar.bz2
#rootfs=android-2.6.29-image-r15.tar.bz2
if [ -e $uboot ]; then
echo "Erasing u-boot partition ..."
flash_eraseall /dev/mtd1
echo "Erasing u-boot environment partition ..."
flash_eraseall /dev/mtd2
echo "Writing u-boot to NAND ..."
nandwrite -p /dev/mtd1 $uboot
else
echo "ERROR: couldn't find u-boot binary"
fi
if [ -e $uimage ]; then
echo "Erasing kernel partition ..."
flash_eraseall /dev/mtd3
echo "Writing kernel to NAND ..."
nandwrite -p /dev/mtd3 $uimage
else
echo "ERROR: couldn't find kernel binary"
fi
if [ -e $rootfs ]; then
umount /dev/mtdblock4
echo "Erasing and formatting rootfs partition ..."
flash_eraseall /dev/mtd4
echo "Mounting rootfs partition ..."
mkdir -p /media/mtdblock4
mount -t yaffs2 /dev/mtdblock4 /media/mtdblock4
cd /media/mtdblock4
echo "Setting the date to avoid warnings about time differences ..."
date 032010002010
tar xjf $dir/$rootfs
sync
cd /
umount /media/mtdblock4
else
echo "ERROR: couldn't find rootfs tarball"
fi
*Step 04.00: Connect to the Overo console using Kermit*
$ su
# kermit -l /dev/ttyUSB0
C-Kermit>set flow-control none
C-Kermit>set carrier-watch off
C-Kermit>set speed 115200
/dev/ttyUSB0, 115200 bps
C-Kermit>connect
Connecting to /dev/ttyUSB0, speed 115200
Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
Step 04.01: Reset and update the u-boot environment variables
Power up the Overo and interrupt the boot process by pressing a key in the
console window.
Step 04.02: Erase the old u-boot environment variables from NAND memory.
# nand erase 240000 20000
Step 04.03: Modify the the boot parameters.
# printenv
# setenv defaultdisplay lcd43
# setenv dvimode 480x272mr...@60
# setenv console ttyS2,115200n8
# setenv vram 32M
# setenv mmcargs setenv bootargs console=${console} vram=${vram}
omapfb.vram=0:8M omapfb.mode=dvi:${dvimode} omapfb.debug=y
omapdss.def_disp=${defaultdisplay} root=/dev/mmcblk0p2 rw rootfstype=ext3
rootwait
# setenv nandargs setenv bootargs console=${console} vram=${vram}
omapfb.vram=0:8M omapfb.mode=dvi:${dvimode} omapfb.debug=y
omapdss.def_disp=${defaultdisplay} root=/dev/mtdblock4 rw rootfstype=yaffs2
rootwait
# saveenv
# boot
*Step 05.00: *Write images to on-board NAND using the YAFFS2 filesystem
Login to the Overo as root.
Step 05.01: Determine the MTD device for the file system partition of you
Flash device
# cat /proc/mtd
dev: size erasesize name
mtd0: 00080000 00020000 "xloader"
mtd1: 001c0000 00020000 "uboot"
mtd2: 00040000 00020000 "uboot environment"
mtd3: 00400000 00020000 "linux"
mtd4: 0f980000 00020000 "rootfs"
Creating 7 MTD partitions on "omap2-nand":
0x000000000000-0x000000080000 : "xloader"
0x000000080000-0x000000240000 : "uboot"
0x000000240000-0x000000280000 : "uboot environment"
0x000000280000-0x000000680000 : "linux"
0x000000680000-0x00000a680000 : "system"
0x00000a680000-0x00000c680000 : "userdata"
0x00000c680000-0x00000e680000 : "cache"
r...@overo:/# cat /proc/mtd
dev: size erasesize name
mtd0: 00080000 00020000 "xloader"
mtd1: 001c0000 00020000 "uboot"
mtd2: 00040000 00020000 "uboot environment"
mtd3: 00400000 00020000 "linux"
mtd4: 0a000000 00020000 "system"
mtd5: 02000000 00020000 "userdata"
mtd6: 02000000 00020000 "cache"
Step 05.02: Change to the NAND image folder and execute the NAND script
# cd /images
# ./overo-flash-onboard-nand-yaffs2.sh
Step 05.03: Remove the microSD card reboot the Overo
Best regards,
Elvis
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
To unsubscribe from this group, send email to
android-porting+unsubscribegooglegroups.com or reply to this email with the
words "REMOVE ME" as the subject.