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.

DDR3 Initialization6678

I am working on 6678 DSP booting through SPI norflash and my application uses DDR3. I am trying to initialize DDR3 but it is not happening. I come across this post in TI e2e forum  and wanted to clarify some doubts. Can some one who have done ddr3 initialization and booting using two stage boot  please help me or throw some valid insight. I wanted to know What read_addr_msw and read_addr_lsw  I have to use. Can any one please share  what steps to follow exactly, like
 my main{
DDR3 Intialization( DDR3 initialization values )
param table(what param table values to use)
romreentry()
 my application}


What regions I have to put in L2RAM and DDR3 in .cmd file. I am posting so many posts in this forum but I am not getting exactly what has to be done.

Regards,

Nithin

  • Hi Nithin,

    I suppose your question regarding values  of read_addr_msw and read_addr_lsw is regarding the values you need to populate for those fields when you load a new boot parameter table in your first stage after the DDR has been initialized. For this you need to format your boot image/boot media appropriately. If the boot table for your first stage end at 0x5ff then you could flash your second stage image 0x700 and then program your read_addr_lsw to 0x700 and your read_addr_msw to 0x0000. The field represents 16 bit or 24 bit address field where the boot ROM would look for the boot image. Your first stage always should reside at address 0x00000000 on the SPI flash.

    In order to make sure your boot image is formatted correctly. Make sure it looks like this I have drawn this for the example provided above.

    All of your first stage code should run from either DSP internal memory or the MSMC memory. After your first stage boot completes and your DDR initialization is completed your code can be loaded in the DDR memory. If you plan to re-enter the boot ROM ensure that the boot magic address for the boot the boot core is zeroed out beore you re-enter the boot ROM. The boot ROM renetry address is 0x20b00008. After you re-enter the boot ROM the boot ROM will use the custom parameter table that you loaded in your irst stage in order to read the second stage from location 0x700 and then load the code into DDR.

    Regards,

    Rahul

  • Thank You Very Much Rahul,

    Can I implement DDR initialization without reentering the boot ROM?(My main{DDR Initialization,param table, myapplication) Please suggest. Can you have/share any document or example project which demonstrates  the two stage boot. I am trying with the steps you suggested and I will let you know the status. Thank you very much.

    Regards,

    Nithin

  • Hi Nithin,

    There is an example of multi stage boot in the MCSDK 2.x if you are using IBL like on the EVM. You can find the example under mcsdk_2_01_02_06\tools\boot_loader\examples\srio\srioboot_ddrinit.that example shows two stage booting on the EVM using IBL functionality.

    In case you don`t have an IBL and are directly booting from SPI, you can do the following.

    Step1 : Add _romtBootReentry_addr=0x20b00008; at the top of your .cmd file. this is the memory location in the L2ROM to re-enter bootROM.

    Step 2: In your source file, you will need to replace the boot parameter table to let the boot ROM know where your second stage boot table is located. Boot parameter table is located at 0x00873680 (Refer 2.4 in Data Manual). Description of the boot parameter table structure is given in section 2.5.3 of the data manual. You can keep most of the field of the parameter the same but replace the Read Addr MSW and Read Addr LSW to point to second stage. and then add the following code to your first stagesource when you want to re-enter the bootROM.

    main(){

    void (*fcn)(void);

    --------

    /*Replace boot parameter table*/

    /*Do DDR initialization*/

    ----------

    /* Re-enter the boot rom without sampling the boot strap pins again to allow the modified boot parameter table to be used for boot */
        fcn = (void (*)(void))&romtBootReentry_addr;
        (*fcn)();

    }

    For second part of your question. Yes, you might be able to initialize DDR without re-entering bootROM but this requires you to use the DDR configuration table as shown in the example I have attached below:

    3808.SPIboot_ddr.zip

    The example attached was created for C6657 and not for C6678 so you will need to change the tiboot.h file and replace the DDR configuration(BOOT_EMIF4_TBL_T) to match your platform.Memory map for placing the DDR configuration table is different between the 2 devices so you will have to chnage the location of DDR_CFG to 0x00873500 instead of 0x8ffd20 in the .cmd file. Also look at the way the spiboot.cmd places the DDR configuration table in the correct location before any sections are loaded into DDR. You need to have the same setting in your linker command file. I mean the .emif section must be placed in DDR_CFG space before any code or text section is loaded in DDR.

    Also, a note here, the  correct DDR initialization sequence has been modified since the last time the ROM was revised so we have seen that on this platform the device can initialize DDR only at lower speeds.


    Regards,

    Rahul

  • Thank You Rahul,

    It is working. Thank You very much for your help.

    Regards

    Nithin

  • Nithin,

    Which approach did you end up using?? Did you you use single stage boot with DDR initialized by BOOTROM or did you get the two stage boot to work with ROM re-entry.

    Regards,
    Rahul
  • Hi Rahul,

    We used two stage boot and did like this

    main

    {

    DDR3 Initialization,

    funcptr(my application address)

    }

    We didnt re-enter into ROM boot-loader.

    Thank You

    Regards

    Nithin

  • For Two stage boot without re-entering the bootROM, have you implemented a loader that loads your second stage from the boot media ? I thought you wanted to have your second stage running out of DDR so you wanted to initialize DDR in first stage and have the second stage load to DDR.

    Regards,

    Rahul

  • Hi Rahul,

    My application is using DDR3 and I placed my application after some offset(sector2) from DDR3 Initialization. As you suggested I used void (*funcptr)( void ) to jump to my application and before that I am Initializing DDR3.

    Thank You

    Regards

    Nithin