HOWTO Boot from NAND Flash on the Logic i.MX27 Lite

The Logic i.MX27 Lite boot loader, LogicLoader, does not support JFFS2 and its YAFFS implementation has a different ECC algorithm than the one used in mainline YAFFS. Hence, we use LogicLoader to burn the kernel to a YAFFS partition and we use Linux to burn the JFFS2 RFS.

Requirements

These instructions have only been tested against:

  • 2.6.24 Kernel
  • Logic Loader Version 2.4.1-IMX27_10 0001

You must also setup your host with tftp, nfs, and dhcp as per the Getting Started Guide. '$kernel_byte_size' should be replaced with the size of your kernel image in bytes.

Linux MTD partitions

NOR flash partitions

0x00000000-0x00040000 : "nor.bootloader"
0x00040000-0x00050000 : "nor.config"
0x00050000-0x00200000 : "nor.extra"

NAND flash partitions

0x00000000-0x00020000 : "IPL-SPL"
0x00020000-0x00420000 : "nand.kernel"
0x00420000-0x01a20000 : "nand.rootfs"
0x01a20000-0x04000000 : "nand.userfs"

Burning the Kernel to NAND Flash

Erase the NAND partitions

losh> erase /dev/nand0 B8 B4088

Create Kernel partition

losh> part-add /dev/nand0 a 8 256      

Copy kernel to boot partition

losh> mount yaffs /dev/nand0a /boot
losh> ifconfig sm0 dhcp
losh> cp /tftp/10.0.0.2:zImage-2.6.24-ts-armv5l /boot/uImage

Load the kernel and boot to NFS RFS

losh> load raw 0xA1000000 $kernel_byte_size /boot/uImage
losh> exec -t -i 1701

Burning the RFS to NAND Flash

Copy your jffs2 image to the rfs directory on your host and burn it to flash on the target.

# flash_eraseall /dev/mtd5
# flash_cp $jffs_image /dev/mtd5

Reboot the board and configure LogicLoader to load and boot the kernel.

Configure LogicLoader to autoboot the kernel

Create the LogicLoader config block.

losh> config CREATE                                                             
creating new config: offset: 0x0 pos: 0                                         
total size: 0x10000, address 0x40000                                            
Nor flash erase: The area (or parts of it) 0x40000 - 0x10000 is locked.         

************** WARNING!! ********************                                   

You are about to erase the config block.                                        
Do you wish to continue? (y/n)                                                  
erasing flash:  100%                                                            
burning flash:  100%                                                            
 dev_config burn good (65536 bytes)                                             

Write the boot script to the config block.

losh> echo "LOLOpart-add /dev/nand0 a 8 256; mount yaffs /dev/nand0a /boot; load raw 0xA1000000 $kernel_byte_size /boot/uImage; exec -t -i 1701 \"noinitrd console=tty0 console=ttymxc0,115200 root=/dev/mtdblock5 rootfstype=jffs2 rw ip=dhcp\"" /dev/config

Reset the board and it should automatically boot into Linux