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.

dm6446 evm nand flash cannot upgrade kernel from user space

Hi,

I have some problem to upgrade kernel image in a NAND flash partition on dm6446 evm board.  I use stock u-boot 1.2.0 from DVSDK 2.00 configured for NAND flash, and stock mvpro5 kernel from DVSDK 2.00 with NAND support, and default NAND partition table in the kernel: 256K bootloader, 128K params, 4M kernel, and the rest for file system on the EMV 64MB NAND flash.

The kernel is bootable if I use u-boot command

tftp
nand erase
60000 140000
nand write 80700000 60000 140000

but if I boot to nfs file system extracted from stock DVSDK 2.00 target file system, and use

flash_eraseall /dev/mtd2
nandwrite -p /dev/mtd2 uImage

to write the kernel image from user space, after reboot the u-boot report read error.  I tried to write to mtd3 and had the same results.  The "nand dump" command showed there are some data been written to these addresses instead of 0xff.

After checking the TI wiki and google, I suspect it's something about the NAND layout.  I played with the kernel options, like "Support for standard NAND layout on Davinci SOC's" in NAND device driver section, but have no success.  I also tried different partition table and leave more space (1MB) for u-boot and it's same.  With different u-boot, like 2010.12 from official u-boot web site and 2009.06 from arago git, it could load the uImage headers but still cannot read all the kernel image properly.

Did anybody try this on DVSDK 2.00? It's a blocking issue of our product and thanks in advance for any suggestion.

  • Hi,

    This seems to be an issue of mis-match in the ECC layout followed by U-Boot and Linux. When you are writing the Kernel image from Kernel, the ECC is stored in certain locations of NAND spare area but U-Bot is expecting the ECC bytes to be stored at some other offset of NAND spare area. This is the reason for the read error from U-Boot.

    Refer to http://processors.wiki.ti.com/index.php/Nand_ECC_layouts for the workaround. Please note that this page is generic and the information provided in this page may vary depending on the U-Boot and Kernel version you are using.

    Regards, Sudhakar

  • Thanks for the information.  I checked the document and the patch inside it but found it is for DM365 with 4-bit ECC.  As far as I know, DM6446 supports only 1-bit ECC, so I am a little bit confused about how to use the patch.  By the way, the document did not state what version the patch should be applied for.  The relative source code does not exist in u-boot 1.2.0 from DVSDK 2.00 or even 2009.06 from arago git for dm6446, but only in latest 2010.12 from official u-boot.  Is there anything that I can try on dm6446 evm?

  • Hi,

    You are right, DM644x uses 1 bit ECC. I also noticed the read error with u-boot 2009.06 from arago, but kernel booted well for me. It seems that U-Boot and Linux are using different logic to generate ECC.

    I noticed that by defining CONFIG_SYS_DAVINCI_BROKEN_ECC macro in include/configs/davinci_dvevm.h file of u-boot 2009.06, even the read error went away. I was able to boot the Kernel written from Linux. If you see the "doc/README.nand" file in u-boot, it says:

       CONFIG_SYS_DAVINCI_BROKEN_ECC
          Versions of U-Boot <= 1.3.3 and Montavista Linux kernels
          generated bogus ECCs on large-page NAND. Both large and small page
          NAND ECCs were incompatible with the Linux davinci git tree (since
          NAND was integrated in 2.6.24).
          Turn this ON if you want backwards compatibility.
          Turn this OFF if you want U-Boot and the Linux davinci git kernel
          to use the same ECC format.

    So, I think you need to define this macro to get things working.

    Regards, Sudhakar

  • Thanks.  It is working now after we compiled stock u-boot 2009.06 with CONFIG_SYS_DAVINCI_BROKEN_ECC defined.