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.

nand write u-boot from u-boot itself or linux

Other Parts Discussed in Thread: OMAP-L138, OMAPL138, TEST2

Hi, I'm working with lcdk developer kit. My scope will be to prepare an enviroment where it will be possible to live upgrade everything inside the board at runtime.

So I neet to be able to update u-boot, kernel and rootfs.

I'm able to update kernel and rootfs from linux and u-boot but I'm not able to upgrade u-boot.

I'm using u-boot 2012.04.01 (caming from ti) with patch for ECC, so now I have 

static struct nand_ecclayout nand_davinci_4bit_layout_oobfirst = {
#if defined(CONFIG_SYS_NAND_PAGE_2K)
.eccbytes = 40,
.eccpos = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
},
.oobfree = {{2, 4}, {16, 6}, {32, 6}, {48, 6}},

I have also change the board configuration with

#undef CONFIG_SYS_NAND_HW_ECC
#define CONFIG_SYS_NAND_4BIT_HW_ECC

and on linux eccbit is set to 4 (instead 1).

I patch also linux kernel (3.18.x) to use the same lcclayout.

Now I'm albe to flash u-boot with

./sfh_OMAP-L138.exe -flash_noubl -targetType OMAPL138_LCDK -flashType NAND -p /dev/ttyUSB4 -v /home/mdionisio/u-boot.ais

but and dump the u-boot.ais from linux without any ecc error. But if I try to write again u-boot.ais to the nand from a running linux the board does not boot any more (same issue if I do the same from u-boot).

The only working way is to dump the NAND and write it again. So it seams that there is someting more in the NAND than only the u-boot.ais file.

Someone can help me  to undestand the issue?

I have done some test.

TEST1:

1. flash with sfh_OMAP-L138.exe

2. start linux. dump u-boot partition (with and without oob) and check if the first x byte is equal to the u-boot.ais file

3. erase all u-boot partition and reflash (using linux nandwrite tool with padding option) u-boot.ais 

4. dump again u-boot partition to check if u-boot.ais file well writed

5. result is everything seams well writed but the board does not boot again

TEST2:

1. flash with sfh_OMAP-L138.exe

2. start linux. dump u-boot partition (with and without oob) and check if the first x byte is equal to the u-boot.ais file

3. erase all u-boot partition and reflash (using linux nandwrite tool) the dumped file (with and without oob) and the result is OK