This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x NAND boot issue.

Hi,

We are using AM335x based custom board. and NAND is S34ML08G1. System gets boot fine from SD card but  not getting boot from NAND.

After uboot prompt comes up NAND cammands works fine. Even in Linux kernel NAND gets detected. But not getting boot from NAND.

following sysboot options used

SYSBOOR[15:14] SYSBOOR[13:12] SYSBOOR[11:10] SYSBOOR[9] SYSBOOR[8] SYSBOOR[7:6] SYSBOOR[5] SYSBOOR[4:0]
01b 00b 00b 0b Dont care by ROM code Dont care by ROM code 1b 10011b


Flashing images to NAND in SD boot
Boot using SD boot mode as here.
After the 2nd stage prompt U-Boot# comes up, the images for the 1st stage and 2nd stage can be flashed to NAND
for persistent storage.

U-Boot# mtdparts

device nand0 <nand.0>, # parts = 10
#: name size offset mask_flags
0: NAND.SPL 0x00020000 0x00000000 0
1: NAND.SPL.backup1 0x00020000 0x00020000 0
2: NAND.SPL.backup2 0x00020000 0x00040000 0
3: NAND.SPL.backup3 0x00020000 0x00060000 0
4: NAND.u-boot-spl-os 0x00040000 0x00080000 0
5: NAND.u-boot 0x00100000 0x000c0000 0
6: NAND.u-boot-env 0x00020000 0x001c0000 0
7: NAND.u-boot-env.backup10x00020000 0x001e0000 0
8: NAND.kernel 0x00800000 0x00200000 0
9: NAND.rootfs 0x3f600000 0x00a00000 0

active partition: nand0,0 - (NAND.SPL) 0x00020000 @ 0x00000000

defaults:
mtdids : nand0=nand.0
mtdparts: mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u)

Flashing SPL to NAND in SD boot
Flash SPL (MLO) to NAND by executing the following commands:
1) U-Boot# mmc rescan
2) U-Boot# fatload mmc 0 0x82000000 MLO
3) U-Boot# nand erase 0x0 0x20000

NAND erase: device 0 offset 0x0, size 0x20000
Erasing at 0x0 -- 100% complete.
OK

4) U-Boot# nand write 0x82000000 0x0 0x20000

NAND write: device 0 offset 0x0, size 0x20000
131072 bytes written: OK

5) U-Boot# nand erase 0x20000 0x20000

NAND erase: device 0 offset 0x20000, size 0x20000
Erasing at 0x20000 -- 100% complete.
OK

6) U-Boot# nand write 0x82000000 0x20000 0x20000

NAND write: device 0 offset 0x20000, size 0x20000
131072 bytes written: OK

7) U-Boot# nand erase 0x40000 0x20000

NAND erase: device 0 offset 0x40000, size 0x20000
Erasing at 0x40000 -- 100% complete.
OK

8) U-Boot# nand write 0x82000000 0x40000 0x20000

NAND write: device 0 offset 0x40000, size 0x20000
131072 bytes written: OK

9) U-Boot# nand erase 0x60000 0x20000

NAND erase: device 0 offset 0x60000, size 0x20000
Erasing at 0x60000 -- 100% complete.
OK

10) U-Boot# nand write 0x82000000 0x60000 0x20000

NAND write: device 0 offset 0x60000, size 0x20000
131072 bytes written: OK

11) Erasing as 128K block chunks /* Erasing spl-os mem locn, nothing to be put
here*/
U-Boot# nand erase 0x80000 0x20000

NAND erase: device 0 offset 0x80000, size 0x20000
Erasing at 0x80000 -- 100% complete.
OK

11) U-Boot# nand erase 0xa0000 0x20000

NAND erase: device 0 offset 0xa0000, size 0x20000
Erasing at 0xa0000 -- 100% complete.
OK

If no error messages are displayed the SPL of NAND boot has been successfully
transferred to NAND.

Flashing U-Boot to NAND in SD boot
Flash the 2nd stage U-Boot (u-boot.img) to NAND by executing the following
commands:
1) U-Boot# mmc rescan

2) U-Boot# fatload mmc 0 0x82000000 u-boot.img
reading u-boot.img
367884 bytes read in 31 ms (11.3 MiB/s)

3) U-Boot# nand erase 0x000c0000 0x00100000

NAND erase: device 0 offset 0xc0000, size 0x100000
Erasing at 0x1a0000 -- 100% complete.
OK

4) U-Boot# nand write 0x82000000 0x000c0000 0x00100000

NAND write: device 0 offset 0xc0000, size 0x100000
1048576 bytes written: OK


Please let us know if any thing we are missing .