Description
1. If the nand block which store u-boot.bin is bad, ROM code cannot read u-boot out. To resolve this issue, a mini nandboot is requied. The nandboot image size should be less than one nand block size, it's programmed to two place, block 0 and block 1. After nandboot bootup, it can copy u-boot.bin from nand to ddr, can skip bad block by checking factory bad block indication, with bi swap.
2. In this example, internal boot mode is required.
3. The nand device verified in this package is:
K9LAG08U0M, page size = 2KB, block size = 128KB.
HY27US08561A, page size = 512B, block size = 16KB.
4. The nandboot binary is IMX25_3STACK_nb_iplspl.bin , it is about 6KB, can be placed inside one block.
5. Bi swap is already enabled in this package.
6. When internal bootup, rom read the nandboot binary to ddr, jump to ddr to run the nandboot, then copy u-boot which start from the third nand block to ddr, and then jump to ddr u-boot pointer.
Image Layout
K9LAG08U0M | ||
page size = 2KB + 64B | ||
block size = 256KB + 8KB | ||
1 block = 128 pages | ||
Image | Block | Range in Nand |
Nandboot | 0, 1 | 0x0 ~ 0x80000 |
u-boot | 2 ~ 7 | 0x80000 ~ 0x200000 |
u-boot env | 8 ~ 11 | 0x200000 ~ 0x300000 |
uImage | 12 ~ … | 0x300000 ~ … |
HY27US08561A | ||
page size = 512B + 16B | ||
block size = 16KB + 512B | ||
1 block = 32 pages | ||
Image | Block | Range in Nand |
Nandboot | 0, 1 | 0x0 ~ 0x8000 |
u-boot | 2 ~ 127 | 0x8000 ~ 0x200000 |
u-boot env | 128 ~ 191 | 0x200000 ~ 0x300000 |
uImage | 192 ~ … | 0x300000 ~ … |
Build nandboot binary
$ ./makebuild.sh clean;./makebuild.sh IMX25_3STACK_AGL
CRC u-boot.bin
Copy u-boot.bin to image folder, rename to “Image”.
In nandboot-imx folder, run:
$ ./bin/crcgen
Eight bytes will be added to the head of u-boot.bin, the first four bytes are the size of u-boot.bin, the second four bytes are crc value.
When nandboot read u-boot image into ddr, these eight bytes will be skipped.
Program IMX25_3STACK_nb_iplspl.bin and Image_nb_crc_uboot
In ATK, program IMX25_3STACK_nb_iplspl.bin to 0x0 in nand device, without “Bi Swap” selection.
For K9LAG08U0M, set the Address to 0x80000, select “Bi Swap”.
For HY27US08561A, set the Address to 0x8000. Since bi swap does not take effect to 512 page size nand, can leave “Bi Swap” unselected.
Original Attachment has been moved to: 428-nandbootimx512pagesize.tgz