sakoman.com

How to write the Linux kernel to NAND PDF Print E-mail

The images on this site are normally run from a bootable SD card.  For OMAP boards with NAND, it is also possible to boot from a NAND image.  To boot from NAND you will need to write four different binary images to NAND:

This article covers the third step of that process, the Linux kernel.  Click on each of the other links above for instructions on how to write the other images to NAND.

Unlike x-loader, the Linux kernel does not have any special requirements in the way it must be written.  As a result it can be written to NAND from either u-boot or from the Linux command line. The following instructions assume that you are using a bootable SD card prepared from the GNOME or console images available on this site.

Method 1: U-boot

Power up or reset your OMAP board and break into u-boot by pressing a key on your serial console when you see the message:

Hit any key to stop autoboot:

Next have u-boot scan to find your bootable SD card and load the Linux binary from the FAT partition of the bootable SD card.

# mmc rescan 0
# fatload mmc 0 ${loadaddr} uImage
reading uImage
2851484 bytes read

At this point the kernel binary has been copied into RAM. We now specify the use of swecc and erase the area of NAND where kernel will reside:

# nandecc sw
SW ECC selected
#nand erase 0x00280000 0x00400000
NAND erase: device 0 offset 0x280000, size 0x400000
Erasing at 0x660000 -- 100% complete.
OK

Next we write the kernel image to the just erased area of NAND:

# nand write ${loadaddr} 280000 ${filesize}
NAND write: device 0 offset 0x280000, size size 0x2b829c
2851484 bytes written: OK

Method 2: Linux

The first step in using Linux to write NAND is to mount the FAT parition of the bootable SD card so that we can read the kernel binary:

# mount -t vfat /dev/mmcblk0p1 /media/card
# ls /media/card
MLO u-boot.bin uImage

Next we erase the kernel partition:

# flash_erase /dev/mtd3 0 0
Erasing 128 Kibyte @ 1a0000 -- 100 % complete

And then write the kernel binary:

# nandwrite -p /dev/mtd3 /media/card/uImage 
Writing data to block 0 at offset 0x0

Tags: Beagle Overo How to
Last Updated on Friday, 08 July 2011 14:33
 

0 Comments

Add Comment


     

    You are here  : Home

    Advertisement

    Advertisement