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.

Disabling EMIF B Module on OMAP-L137 processor

Other Parts Discussed in Thread: OMAP-L137

Hello All,

 

I am in the process of trying to disable the EMIF-B DRAM interface while my processor is in deep sleep.  The ARM side is what uses the DRAM and I have successfully halted the ARM and sent into an exception loop so it does not make any DRAM accesses.

 

Now my system is only running on the DSP side which makes no DRAM accesses.  I am trying to disable the EMIF B module by following the procedure outlined in

SPRUH92A (OMAP-L137 Technical Technical Reference Manual).  Thus far I am not able to confirm that the EMIF B module is powering down.

 

Here is the procedure as I understand it:

 

1. Place the EMIFB in self refresh mode before stoping the clock

     I do this by setting the LP_MODE bit to 0 and the SR_PD bit to 1


Code:

// put memory into self-refresh mode

ddr_reg -> SDRCR &= ~SR_PD_BIT;

// select self-refresh mode (bit 23 to zero)

ddr_reg -> SDRCR |= LPMODEN_BIT; 

// enable low-power mode (bit 31 to 1)

2. Next I turn off the clocks and power in the module by doing the following

 

ddr_reg -> SDRCR |= MCLKSTOP_EN;

DDRMCNTLREG = 2;

//Set the GO[x] bit in PTCMD to 1 to initiate the transition(s).

PTCMD = 2;

 

3.  Then I wait for the GO[x] bit to clear to 0 to indicate DRAM module has transitioned to the new state.

 

At this point I should have effectively shut down the module, but when I look at the status bits for the EMIFB module, they still show the module as enabled.

 

There is a note in the manual that states the folllowing:

"The EMIFB memory controller remains fully functional during emulation halts, to allow emulation access to external memory."

 

Does this mean I can not shut the module down while in emulation?

 

Any help would be greatly appreciated.  I'm sure the answer to this post will help many folks out.

 

Best Regards,

 

Lee Henderson

 

//Wait for the GOSTAT[x] bit in PTSTAT to clear to 0. The modules are safely in the new states only

   

//after the GOSTAT[x] bit in PTSTAT is cleared to 0.

 

 

 

  • Hi

    A simple program like below should work

    // Place EMIFB in self-refresh

         *(unsigned int*) EMIFB_SDRFC &= ~0x00800000;  //Select self-refresh

         *(unsigned int*) EMIFB_SDRFC |=  0x80000000;  //Place in self-refresh

         *(unsigned int*) EMIFB_SDRFC |=  0x40000000;  //Enabled MCLK stop

     

         // PSC Disable the EMIFB

         *(unsigned int*) (PSC1_MDCTL+4*PSC1_EMIFB) = (*(unsigned int*) (PSC1_MDCTL+4*PSC1_EMIFB) & 0xFFFFFFE0) | PSC_DISABLE;

         *(unsigned int*) PSC1_PTCMD = 0x1 << PSC_PD;

         while( (*(unsigned int*) PSC1_PTSTAT & (0x1 << PSC_PD) ) !=0) ; /*Wait for power state transition to finish*/

         while( (*(unsigned int*)(PSC1_MDSTAT+4*PSC1_EMIFB) & 0x1F) != PSC_DISABLE);

    ---

    Make sure you are running this from internal memory, probably make sure that the memory windows in CCS etc are not open in SDRAM area (not sure if this should make a difference)

    Hope this helps.

     

     

  • Mukul,

    When the EMIFB is re-enabled is it necessary to take it out of self-refresh mode or just restart the clock using the PSC?  In other words can the SDRFC register settings be left unchanged from the code above so that the EMIFB determines when it needs to exit self-refresh.  Then I just need to restart the clock using:

        // PSC Enable the EMIFB

         *(unsigned int*) (PSC1_MDCTL+4*PSC1_EMIFB) = (*(unsigned int*) (PSC1_MDCTL+4*PSC1_EMIFB) & 0xFFFFFFE0) | PSC_ENABLE;

         *(unsigned int*) PSC1_PTCMD = 0x1 << PSC_PD;

         while( (*(unsigned int*) PSC1_PTSTAT & (0x1 << PSC_PD) ) !=0) ; /*Wait for power state transition to finish*/

         while( (*(unsigned int*)(PSC1_MDSTAT+4*PSC1_EMIFB) & 0x1F) != PSC_ENABLE);

    Also, how long does it take to re-enable the PSC?

    Thanks,

    Lori

     

  • You will need to take the memory out of self refresh too.

    I don't accurate figures on re-enabling PSC for EMIFB, assuming everything is ok, I would ball park it to around 300-400 CPU cycles.

    Hope this helps.

    Regards

    Mukul

  • FYI , we are planning to post a simple CCSv5 based code example to illustrate how to put the SDRAM in self refresh mode and cut the EMIFB clock etc. This should be posted on the wiki hopefully latest by early next week.

    We will provide the link , once available.

    Regards

    Mukul

  • Mukul,

    Thanks for the info - I'll watch for the code example in a week or so.

    Lori

  • Hi

    We have uploaded a DSP side example on the following link

    http://processors.wiki.ti.com/index.php/OMAPL137,_AM17x,_C6747/5/3,_DA83x/2x/1x/0x_IO_Buffer_Premature_Aging_Assessment

    An ARM side example similar to this should be available in a few days.

    Regards

    Mukul