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.

AM1808 NAND boot - Peripheral Open Failed

Other Parts Discussed in Thread: AM1808

I am bringing-up a custom am1808 board (silicon rev. 2.0 ROM d800k006) configured to boot from NAND 8-bit.

The NAND is a Micron MT29F1G08ABADAWP-IT:D

#0: NAND 128MiB 3.3V 8-bit (Micron) pagesize: 2048, buswidth: 8,

blocksize: 131072, blocks: 1024 

Through JTAG debugger I am able to write an AIS binary (ubl) to block 1 of the NAND.

When setting the board to boot from NAND I am getting error 'Peripheral Open Failed'

0xffff0700: 00010500

At this point I've halted the processor and attempt accessing the NAND, to see if RBL has things set correctly:

> mwb 0x62000010 0x90

> mwb 0x62000008 0x20

> mdb 0x62000000 4

0x62000000: 4f 4e 46 49 

 Everything appears to be set correctly.  I am able to access the NAND on CS3 and issue a 'READ ID' command, notice the device is 'ONFI' compliant.

I ported the GEL files from here: http://processors.wiki.ti.com/index.php/OMAP-L1x_Debug_Gel_Files to our JTAG tool

Here are the results:

---------------------------------------------

|               BOOTROM Info                |

---------------------------------------------

ROM ID: d800k006

Silicon Revision 2.0

Boot Mode: NAND 8, 24 MHz or 12 MHz input clock

ROM Status Code: 5 

Description: Peripheral Open Failed


---------------------------------------------

|             Device Information            |

---------------------------------------------

DEV_INFO_00 = 1c14018

DEV_INFO_01 = 1c1401c

DEV_INFO_02 = 1c14020

DEV_INFO_03 = 1c14024

DEV_INFO_04 = 1c14028

DEV_INFO_05 = 1c1402c

DEV_INFO_06 = 1c14010

DEV_INFO_07-DEV_INFO_08-DEV_INFO_09-DEV_INFO_10-DEV_INFO_11-DEV_INFO_12 = 1-0-12664844-1-8-3092

DEV_INFO_13,DEV_INFO_14,DEV_INFO_15,DEV_INFO_16 = 20,0,1280,224

-----

DEV_INFO_17 = 1c12004

DEV_INFO_18 = 1c12008

DEV_INFO_19 = 00000

-----

DEV_INFO_20 = 11700008

DEV_INFO_21 = 1170000c

DEV_INFO_22 = fffd0008

DEV_INFO_23 = fffd000c

DEV_INFO_24 = 1c14008

DEV_INFO_25 = 1c1400c

DEV_INFO_06 = 1c14010

DEV_INFO_26 = 1c14014


