How to save the DDR SDRAM data upon reset

来源:互联网 发布:midas软件破解版下载 编辑:程序博客网 时间:2024/06/06 02:24

Recently, customer comes up a new requirement for saving the DDR SDRAM data upon reset. Such a requirement arises because customer needs to restore the system as quickly aspossible once there is a crash. This document is to provide a proposed sequence to save the DDR SDRAM data upon reset.

Here is updated proposed sequence for an implementation of Self-refresh over SW-managed reset sequence

 

1) Make sure DDR_SDRAM_CFG[SREN] =1 at initialization.

2) Set the DDR_SDRAM_CFG_2[FRC_SR] when needed to enter self-refresh

3) Wait a few us for self-refresh to take place before issuing /HRESET.

4) Re-initialize all DDR registers, setting the DDR_SDRAM_CFG[BI] to bypass the writing of mode register

5) Wait 200 us

6) Set DDR_SDRAM_CFG[MEM_EN] to bring the memory controller online.

Then at this point, the DDR SDRAM content can be again accessed.

 

Some comments are noted here:

 

- Following step 2), and as far asDDR_SDRAM_CFG_2[FRC_SR] bit is set, MCKE signals are kept low and no further DDR SDRAM accesses from either SW or peripherals will be served by the DDR SDRAM controller. Hence, the recommendation to execute such sequence after stopping other cores except the one running this and also peripherals activity.  I reckon that I can't figure out precisely how a DDR SDRAM access attempt will really behave at this stage, I expect feedback on that.

 

- Step 3) is required to account the time for pending transactions and posted refreshes to complete before self-refresh command is sent to DDR devices. There is no direct way to check that Self-refresh command has been provided to the DDR.

 

- On step 4), as you can see the BI (Bypass Init) bit has to be set "after" Reset (instead of before as prev. stated). This will keep the memory controller from re-initializing the DRAMs. Then, CKE will simply be asserted when MEM_EN is set,

 

- On enabling Self-refresh from code running in DDR ... again this is not recommended ... as this would be the last instruction that can be executed (in self-refresh mode DDR is not accessible) ...

需要注意几点:

1. 在上述2)之后是不能对DDR再进行访问了,包括取指令,所以建议在之后加上while(1); 的指令;

2. 4)的步骤时,设置其他DDR寄存器前,保证DDR_SDRAM_CFG [MEM_EN]0

3. 在第6步结束后,对DDR进行最少32bytes的写操作,就写0地址(默认地址)好了,这个在P4080RM11.4.16 DDR training initialization address(DDRx_DDR_INIT_ADDR)章节有说明,如下:


原创粉丝点击