Specifications
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
=> nand write ${kernel_addr_r} ${nand_off} ${filesize}
NAND write: device 0 offset 0x400000, size 0x216ea0
2191008 bytes written: OK
=> setenv nand_off
=> saveenv
Saving Environment to NAND...
Erasing redundant NAND...
Erasing at 0x380000 -- 25% complete.Erasing at 0x3a0000 -- 50% complete.Erasing at 0x3c0000 -- 75% complete.Erasing at 0x3e0000 -- 100% complete.
Writing to redundant NAND... done
=>
Note how the filesize variable (which gets set by the TFTP transfer) is used to automatically adjust for
the actual image size.
Since kernel requires the flattened device tree blob to be passed at boot time, you have to also write the blob
to the flash memory. Below is a transcript of this operation.
=> setenv fdt_addr_r 0x41000000
=> setenv nand_off 0x007e0000
=> setenv nand_len 0x20000
=> setenv cmp_addr_r 0x44000000
=> nand erase ${nand_off} ${nand_len}
NAND erase: device 0 offset 0x7e0000, size 0x20000
Erasing at 0x7e0000 -- 100% complete.
OK
=> tftp 0x41000000 /tftpboot/duts/m28/imx28-m28evk.dtb
Using FEC0 device
TFTP from server 192.168.1.1; our IP address is 192.168.20.33
Filename '/tftpboot/duts/m28/imx28-m28evk.dtb'.
Load address: 0x41000000
Loading: ##
done
Bytes transferred = 16547 (40a3 hex)
=> nand write ${fdt_addr_r} ${nand_off} ${filesize}
NAND write: device 0 offset 0x7e0000, size 0x40a3
16547 bytes written: OK
=> setenv nand_off
=> setenv nand_len
=> saveenv
Saving Environment to NAND...
Erasing NAND...
Erasing at 0x300000 -- 25% complete.Erasing at 0x320000 -- 50% complete.Erasing at 0x340000 -- 75% complete.Erasing at 0x360000 -- 100% complete.
Writing to NAND... done
=>
Now we can boot directly from flash. All we need to do is passing the in-flash address of the image
(42000000) and the in-flash address of the flattened device tree (41000000) with the bootm command; we
also make the definition of the bootargs variable permanent now:
=> setenv bootcmd bootm 42000000 - 41000000
=> setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
Use printenv to verify that everything is OK before you save the environment settings:
=> printenv
bootdelay=5
baudrate=115200
stdin=serial
7.6. Boot from NAND Flash Memory 95