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.

DM365 NAND read error

We are trying to bring up custom board based on DM365,

We are trying to boot from the NAND,

NAND used is from micron MT29F8G08ABABA.

Organization
– Page size x8: 4320 bytes (4096 + 224 bytes)
– Block size: 128 pages (512K +28 K bytes)
– Plane size: 2 planes x 1024 blocks per plane
– Device size: 8Gb: 2048 blocks

and 4bit ECC

we made changes to Uboot to get it detected by Uboot.

In "drivers/mtd/nand/nand_ids.c" added below line

{"NAND 1GiB 3,3V 8-bit",        0x38, 0, 1024, 0, LP_OPTIONS},

 

And in "include/configs/davinci_dm365evm.h"

Removed #define CONFIG_SYS_NAND_PAGE_2K

Added #define CONFIG_SYS_NAND_PAGE_4K

Added #define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST

Existing  #define CONFIG_SYS_MAX_NAND_DEVICE      1

With above changes initially NAND write started working and we could book the Linux kernel.

But Linux kernel was not able to detect the NAND partitions.

We started experimenting in Linux and suddenly NAND read stopped working from Uboot.

We get error code "failed -74". Below is boot log,

DM36x EVM # nand info

Device 0: 2x nand0, sector size 256 KiB
DM36x EVM # setenv mtdids 'nand0=nand_davinci.0'
DM36x EVM # setenv mtdparts 'mtdparts=nand_davinci.0:15m(Bootloader),1m(config),4m(kernel),512m(Fs),-(unused)'
DM36x EVM # setenv partition 'nand0,0'
DM36x EVM # setenv mtddevnum 0
DM36x EVM # setenv mtddevname 'UBOOT'
DM36x EVM # saveenv
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x3c0000 -- 100% complete.
Writing to Nand... done
DM36x EVM # print
baudrate=115200
bootargs=mem=48M console=ttyS0,115200n8 root=/dev/mtdblock3 rootfstype=squashfs ip=192.168.1.101:192.168.1.100:192.168.1.1:255.255.255.0 eth=00:0c:0c:02:3A:DE lpj=1077248 cmemk.phys_start="0x83000000" cmemk.phys_end="0x88000000" cmemk.phys_start_1="0x00001000" cmemk.phys_end_1="0x00008000" cmemk.pools_1="1x28672" cmemk.allowOverlap="1"
bootcmd=nand read 0x80700000 0x1000000 0x400000;bootm 0x80700000
bootdelay=3
bootfile="uImage"
ethact=DaVinci-EMAC
mtddevname=UBOOT
mtddevnum=0
mtdids=nand0=nand_davinci.0
mtdparts=mtdparts=nand_davinci.0:15m(Bootloader),1m(config),4m(kernel),512m(Fs),-(unused)
partition=nand0,0
stderr=serial
stdin=serial
stdout=serial
ver=U-Boot 2010.12-rc2 (Nov 20 2013 - 10:39:01)

Environment size: 755/262140 bytes
DM36x EVM # reset
resetting ...
DM36x initialization passed!
TI UBL Version: 1.50
Booting Catalog Boot Loader
BootMode = NAND
Starting NAND Copy...
Valid magicnum, 0xA1ACED66, found in block 0x00000019.
   DONE
Jumping to entry point at 0x81080000.


U-Boot 2010.12-rc2 (Nov 20 2013 - 10:39:01)

Cores: ARM 297 MHz
DDR:   243 MHz
I2C:   ready
DRAM:  128 MiB
NAND:  2048 MiB
MMC:   davinci: 0, davinci: 1
Net:   LNT:PINMUX3 configured 1affff
Read from EEPROM @ 0x50 failed
No ETH PHY detected!!!
DaVinci-EMAC
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x1000000, size 0x400000
NAND read from offset 1000000 failed -74
 0 bytes read: ERROR
## Booting kernel from Legacy Image at 80700000 ...
   Image Name:   Linux-2.6.32.17-davinci1
   Created:      2013-11-20   0:35:41 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2177420 Bytes = 2.1 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... Bad Data CRC