Any Ideas of what to try next?

 

  • For the NAND boot mode, this peripheral open failed error can be a little decieiving.  The reason for this is that the NAND driver open function also tries to read the first page of the first good block, to have it buffered and ready to be used when starting the boot image parsing.  If this page read fails, which is what I believe is happening, the NAND open function fails, but the error returned is peripheral open failed.

    If it is in fact a failure of reading the page, it seems most likely to be due to ECC failure.  IS your flashing tool correctly handling generation of ECC information and placing it in the correct area of the spare bytes region of the NAND data pages?

    Regards, Daniel

  • Daniel thank you for responding.

    I'm using the davinci nand driver included in openocd to program the NAND.  I've tried the 3 different modes [hwecc1, hwecc4, and hwecc4_infix] all with the same failing result.

    In my tests I erased NAND blocks 0 and 1, wrote my AIS ubl binary to blocks 0 and block 1 (bootloader mentions starting at block 1, but wrote both anyway) starting a page 0.

     

    nand erase 0 0 0x40000

    nand write 0 ubl-ais.bin 0

    nand verify 0 ubl-ais.bin 0

    nand write 0 ubl-ais.bin 0x20000

    nand verify 0 ubl-ais.bin 0x20000

     

    I did this for all 3 modes as well as just erasing NAND completely.  I get the same result.  'Peripheral Open Failed'.

    Can you think of anyway I could verify that the failure is indeed due to ECC?

    Are there any breakpoints I could set in RBL and subsequent registers I could inspect to narrow this problem down?

    Are there any other reasons why this error might be seen?

    BTW, I was expecting to see data at 0x80000000 change regardless of ECC failure or not, is that a correct assumption?

     

    Thanks again for your help.

  • Tom Saeger said:
    BTW, I was expecting to see data at 0x80000000 change regardless of ECC failure or not, is that a correct assumption?

    Since the AIS image has not begun being parsed, no data is being copied to the load address your program was linked to run at.

    Tom Saeger said:
    Can you think of anyway I could verify that the failure is indeed due to ECC?

    One quick thing you can do is check the memory at 0xFFFF1000.  This is the location of the NAND page buffer.  If you see what appears to be AIS image data in the 512 bytes starting at that memory location, but you don't see the correct data beyond those 512 bytes, then that tells us that the NAND was correctly identified by the ROM boot loader, and that data was begun to be read, but that the ECC check at the end of the first 512 bytes failed.  If you don't see any correct AIS image data in that memory region, then either the NAND identification failed or the blocks into which you wrote the image are marked as bad, and the ROM skipped over them.

    Tom Saeger said:
    I'm using the davinci nand driver included in openocd to program the NAND.  I've tried the 3 different modes [hwecc1, hwecc4, and hwecc4_infix] all with the same failing result.

    I have no knowledge of this driver or what it does as far as ECC operations go. It's entirely conceivable that this driver doesn't work, or that it operates on the wrong chip select of the device (previous devices booted NAND from the first chip select of the EMIF, this one boots from the second). Based on the names of the modes, either hwecc4 or hwecc4_infix sounds like they would be the ones you want to try.

    Regards, Daniel

  • Daniel,

    I dumped 0xFFFF1000 as you suggested and it contains all 0xFFFFFFFF, exactly 512 bytes worth.

    I scoped CE#, ALE, and CLE of the NAND and verified things are indeed wiggling.

    I have also verified the contents of NAND at offset 0x20000 (block 1, page 0) are correct.  ECC could still be wrong, but it's hard to tell if RBL is getting that far.

    Does the RBL code ever explicitly set the page buffer to 0xFFFFFFFF?

    Otherwise from what you've suggested, either it's skipping the block or hasn't identified the NAND correctly.

     

    Thanks again for your insights on this - it has been extremely helpful.

  • Daniel,

    I switched our board into UART2 boot and used the sfh utilities to flash ubl down.  It is now booting from NAND.  I believe you were absolutely correct in figuring it was ECC.  I will mark that answer as accepted.

     

    Thanks again for you help.

  • Tom,

    Thanks for the feedback.  I'm a little perplexed as to why you were seeing 0xFFFFFFFF in the NAND page buffer, but I can only conclude that somehow the driver you were using with the JTAG setup you have was not actually writing where you think it was writing, or somehow it was writing to where you thought it was, but that the ROM was thinking that block was bad and was skipping over it.  There is a global boot loader data structure from 0xFFFF0700 - 0xFFFF0800 and one of the elements of that structure is what block and page the RBL was trying to read last, so we could dig into it further, but if you are satisfied with what you have now, we can also just let it lie.

    Regards, Daniel

  • I did get a chance to dig into this further once I got u-boot up and running.

     

    The JTAG driver is calculating CRC correctly, however the layout of the OOB bytes is different.  Now at least I know what to fix.

     

    Working:

    OOB:

            ff ff ff ff ff ff 13 d2

            03 6f d7 8e 0c fd 64 94

            ff ff ff ff ff ff 6d 8e

            99 dc 47 c6 53 16 79 ba

            ff ff ff ff ff ff c6 cf

            b3 52 98 9f a8 8a 7a 1a

            ff ff ff ff ff ff b2 b3

            b9 55 81 9b 04 bd 52 2b

     

    Not Working:

    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

            13 d2 03 6f d7 8e 0c fd

            64 94 6d 8e 99 dc 47 c6

            53 16 79 ba c6 cf b3 52

            98 9f a8 8a 7a 1a b2 b3

            b9 55 81 9b 04 bd 52 2b

    Again, Daniel thanks a ton for your help in figuring this out.