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.

Need help with sprug9 GPMC NOR flash timing formulas

Hi,

We have a S29GL01GP11 NOR flash on our c6a816x board.  This is the same family of flash that is on our DDR2 EVM (actually on IODC) but I'm having trouble understanding the SPRUGx9 formulas for calculating what needs to go into the GPMC_CONFIGx regs.  The formulas (and examples) appear to be written for a flash that uses an ADV line and has jedec specs. for tAAVDS, tAVDP etc. and our NOR flash has none of this.

The cycle time on the larger part is a bit longer.  Can a TI person familiar with this area of the GPMC help me out?

I "think" my issue is timing but it could be something with the address lines.  (edit) I took the norflash-writer source and modified it as our GPMC_A11-GPMC_A26 are different.  I made a small hex file and flashed it and it did OK but when I used the memory browser in CCS5 the pattern I wrote was twice as much as I asked for.  I wrote 4k and 8k showed up in the memory browser.  If I try to make my test file bigger than 4k the programming fails and my guess is maybe the buffer overruns and these Spansion chips abort when that happens.

Thanks,

Brian

 

  • Update.  I think I can't trust the results of the memory browser in CCS5 to look at flash.  I repeated my experiment mentioned above on the EVM and got the same crazy results when I tried to use the memory browser read back values programmed into the NOR flash by the norflash-writer utility.

    I suspect that my problem may be more towards address line related issues.

    Is there any kind of errata on the c6a8168 regarding pin mux?  I've double and tripple checked the GPMC_A11-GPMC_A26 pin mux functions and mode bits and am starting to suspect a problem in that area.

    Regards,

    Brian

     

  • Hi Brian,

    What is the sequence you are following to view the NOR contents from CCSv5 memory window? You need to make sure that pin-mux for GPMC_A11 to GPMC_A26 are set correctly. If pin-mux is not set correctly then you will able to see only first 4KiB of NOR (and it will wrap after 4KiB).

    ROM code does not do pin-mux for NOR, you could use uboot or norflash-writer.out binary to view full NOR contents from CCSv5. The base address of NOR is 0x08000000.

    If you are using uboot then come to uboot prompt (in NOR boot) and then connect CCSv5 to view the NOR contents. If you are using norflash-writer.out binary then you could put a breakpoint after GPMC_Init() in norwriter.c. And you could view the NOR contents once this breakpoint is hit.

    If the above step is cumbersome then you could port whatever is done in GPMC_Init() into a GEL file menutiem and then use it to initialize GPMC and pin-mux before viewing NOR contents through CCSv5 memory window.

    All above steps could be used as-is on TI EVM. If you are trying it on a custom EVM then cross-check GPMC address line muxing for the that EVM. Also, on the EVM, these GPMC address lines have to be pulled down for NOR booting.

    NOTE: In c6a8168, pin-mux could be done only in ARM supervisor mode. Please make sure you are in supervisor mode when doing pin-mux configuration.

    Let us know if you need more information.

    Regards

    Mansoor

  • Hi again Mansoor,


    I shouldn't have gone into much detail with my first post as I left myself open getting off topic :)  I'll open a new thread (or two) to talk about our address lines and ccs etc. and leave this thread open for the subject of the first post .... understanding how to calculate the formulas for Async NOR.


    I'll copy you via email on the other threads I start.

    Regards,

    Brian


  • Hold on just a second MarcPyne before you go marking Mansoor's post as answering my question.  While everything he said is correct ... it did NOT answer my question.  Until someone explains those formulas in sprugx9 for GPMC Async NOR flash timing and address the subject of my original question ... the question isn't answered!

    I realized I posted in a way that could be forked so I tried to address that with another thread ...... which is here:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/119275/424474.aspx#424474

    Sorry for "rejecting" your verify but I don't want my question lost in the noise (whis is probably what will happen with it being marked "This question is Answered!") and you probably don't want me littering up the forum by posting the same question again.

    As you can see from the link above, I have pin mux working and can flash my board.  Having flash work and have it work optimal are two different things.  I'd like to understand how to calculate the values for my board and my flash part since it didn't appear to match the information presented in the sprugx9 so I'd like to understand how you guys came up with those numbers (since the NOR on the IODC doesn't have a ADV line either).

    Regards,

    Brian

     

  • Sorry about that Brian!  I misunderstood and thought that your original question was answered and that you were going to open new posts for the unanswered portion.

    Regards,
    Marc

  • Hi Brian,

    I agree with you, the values used in uboot and flashing tool or a bit longer. We went this path to support all possible NOR flash timings, by compromising  performance. These values could be tweaked based on the recommended timings from the NOR data sheet. Also, our values assume that ADV line is used.

    I have captured the timing parameters used in uboot and flashing tool below.

    • GPMC runs at 125MHz and hence 1 cycle = 8 ns
    • With TIMEPARAGRANULARITY as x2, 1 cycle = 16ns
    • Following timing parameters (in cycles) are used,
      • WR_CYCLE = 17
      • RD_CYCLE = 17
      • CS_WR_OFF = 16
      • CS_RD_OFF = 16
      • CS_ON = 1
      • ADV_WR_OFF = 2
      • ADV_RD_OFF = 2
      • ADV_ON = 1
      • WE_OFF = 15
      • WE_ON = 3
      • OE_OFF = 16
      • OE_ON = 3
      • ACCESS = 15
      • C2C_DELAY = 0
      • DATA_VALID = 3
      • WRACCESS_T = 15
      • PAGEBURSTACCESSTIME = 0
      • _BUSTURNAROUND = 0
    • ADVEXTRADELAY is OFF

    I'll also request the TRM team look into the formulas in sprux9.

    Regards

    Mansoor