4.1.4 LPDDR2-SDRAM/LPDDR3-SDRAM Initialization

The initialization sequence is generated by software. The low-power DDR2-SDRAM and low-power DDR3-SDRAM devices are initialized by the following sequence:

Table 4-4. LPDDR2-SDRAM/LPDDR3-SDRAM Initialization
StepActionRegisterSetting
1Program the memory device typeMPDDRC_MDMD = 7 (for LPDDR2), MD = 5 (for LPDDR3), DBW = 0 (32 bits)
2Program the shift sampling valueMPDDRC_RD_DATA_PATHSection SDRAM Controller Configuration provides values for these fields. These values depend on the DDR clock.
3Program LPDDR2-SDRAM featuresMPDDRC_CR MPDDRC_TPR0

MPDDRC_TPR 1

4Program DS, SEG_MASK and BK_MASK_PASRMPDDRC_LPDDR23_LPR
5Issue a NOP command(2)MPDDRC_MRMODE = 1
61 μs delay(1)
7Issue a NOP command(2)MPDDRC_MRMODE = 1
8200 μs delay(1)
9Issue a Reset command(2)MPDDRC_MRMODE = 7, MRS = 63
10500 μs delay(1)-–
11Issue a Calibration command(2)MPDDRC_CR

MPDDRC_MR

ZQ = 3, after command ack ZQ = 2

MODE = 7, MRS = 10

12Issue a Mode register Write command(2)MPDDRC_MRMODE = 7, MRS = 1
13Issue a Mode register Write command(2)MPDDRC_MRMODE = 7, MRS = 2
14Issue a Mode register Write command(2)MPDDRC_MRMODE = 7, MRS = 3
15Issue a Mode register Write command(2)MPDDRC_MRMODE = 7, MRS = 16
16Write ‘1’ to bits 17 and 16 in SFR_DDRCFGSFR_DDRCFGBit 17 = 1, Bit 16 = 1
17Issue a NOP command(2)MPDDRC_MRMODE = 1
18Issue a Mode register Read command(2)MPDDRC_MRMODE = 7, MRS = 5
19Issue a Mode register Read command(2)MPDDRC_MRMODE = 7, MRS = 6
20Issue a Mode register Read command(2)MPDDRC_MRMODE = 7, MRS = 8
21Issue a Mode register Read command(2)MPDDRC_MRMODE = 7, MRS = 0
22Provide a Normal Mode command(2)MPDDRC_MRMODE = 0
23Write ‘0’ to bits 17 and 16 in SFR_DDRCFGSFR_DDRCFGBit 17 = 0, Bit 16 = 0
24Write the refresh rate in COUNT fieldMPDDRC_RTRCOUNT = Trefi/Tck
Note:
  1. To issue a delay:

    • disable interrupts;

    • compute a deadline = ROUND_INT_DIV((timer_channel_freq/1000)*count, 1000), where count is the delay in µs;
    • start a timer and wait for the timer to reach the deadline;

    • enable interrupts.
  2. After setting the MODE and MRS fields, read MPDDRC_MR and add a memory barrier assembler instruction just after the read. Perform a write access at any address to acknowledge the command.


Refer to chapter ”Multiport DDR-SDRAM Controller (MPDDRC)” of the SAMA5D2 Series data sheet for more information.