unable to load the kernel image from NAND flash using u-boot when flashed from Linux


I have an issue to boot the kernel from u-boot with a kernel image I
wrote using Linux.
Here is how I write the image:
flash_eraseall /dev/mtd4
nandwrite -p /dev/mtd4 /hd/uImage.bin
(note: I modified the flash MTD partition layout).

Things work fine with the very same kernel load from the SD card (vs.
NAND flash).
Things work also if I write the image in NAND flash from u-boot.
Also I mount the root fs on the Flash (jffs2), and the rootfs mount
works just fine (same procedure to write it using flash_eraseall and

What's happening is that u-boot fails to load the image written by
NAND read: device 0 offset 0x300000, size
NAND read from offset 300000 failed
131072 bytes read: ERROR

flash-eraseall is not the culprit, if I just erase the partition with
flash_eraseall, I can read it from u-boot.

I played a year ago or so with the Beagle board, and at the time I was
using an 'old' version of the kernel (2.6.29),
and I was able to flash the kernel from Linux w/o any trouble.

I am suspecting that u-boot and Linux might not on the same page
regarding the ECC computation.
I tried the latest u-boot (git, from denx), and many versions of the
kernel (kernel.org, omap-linux git).

Any suggestion ?
As a 'desperate' measure I am thinking to just erase the OOB part from
the kernel using some MTD IOCTL calls.