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.

DM8148: NAND unable to read 2nd stage bootloader

Hi,

I am using PSP release from TI81XXPSP_04.04.00.01 when I cross compiled and flashed 1st and 2nd stage botaloader following this link http://processors.wiki.ti.com/index.php/UBIFS_BCH8_Implementation#Flashing_from_Kernel  but when done I see it gets hung while reading the 2nd stage bootloader,

U-Boot 2010.06-dirty (Oct 16 2014 - 12:02:11)

TI8148-GP rev 2.1

ARM clk: 600MHz
DDR clk: 400MHz

DRAM:  2 GiB
NAND:  HW ECC BCH8 Selected
256 MiB
Using default environment

The 2nd stage U-Boot will now be auto-loaded
Please do not interrupt the countdown till TI8148_EVM prompt if 2nd stage is already flashed
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x20000, size 0x40000

I have also added CONFIG_BOOTDELAY to 3 and the manually tried this command 'nand read 0x81000000 0x20000 0x40000' I see its getting hung here, I dont have a JTAG to see where exactly this happens but how do I solve this ?

I have similar post here http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/352245.aspx but not sure its solved ? If I flash the PSP images it reads properly and u-boot comes up.

But I get following errors:

NAND read: device 0 offset 0x20000, size 0x40000
ECC: uncorrectable.
NAND read from offset 20000 failed -74
 262144 bytes read: ERROR

So to see that it really wrote the image I tried to dump, and the contents are present

nanddump -f dump -n -l 0x40000 -p /dev/mtd1                                                                                                             
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00040000...
# less dump                                                                                                                                               
0x00000000: 12 00 00 ea 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5
0x00000010: 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5
0x00000020: 20 01 70 80 80 01 70 80 e0 01 70 80 40 02 70 80
0x00000030: a0 02 70 80 00 03 70 80 60 03 70 80 78 56 34 12
0x00000040: 00 00 70 80 00 00 70 80 cc c7 72 80 d4 4f 76 80
0x00000050: 00 00 0f e1 1f 00 c0 e3 d3 00 80 e3 00 f0 29 e1
0x00000060: 68 00 4f e2 2c 10 1f e5 01 00 50 e1 07 00 00 0a
0x00000070: 34 20 1f e5 34 30 1f e5 02 20 43 e0 02 20 80 e0
0x00000080: f8 07 b0 e8 f8 07 a1 e8 02 00 50 e1 fb ff ff da
0x00000090: 58 00 1f e5 0a 09 40 e2 80 00 40 e2 0c d0 40 e2
0x000000a0: 07 d0 cd e3 64 00 1f e5 64 10 1f e5 00 20 a0 e3
0x000000b0: 00 20 80 e5 01 00 50 e1 04 00 80 e2 fb ff ff 1a
0x000000c0: 15 0f 07 ee 9a 0f 07 ee 95 0f 07 ee 04 f0 1f e5
0x000000d0: 48 05 70 80 00 00 a0 e3 17 0f 08 ee 15 0f 07 ee
0x000000e0: d5 0f 07 ee 9a 0f 07 ee 95 0f 07 ee 10 0f 11 ee
0x000000f0: 02 0a c0 e3 07 00 c0 e3 02 00 80 e3 02 0b 80 e3
0x00000100: 01 0a 80 e3 10 0f 01 ee 0e c0 a0 e1 ac 00 00 eb
0x00000110: 0c e0 a0 e1 0e f0 a0 e1 00 f0 20 e3 00 f0 20 e3
0x00000120: e4 d0 1f e5 0a d9 4d e2 88 d0 4d e2 00 e0 8d e5
0x00000130: 00 e0 4f e1 04 e0 8d e5 13 d0 a0 e3 0d f0 69 e1
0x00000140: 0f e0 a0 e1 0e f0 b0 e1 48 d0 4d e2 ff 1f 8d e8
0x00000150: 14 21 1f e5 0a 29 42 e2 88 20 42 e2 0c 00 92 e8
0x00000160: 48 00 8d e2 34 50 8d e2 0e 10 a0 e1 0f 00 85 e8

How do I fix it ? Please help on this!

Thanks & Regards

