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 DDR2/mDDR Memory Controller Clock Stop Procedure

Other Parts Discussed in Thread: OMAP-L138, OMAPL138

Hello.

I'm trying to stop MCLK clock of DDR according to procedure from sprufu3:

===================================================================================

2. Change the SR_PD bit to 0 and set the LPMODEN bit in the DDR2 SDRAM refresh control register

(SDRCR) to enable self-refresh mode. The DDR2/mDDR memory controller will complete any

outstanding accesses and backlogged refresh cycles and then place the external DDR2/mDDR

memory in self-refresh mode.

3. Set the MCLKSTOPEN bit in SDRCR. This enables the DDR2/mDDR memory controller to shut off the

MCLK.

4. Poll the PHYRDY bit in the SDRAM status register (SDRSTAT) to be a logic-low indicating that the

MCLK has been stopped.

===================================================================================

I allocated my code and stack in internal shared RAM. This is the code:

#define SR_PD      ((unsigned int)1<<23)
#define MCLKSTOPEN ((unsigned int)1<<30)
#define LPMODEN    ((unsigned int)1<<31)

#define PHYRDY     ((unsigned int)1<<2)

DDR->SDRCR &= (~SR_PD);   // self-refresh
DDR->SDRCR |= LPMODEN;    // low-power
DDR->SDRCR |= MCLKSTOPEN; // shut off the MCLK

while((DDR->SDRSTAT&PHYRDY) != 0) {}

Program always polls in the "while", because PHYRDY is always 1. Why? What else should I do before polling PHYRDY?

 

 

  • The power down sequence has been revised.  Instead of polling, you'll need to wait for 150 CPU cycles.  Below is a segment of the revised procedure.  This update to the DDR2/mDDR user guide will be released soon. 

    1. Allow software to complete the desired DDR transfers.
    2. Change the SR_PD bit to 0 and set the LPMODEN bit to 1 in the DDR2 SDRAM refresh control register (SDRCR) to enable self-refresh mode. The DDR2/mDDR memory controller will complete any outstanding accesses and backlogged refresh cycles and then place the external DDR2/mDDR memory in self-refresh mode.
    3. Set the MCLKSTOPEN bit in SDRCR to 1. This enables the DDR2/mDDR memory controller to shut off the MCLK.
    4. Wait 150 CPU clock cycles to allow the MCLK to stop.

    --Christina

     

  • Hello, Christina.

    > Wait 150 CPU clock cycles to allow the MCLK to stop.

    I was waiting more than 10 seconds.

    Do you mean I can read SDRSTAT only after 150 CPU clock cycles?

    Or information in SDRSTAT is wrong so I should only wait 150 CPU clock cycles, not poll the PHYRDY bit SDRSTAT at all?

  • You will not have to read or poll SDRSTAT.  You should just wait for 150 CPU clock cycles, and proceed to step 5 (program the PSC to disable VCLK).

    --Christina

  • Thank you.

    Please, if you know other new information about changing PLL settings or mDDR settings, post it here.

  • Hello.
    One of my customer encountered same problem in OMAP-L138.

    Can I apply the 150 CPU cycle to OMAP-L138?
    Is it written anywhere in document?
    If yes, could you tell me the place describe about it?

    Best Regards,
    BL.HSR-WZ

  • Hi
    Yes, this applies to OMAPL138 , as well as c6748 device families also. I believe the mDDR/DDR2 guide for these devices needs to be refreshed to incorporate these changes, but it might take a few more weeks to get this done and posted on the product folder.

    Regards

    Mukul

  • Hello, Mukul.

    Thank you for your quick response.
    I got it.

    Best Regards,
    BL.HSR-WZ