ERROR: can't get kernel image!

Now my doubt is what could be error in NAND Read ?

What is this code -74 ?

Any help is appreciated.

Thank you,

Ankur

  • Adding some more information

    on nand read following output is printed

    DM36x EVM # nand read 0x80700000 0x1000000 0x100000

    NAND read: device 0 offset 0x1000000, size 0x100000
    nand_isbad_bbt(): bbt info for offs 0x01000000: (block 0) 0x40
    nand_isbad_bbt(): bbt info for offs 0x01040000: (block 0) 0x41
    nand_isbad_bbt(): bbt info for offs 0x01080000: (block 0) 0x42
    nand_isbad_bbt(): bbt info for offs 0x010c0000: (block 0) 0x43
    NAND read from offset 1000000 failed -74
     0 bytes read: ERROR

    Please let me know if you any suggestion for this...

    thank you,

    Ankur

  • Adding some more information, below log shows nand write is fine but nand read is not working.

    Below log shows nand dump of write address also to confirm that nand write is working fine.

    DM36x EVM # loadb
    ## Ready for binary (kermit) download to 0x80700000 at 115200 bps...
    ## Total Size      = 0x00213440 = 2176064 Bytes
    ## Start Addr      = 0x80700000
    DM36x EVM # nand write 0x80700000 0x1000000 0x400000
    
    NAND write: device 0 offset 0x1000000, size 0x400000
     4194304 bytes written: OK
    DM36x EVM # nand read 0x80700000 0x1000000 0x400000
    
    NAND read: device 0 offset 0x1000000, size 0x400000
    NAND read from offset 1000000 failed -74
     0 bytes read: ERROR
    DM36x EVM # nand
    nand - NAND sub-system
    
    Usage:
    nand info - show available NAND devices
    nand device [dev] - show or set current device
    nand read - addr off|partition size
    nand write - addr off|partition size
        read/write 'size' bytes starting at offset 'off'
        to/from memory address 'addr', skipping bad blocks.
    nand erase[.spread] [clean] [off [size]] - erase 'size' bytes from offset 'off'
        With '.spread', erase enough for given file size, otherwise,
        'size' includes skipped bad blocks.
    nand erase.part [clean] partition - erase entire mtd partition'
    nand erase.chip [clean] - erase entire chip'
    nand bad - show bad blocks
    nand dump[.oob] off - dump page
    nand scrub off size | scrub.part partition | scrub.chip
        really clean NAND erasing bad blocks (UNSAFE)
    nand markbad off [...] - mark bad block(s) at offset (UNSAFE)
    nand biterr off - make a bit error at offset (UNSAFE)
    DM36x EVM # nand dump 0x1000000
    Page 01000000 dump:
            27 05 19 56 fd ee db 27  52 8c f7 bc 00 21 34 00
            80 00 80 00 80 00 80 00  ca c4 ff 2a 05 02 02 00
            4c 69 6e 75 78 2d 32 2e  36 2e 33 32 2e 31 37 2d
            64 61 76 69 6e 63 69 31  00 00 00 00 00 00 00 00
            00 00 a0 e1 00 00 a0 e1  00 00 a0 e1 00 00 a0 e1
            00 00 a0 e1 00 00 a0 e1  00 00 a0 e1 00 00 a0 e1
            02 00 00 ea 18 28 6f 01  00 00 00 00 00 34 21 00
            01 70 a0 e1 02 80 a0 e1  00 20 0f e1 03 00 12 e3
            01 00 00 1a 17 00 a0 e3  56 34 12 ef 00 20 0f e1
            c0 20 82 e3 02 f0 21 e1  00 00 00 00 00 00 00 00
            d0 00 8f e2 7e 38 90 e8  01 00 50 e0 0a 00 00 0a
            00 50 85 e0 00 b0 8b e0  00 c0 8c e0 00 20 82 e0
            00 30 83 e0 00 d0 8d e0  00 10 9b e5 00 10 81 e0
            04 10 8b e4 0c 00 5b e1  fa ff ff 3a 00 00 a0 e3
            04 00 82 e4 04 00 82 e4  04 00 82 e4 04 00 82 e4
            03 00 52 e1 f9 ff ff 3a  28 00 00 eb 0d 10 a0 e1
            01 28 8d e2 02 00 54 e1  16 00 00 2a 06 00 84 e0
            05 00 50 e1 13 00 00 9a  02 50 a0 e1 05 00 a0 e1
            07 30 a0 e1 11 0c 00 eb  ff 00 80 e2 7f 00 c0 e3
            00 10 85 e0 a1 2f 8f e2  5c 30 9f e5 03 30 82 e0
            00 5e b2 e8 00 5e a1 e8  00 5e b2 e8 00 5e a1 e8
            03 00 52 e1 f9 ff ff 3a  01 d0 a0 e1 80 d0 8d e2
            4e 01 00 eb 00 f0 85 e0  04 00 a0 e1 07 30 a0 e1
            fe 0b 00 eb a0 00 00 ea  38 01 00 00 00 34 21 00
            44 b8 21 00 00 80 00 80  00 00 00 00 20 ce 84 00
            88 33 21 00 f4 33 21 00  44 c8 21 00 94 04 00 00
            08 30 a0 e3 9a 00 00 ea  3f 00 a0 e3 17 0f 06 ee
            37 0f 06 ee 80 00 a0 e3  10 0f 02 ee 30 0f 02 ee
            10 0f 03 ee 03 09 a0 e3  30 0f 05 ee 10 0f 05 ee
            00 00 a0 e3 9a 0f 07 ee  15 0f 07 ee 16 0f 07 ee
            10 0f 11 ee 2d 00 80 e3  01 0a 80 e3 10 0f 01 ee
            00 00 a0 e3 15 0f 07 ee  16 0f 07 ee 0e f0 a0 e1
            3f 00 a0 e3 17 0f 06 ee  80 00 a0 e3 10 0f 02 ee
            10 0f 03 ee 03 09 a0 e3  10 0f 05 ee 00 00 a0 e3
            10 0f 07 ee 10 0f 11 ee  0d 00 80 e3 00 00 a0 e3
            10 0f 01 ee 10 0f 07 ee  0e f0 a0 e1 01 39 44 e2
            ff 30 c3 e3 3f 3c c3 e3  03 00 a0 e1 20 99 a0 e1
            09 99 a0 e1 01 a2 89 e2  12 10 a0 e3 03 1b 81 e3
            01 29 83 e2 09 00 51 e1  0c 10 81 23 0a 00 51 e1
            0c 10 c1 23 04 10 80 e4  01 16 81 e2 02 00 30 e1
            f7 ff ff 1a 1e 10 a0 e3  03 1b 81 e3 2f 2a a0 e1
            02 1a 81 e1 02 01 83 e0  04 10 80 e4 01 16 81 e2
            00 10 80 e5 0e f0 a0 e1  0e c0 a0 e1 e2 ff ff eb
            00 00 a0 e3 9a 0f 07 ee  17 0f 08 ee 10 0f 11 ee
            05 0a 80 e3 30 00 80 e3  2c 00 00 eb 00 00 a0 e3
            17 0f 08 ee 0c f0 a0 e1  0e c0 a0 e1 91 bf 10 ee
            0f 00 1b e3 d4 ff ff 1b  00 00 a0 e3 9a 0f 07 ee
            0f 00 1b e3 17 0f 08 1e  10 0f 11 ee 05 0a 80 e3
            3c 00 80 e3 01 00 80 13  00 10 e0 13 10 3f 02 1e
            10 1f 03 1e 10 0f 01 ee  10 0f 11 ee 00 00 a0 e3
            95 0f 07 ee 0c f0 a0 e1  0e c0 a0 e1 c2 ff ff eb
            00 00 a0 e3 17 0f 07 ee  9a 0f 07 ee 17 0f 08 ee
            10 0f 11 ee 01 0a 80 e3  0c 00 00 eb 00 00 a0 e3
            17 0f 08 ee 0c f0 a0 e1  0e c0 a0 e1 b6 ff ff eb
            00 00 a0 e3 10 0f 07 ee  10 0f 05 ee 30 00 a0 e3
            02 00 00 eb 00 00 a0 e3  10 0f 05 ee 0c f0 a0 e1
            0d 00 80 e3 00 10 e0 e3  10 3f 02 ee 10 1f 03 ee
            02 00 00 ea 00 00 a0 e1  00 00 a0 e1 00 00 a0 e1
            10 0f 01 ee 10 0f 11 ee  20 f0 4e e0 00 00 a0 e1
            00 00 a0 e1 00 00 a0 e1  00 00 a0 e1 00 00 a0 e1
            00 90 85 e0 80 90 49 e2  04 10 a0 e1 0d 5c b5 e8
            0d 5c a1 e8 0d 5c b5 e8  0d 5c a1 e8 0d 5c b5 e8
            0d 5c a1 e8 0d 5c b5 e8  0d 5c a1 e8 09 00 55 e1
            f5 ff ff 3a 01 d0 a0 e1  80 d0 8d e2 a7 00 00 eb
            76 00 00 eb 00 00 a0 e3  07 10 a0 e1 08 20 a0 e1
            04 f0 a0 e1 1c c0 8f e2  10 9f 10 ee 00 10 9c e5
            04 20 9c e5 09 10 21 e0  02 00 11 e1 03 f0 8c 00
            14 c0 8c e2 f8 ff ff ea  00 06 56 41 e0 ff ff ff
            88 00 00 ea 87 00 00 ea  0e f0 a0 e1 00 00 00 00
            00 f0 00 00 0e f0 a0 e1  0e f0 a0 e1 0e f0 a0 e1
            00 70 00 41 00 fe f8 ff  80 00 00 ea 7f 00 00 ea
            0e f0 a0 e1 00 72 80 41  00 ff ff ff 89 ff ff ea
            66 00 00 ea 0e f0 a0 e1  00 74 00 41 00 ff 00 ff
            5a ff ff ea 5b 00 00 ea  e8 00 00 ea 00 94 00 41
            00 ff 00 ff 3f ff ff ea  4e 00 00 ea 7d 00 00 ea
            60 92 06 41 f0 ff 0f ff  7a ff ff ea 57 00 00 ea
            c0 00 00 ea 00 70 00 00  00 f0 00 00 0e f0 a0 e1
            0e f0 a0 e1 0e f0 a0 e1  00 a1 01 44 e0 ff ff ff
            70 ff ff ea 4d 00 00 ea  bb 00 00 ea 10 b1 01 69
            f0 ff ff ff 6b ff ff ea  48 00 00 ea b6 00 00 ea
            30 69 05 56 f0 ff 0f ff  66 ff ff ea 43 00 00 ea
            b1 00 00 ea 00 80 15 56  00 f0 ff ff 61 ff ff ea
            3e 00 00 ea a7 00 00 ea  30 69 05 56 f0 ff 0f ff
            5c ff ff ea 39 00 00 ea  a7 00 00 ea 00 00 05 56
            00 00 0f ff 57 ff ff ea  34 00 00 ea 9d 00 00 ea
            61 52 01 66 f1 ff 01 ff  72 ff ff ea 2f 00 00 ea
            5e 00 00 ea 00 00 02 00  00 00 0f 00 4d ff ff ea
            2a 00 00 ea 98 00 00 ea  00 00 05 00 00 00 0f 00
            48 ff ff ea 25 00 00 ea  93 00 00 ea 00 00 06 00
            00 00 0f 00 43 ff ff ea  20 00 00 ea 8e 00 00 ea
            00 b0 07 00 00 f0 0f 00  3e ff ff ea 1b 00 00 ea
            4f 00 00 ea 00 00 0f 00  00 00 0f 00 45 ff ff ea
            1d 00 00 ea 50 00 00 ea  00 00 00 00 00 00 00 00
            0e f0 a0 e1 0e f0 a0 e1  0e f0 a0 e1 00 00 a0 e1
            0c 30 a0 e3 8a ff ff ea  10 0f 11 ee 0d 00 c0 e3
            10 0f 01 ee 00 00 a0 e3  9a 0f 07 ee 16 0f 07 ee
            15 0f 07 ee 0e f0 a0 e1  10 0f 11 ee 0d 00 c0 e3
            10 0f 01 ee 00 00 a0 e3  10 0f 07 ee 0e f0 a0 e1
            10 0f 11 ee 0d 00 c0 e3  10 0f 01 ee 00 00 a0 e3
            17 0f 07 ee 17 0f 08 ee  0e f0 a0 e1 10 0f 11 ee
            0d 00 c0 e3 10 0f 01 ee  0e c0 a0 e1 2e 00 00 eb
            00 00 a0 e3 17 0f 08 ee  d5 0f 07 ee 9a 0f 07 ee
            95 0f 07 ee 0c f0 a0 e1  30 00 a0 e3 01 00 00 ea
            70 00 a0 e3 ff ff ff ea  10 0f 01 ee 00 00 a0 e3
            10 0f 07 ee 10 0f 05 ee  0e f0 a0 e1 00 00 a0 e1
            00 00 a0 e1 00 00 a0 e1  00 00 a0 e1 00 00 a0 e1
            10 30 a0 e3 5a ff ff ea  01 20 a0 e3 00 30 a0 e3
            16 cf 07 ee e0 10 a0 e3  3f 33 81 e3 5e 3f 07 ee
            01 33 53 e2 fc ff ff 2a  20 10 51 e2 f9 ff ff 2a
            00 00 32 e3 15 cf 07 1e  9a cf 07 ee 0e f0 a0 e1
            00 10 a0 e3 1e 1f 07 ee  15 1f 07 ee 9a 1f 07 ee
            0e f0 a0 e1 00 10 a0 e3  1e 1f 07 ee 15 1f 07 ee
            1f 1f 07 ee 9a 1f 07 ee  0e f0 a0 e1 b1 af 10 ee
            0f 08 1a e3 00 a0 a0 e3  01 00 00 0a 1e af 07 ee
            23 00 00 ea ba af 07 ee  ff 0e 2d e9 30 0f 30 ee
            07 34 10 e2 a3 3b a0 e1  1a 00 00 0a 00 a0 a0 e3
            aa 20 8a e0 30 12 a0 e1  07 10 01 e2 02 00 51 e3
            11 00 00 ba 10 af 40 ee  95 af 07 ee 10 1f 30 ee
            07 20 01 e2 04 20 82 e2  dc 40 9f e5 a1 41 14 e0
            14 5f 6f e1 d4 70 9f e5  a1 76 17 e0 04 90 a0 e1
            19 b5 8a e1 17 b2 8b e1  5e bf 07 ee 01 90 59 e2
            fa ff ff aa 01 70 57 e2  f7 ff ff aa 02 a0 8a e2
            0a 00 53 e1 e5 ff ff ca  ff 0e bd e8 00 a0 a0 e3
            10 af 40 ee 9a af 07 ee  15 af 07 ee 9a af 07 ee
            95 af 07 ee 0e f0 a0 e1  7e ff 17 ee fd ff ff 1a
            15 0f 07 ee 9a 0f 07 ee  0e f0 a0 e1 01 28 a0 e3
            20 b0 a0 e3 30 3f 10 ee  09 00 33 e1 09 00 00 0a
            23 19 a0 e1 07 10 01 e2  01 2b a0 e3 12 21 a0 e1
    OOB:
            ff ff ff ff ff ff ff ff
            ff ff ff ff ff ff ff ff
            ff ff ff ff ff ff ff ff
            ff ff ff ff ff ff ff ff
            ff ff ff ff ff ff ff ff
            ff ff ff ff ff ff ff ff
            f6 66 97 e4 62 78 27 c4
            b8 c6 f2 25 03 8c ad 8b
    DM36x EVM #

    I am still digging further..please do let me know if you have any suggestions for me.

  • I used uboot from IPNC_RDK Version5 and added support for above mentioned nand.

    with latest uboot NAND read is working fine.