1. 程式人生 > >i.MX6 DDR 引數設定

i.MX6 DDR 引數設定

DDR Stress Test Tool 提供了兩種用途。首先,它可以用來對校準DDR3,以便於MMDC PHY delay settings和PCB配對,來達到最佳的DRAM新能。整個過程是全自動的,因此客戶可以在較短的時間內讓他們的DDR3工作起來。 另外,該工具可以執行記憶體壓力測試,用來驗證DDR3的功能和可靠性。壓力測試可以用來驗證硬體連線、MMDC暫存器引數和DDR3模式暫存器設定。測試最重要的目的是讓客戶驗證DDR3在他們的自己的板子上執行穩定。 Calibration 在i.MX6處理器上,DDR3需要4個校準過程,這些校準過程微調MMDC PHY等待暫存器校正會在DDR Stress Test Tool鍵入DDR3配置。首先,校準測試會提示DRAM頻率。i.MX6Q和i.MX6D的預設值是528MHz,i.MX6DL、i.MX6S和i.MX6SL的預設值是400MHz。這是BSP使用的DRAM頻率。按'y'來繼續執行校正過程。這裡輸入'n'會有一個選項來選擇特定的頻率。它僅僅是用來除錯。DRAM頻率選擇結束後,這個工具會開始校正。 Write Leveling Calibration
這是第一個校正,用來微調從i.MX6 processor輸出的DRAM clock和write DQS 之間的delay,按'y'來繼續執行校正過程。如果board已經校正並且校正結果已經和融入指令碼,按'n'跳過校正。 在按'y'開始校正以後,你需要輸入DDR3 Mode Register MR1的值,MR1的值可以在初始化指令碼的下列行中找到。The value 是等號後的兩個最高有效位元組,i.e. 0x0004 on this example.
setmem /32 0x021b001c = 0x00048031 // MMDC0_MDSCR, MR1 write, CS0 The value必須是和DDR初始化指令碼中的是同一個。否則,下面測試結果將無效,因為The Value是用來恢復 DDR3的MR1的value,當退出write leveling模式。 Read DQS Gating Calibration

第二個校正過程是DQS gating calibration。它用來微調讀DQS gating,讓它可以準確的捕獲讀DQS訊號。校正程式調整DQS gating delay 在4/256始終週期找有效的DQS delay window。按'y'/'n' 中間操作類似,不再翻譯 Calibration Results
After finishing all the calibration process, the calibration results are summarized and as shown below. ​The tool will proceed to run the DRAM stress test with the delay registers updated with these calibration results.

However, it is very important that these results should be recorded down and the DRAM initialization script should be updated accordingly. When porting the MMDC parameters to the firmware, the delay registers must be programmed according to the updated script. Otherwise, the DDR3 may not be able to run stably on the firmware.
總的來說,大概操作過程如下:
  1. 使用Freescale提供的Aid工具(Excel)根據自己板子的選料及設計,生成.inc檔案,這部分Freescale會幫忙做好,只需要將設計資料提供給AE
  2. 使用DDR Stress Test Tool來在自己的板子上校正生成的引數
  3. 根據測試結果,修正自己的.inc檔案並進行壓力測試
  4. 將inc檔案中資料新增到u-boot的flash_header.s。