Mike

  • Hi,

    To put some more light, I tried following

    # nandtest -m -k -p 2 /dev/mtd0
    ECC corrections: 0
    ECC failures   : 0
    Bad blocks     : 0
    BBT blocks     : 0
    00000000: checking...
    Finished pass 1 successfully
    00000000: checking...
    Finished pass 2 successfully

    But when I did the same on /dev/mtd1

    # nandtest -m -k -p 2 /dev/mtd1
    ECC corrections: 0
    ECC failures   : 8
    Bad blocks     : 0
    BBT blocks     : 0
    00020000: reading...
    Short read (49152 bytes)
    #

    I get Short read and not 'pas X succesfull'

    How to fix it ?

    Thanks & Regards

    Mike

  • Mike,

    Is there any specific reason to post/ask DM814x questions in the DM816x forum?

    Are you using DM814x EVM or DM814x custom board?

    Are you using DM814x EZSDK 5.05.02.00?

    Regards,
    Pavel

  • Hi Pavel,

    That was a mistake! Sorry for that.

    I am using the DM8148 EVM and using http://arago-project.org/git/projects/?p=u-boot-omap3.git;a=shortlog;h=refs/heads/TI81XXPSP_04.04.00.01 release.

    Thanks & Regards

    Mike

  • Mike,

    The latest u-boot code is:

    http://arago-project.org/git/projects/?p=u-boot-omap3.git;a=shortlog;h=refs/heads/ti81xx-master

    Can you try to apply the below patch. Does it make any difference?

    http://arago-project.org/git/projects/?p=u-boot-omap3.git;a=commit;h=6edf92d4089aada02b6b19b912ac63763ae00483

    Regards,
    Pavel

  • Hi Pavel,

    Neither does ti81xx-master branch help, No difference with the patch either! In the SD boot mode I tried the following:

    TI8148_EVM#nand read 0x81000000 0x20000 0x40000;

    NAND read: device 0 offset 0x20000, size 0x40000

    It gets hung again!

    Thanks & Regards

    Mike

  • Mike,

    Have you put some printf statements in the u-boot? We have cases when you put printf in u-boot in too early stage, then it can not boot.

    Regards,
    Pavel

  • Hi,

    I tried the following in SD boot mode:-

    $ nandecc hw 2

    $ nand read 0x81000000 0x20000 0x40000;

    The above gets hung!

    Then later again I did a power reset in SD boot mode:-

    $ nandecc hw 0

    $ nand read 0x81000000 0x20000 0x40000;

    This time it doesnt hang but i get following errors :-

    Error: Bad compare! failed
    Error: Bad compare! failed
    Error: Bad compare! failed
    Error: Bad compare! failed
    Error: Bad compare! failed
    NAND read from offset 20000 failed -74
     262144 bytes read: ERROR

    Even after the errors then I did go 0x81000000 it booted up!

    But why does it fail to read with ecc hw set to 2 ? How should I fix it ?

    Thanks & Regards

    MIke

  • Hi Pavel,

    No I  havent added any print statements in u-boot.

    Thanks & Regards

    Mike

  • Mike,

    mike A said:

    I tried the following in SD boot mode:-

    $ nandecc hw 2

    $ nand read 0x81000000 0x20000 0x40000;

    The above gets hung!

    Can you try with:

    $ nandecc hw 2

    $ nand read 0x81000000 0x400000 0x40000

    Regards,
    Pavel

  • Hi Pavel,

    It gets hung as-well. for curiosity I also tried offset 0x0 as-well  it gets hung too.

    so probably i need to modify u32 get_sysboot_bw(void)
    {
        int bw;
        bw = __raw_readl(CONTROL_STATUS) & (SYSBOOT_BW_MASK);
        bw >>= SYSBOOT_BW_POS;
        if (bw == 0)    /* 8-bit nand if BTMODE BW pin on board is ON */
            return 0;
        else if (bw == 1)/* 16-bit nand if BTMODE BW pin on board is OFF */
            return 1;

        /* Failed to detect */
        return -1;
    }

    Thanks & Regards

    Mike

  • Hi Pavel,

    might be that the developer has forgotten to commit the code onto git repo ? as because if I flash the prebuilt image from the TI81XX-LINUX-PSP-04.04.00.02 release it boots up.

    Thanks & Regards

    Mike

  • Mike,

    On DM814x EVM PG2.1, the NAND chip is 16-bit, and we should switch BOOT MOD SEL 8 to 1 (ON).

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_04.04.00.01_Release_Notes#TI81xx

    See also if the below e2e threads will be in help:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/308384.aspx

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/302303.aspx

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/302303.aspx

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/187883.aspx

    Regards,
    Pavel

  • Hi Pavel,

    The switch 8 of S1 is ON, if it is off NAND wont be detected in case of SD boot mode.

    How does the prebuilt image work from the psp ? and not from source ?

    Thanks & Regards

    Mike

  • Hi Pavel,


    here is the complete o/p  in case of NAND boot mode:

    U-Boot 2010.06-00006-gbf74874 (Oct 16 2014 - 15:54:09)

    TI8148-GP rev 2.1

    ARM clk: 600MHz
    DDR clk: 400MHz

    DRAM:  1 GiB
    DCACHE:  Off
    NAND:  HW ECC BCH8 Selected
    256 MiB
    Using default environment

    The 2nd stage U-Boot will now be auto-loaded
    Please do not interrupt the countdown till TI8148_EVM prompt if 2nd stage is already flashed
    Hit any key to stop autoboot:  0

    NAND read: device 0 offset 0x20000, size 0x40000

    And it gets hung here!

    Thanks & Regards,

    Mike

  • Hi Pavel,

    It already give error if S8 is off,

    U-Boot 2010.06-00006-gbf74874 (Oct 16 2014 - 15:54:09)

    TI8148-GP rev 2.1

    ARM clk: 600MHz
    DDR clk: 400MHz

    DRAM:  1 GiB
    DCACHE:  Off
    NAND:  HW ECC BCH8 Selected
    256 MiB
    Using default environment

    The 2nd stage U-Boot will now be auto-loaded
    Please do not interrupt the countdown till TI8148_EVM prompt if 2nd stage is already flashed
    Hit any key to stop autoboot:  0

    NAND read: device 0 offset 0x20000, size 0x40000

    Thanks & Regards,

    Mike

  • Mike,

    mike A said:
    How does the prebuilt image work from the psp ? and not from source ?

    Have you made any changes in the source? Please provide me all your steps to build u-boot.min.nand and u-boot.bin from source.

    Regards,
    Pavel

  • Mike,

    mike A said:
    might be that the developer has forgotten to commit the code onto git repo ? as because if I flash the prebuilt image from the TI81XX-LINUX-PSP-04.04.00.02 release it boots up.

     

    Can you try with prebuilt images from PSP 04.04.00.01 release, does it boot fine?

    http://software-dl.ti.com/dsps/dsps_public_sw/psp/LinuxPSP/TI81XX_04_04/index.html

    Regards,
    Pavel

  • Hi Pavel,

    Can you try the release branch on your evm ? The prebuilt images from the psp release works fine.

    Thanks & Regards

    Mike

  • Mike,

    I tried with building new bootloaders (not with the pre-built bootloaders), and it boots fine, see the below post for more info:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/376127/1323557.aspx#1323557

    BR
    Pavel