久久婷婷香蕉热狠狠综合,精品无码国产自产拍在线观看蜜,寡妇房东在做爰3,中文字幕日本人妻久久久免费,国产成人精品三上悠亚久久

當前位置:首頁 > 嵌入式培訓 > 嵌入式學習 > 講師博文 > exynos4412內存分析

exynos4412內存分析 時間:2018-08-16      來源:未知

學生在(zai)進(jin)行開發時,經常對(dui)內存(cun)這塊(kuai)有疑(yi)問,下(xia)面將(jiang)使用exynos4412芯片的華清(qing)開發板(fs4412)為(wei)例作為(wei)講解。

使用到的手冊如下:

FS4412_CoreBoard_V2.pdf

FS4412-DevBoard-V5.pdf

SEC_Exynos4412_Users Manual_Ver.1.00.00.pdf

簡述

exynos4412存儲分(fen)下面幾(ji)塊:

iROM:啟動鏡像區,存(cun)放三星預置的程序,也(ye)叫bl0

iRAM :內部(bu)內存區,加載通過OM選擇(ze)后的啟動程序(xu),通常加載bl1、bl2

SMC:靜態內(nei)存區,Static Read Only Memory Controller ,通常用于映射外(wai)部總(zong)線上設備,如網(wang)卡等,該區域被分(fen)為4個(ge)bank,每個(ge)16M(對應硬件手冊xm0開(kai)頭(tou)的)

SFR:特殊功能寄存器區,通常用于映射(she)SOC內部設備,如GPIO等

DMC:動態內(nei)存(cun)區,就是我(wo)們通常意義上的內(nei)存(cun)。

ps:動態(tai)內(nei)存(由于動態(tai)內(nei)存本身(shen)不供電,需要不斷供電刷新,保存數據,所以(yi)叫動態(tai)內(nei)存)(對(dui)應(ying)硬件手冊(ce)xm1和xm2開頭的)

硬件原理(SMC)

Exynos4412中有1個獨立的(de)SMC,分為(wei)4個bank

沒有行地(di)址和(he)列地(di)址,整個(ge)芯片可(ke)用內存大(da)小:2^8bit=256/16=16Byte

外部(bu)設(she)備片(pian)選時,只能(neng)選0或者1.

硬件(jian)原(yuan)理(DMC)

Exynos4412中有兩個獨立(li)的(de)(de)(de)(de)DRAM控(kong)制器(qi),分別(bie)叫DMC0和DMC1,可以接2組不同的(de)(de)(de)(de)DDR內存。DMC0和DMC1分別(bie)支(zhi)持大1.5GB的(de)(de)(de)(de)DRAM,它們都(dou)支(zhi)持DDR2/DDR3和LPDDR2等,512 Mb, 1 Gb, 2 Gb, 4 Gb and 8 Gbit的(de)(de)(de)(de)內存設備,支(zhi)持16/32bit的(de)(de)(de)(de)位寬。DRAM0 對(dui)應(ying)的(de)(de)(de)(de)地(di)址是0x4000_0000~0xAFFF_FFF共1.5GB,DRAM1 對(dui)應(ying)的(de)(de)(de)(de)地(di)址是0xA000_000~0x0000_0000共1.5GB。

4412的(de)(de)1GB的(de)(de)DRAM是由4片(pian)(pian)大小為256M*16的(de)(de)DDR3芯(xin)片(pian)(pian)組合而成(查看(kan)芯(xin)片(pian)(pian)型號(hao)可以得(de)到)

芯片型號:K4B4G1646B-HYXX

第一位(wei): K表示內(nei)存

第二位:4表示falsh類型(xing) DRAM

第三位:B表(biao)示DDR3

第4~5位. Density(注(zhu):實(shi)際(ji)單位應該是bit,而不是Byte),我們的是4Gbit=4G/16(數(shu)據位)=256MByte

第6~7位. organization:數據(ju)線引腳個數,我們的是16

分析完(wan)成,開發板上共有4片這樣的內存芯片,總容量就是256M*4=1G

這(zhe)四片(pian)DDR 芯片(pian)被分(fen)成了兩兩一組,組成32位數據,四片(pian)都是掛接到DMC0處(chu)

總圖如下:

分解(jie)圖如下(只列了(le)一半):

從上(shang)兩(liang)圖可以看出,這四(si)片DDR 芯片被分(fen)成(cheng)了兩(liang)兩(liang)一組(zu),組(zu)成(cheng)32位數據(ju),四(si)片都是掛接到DMC0處,如下:

· 左邊(bian)一片16位(wei),右邊(bian)16位(wei),組(zu)成32位(wei)數據(ju)

· 全部芯片(pian)片(pian)選(xuan)掛(gua)到CS0:

· bank線數:

3路(lu)線(xian)(BA0-BA2),有(you)2^3組合,也就(jiu)是一個(ge)芯片上(shang),bank有(you)8個(ge)

· 地址(zhi)線

地址線(xian)數:15(A0-A14)

ps:一個芯片內(nei)存大支持:2^(bank線數+地址線)=2^33=8Gbit/16=512MByte

· 行列地址(zhi)線

nRAS,nCAS:復用地(di)址(zhi)線(xian)行和列選擇,同一時(shi)刻(ke)只能有(you)一種地(di)址(zhi)線(xian)使用(不是行就是列),我們的板子上(shang)芯(xin)片(pian)有(you)256M(2^28),28-3(bank)-15(行地(di)址(zhi))=10(列地(di)址(zhi))

· 尋址流程(cheng)

這個(ge)操(cao)作順序是(shi)(shi),先片選,CS拉低,然(ran)后,當RAS拉低時(shi),表(biao)示(shi)傳過的是(shi)(shi)行地址(zhi),是(shi)(shi)A0-A14,15位;當CAS拉低時(shi),表(biao)示(shi)傳過來(lai)的是(shi)(shi)列地址(zhi),是(shi)(shi)A0-A9,列地址(zhi)多(duo)的幾(ji)位是(shi)(shi)預留的用(yong)來(lai)擴展內(nei)存,一(yi)個(ge)芯片內(nei)存多(duo)可以擴展到512M。

內存劃分多個(ge)bank原因

由于DDR是(shi)不自備充(chong)電電路(lu)的(de),所以,每隔一(yi)(yi)(yi)段時(shi)間,內存控(kong)制器就(jiu)會(hui)刷新(xin)一(yi)(yi)(yi)次電路(lu),也(ye)就(jiu)是(shi)要(yao)(yao)充(chong)一(yi)(yi)(yi)次電,如果只有一(yi)(yi)(yi)個Bank,那么結果就(jiu)是(shi)在某一(yi)(yi)(yi)時(shi)刻,要(yao)(yao)么都充(chong)電,要(yao)(yao)么都不充(chong)電。

像(xiang)上面這(zhe)樣分成了8個Bank,當(dang)我(wo)對000充電的(de)(de)(de)時(shi)候,我(wo)還可以在(zai)010或是剩下的(de)(de)(de)別的(de)(de)(de)Bank中(zhong)讀取數據,這(zhe)樣就(jiu)減小了等待(dai)的(de)(de)(de)時(shi)間(jian),不用說當(dang)電路刷(shua)新時(shi),不能讀取數據了。

exynos板子上,每個(ge)bank大小= 256M/8=32M(1個(ge)芯片上有2^3個(ge)bank)

內存計算方法

SDRAM容量計算

計(ji)算可尋址單元的數(shu)量(32位)

地(di)址線(xian)數(shu)(管腳數(shu)):11(A0-A10)

bank線數:2(BA0-BA1) 可以組合出(chu)2^2個 bank

大行線(xian)(xian)數(shu)=211(例如地址線(xian)(xian)的編號,11個管腳(jiao)線(xian)(xian),組(zu)合有(you)211種)

大列線數(shu)=211(例如(ru)地址線的編號,11個管腳(jiao)線,組合有211種(zhong))

一個bank中(zhong)總單元數=211x 211

芯片中總單元數(shu)=(bank個數(shu))×(一個bank中總單元數(shu))

= 22 x 211 x 211

= 224

備注:

因為行線(xian)與列線(xian)上傳輸的(de)數據是經過編(bian)碼(組合方(fang)式)的(de),而(er)不是直接(jie)的(de)行號和列號,

也就是(shi)說每(mei)個bank里(li)有213 個行(xing)和 29 個列,并非只有13行(xing)和9列。

所以要尋址的單元在第(2行線數(shu)據 )行,第( 2列(lie)線數(shu)據)列(lie)。

例如bank0,行線(xian)數據是(shi)0 0000 0010 0000,列線(xian)數據是(shi)0 0000 1000,

意思是要獲取行(xing)(xing)32,列(lie)8的(de)單元的(de)數(shu)據,而不是行(xing)(xing)5,列(lie)3的(de)數(shu)據。

如(ru)果行線數(shu)據是 0 0010 1101 0110,列線數(shu)據是0 0011 1010,意思是獲取行726,列58的單元的數(shu)據。

例如(ru)一個32MB的(de)SDRAM芯片(pian)中有4個Logic-bank(邏輯bank),位寬16bit(即(ji)每個單元是16bits),地址線13條(tiao),大行線數13,大列線數9。計算(suan)得:

一個bank的單元數= 213 x 29= 4194304(即4M)。

芯片總(zong)單元數=4Banks × 4M units = 16M units 。

芯片總位數=16M units × 16bits/per_unit = 256M bits 。

芯片(pian)總字(zi)節數(shu)=256M bits/8 = 32M Bytes 。

內(nei)存(cun)初始化流(liu)程

在三星(xing)提供的(de)(de)(de)數(shu)據手(shou)冊《SEC_Exynos4412_Users Manual_Ver.1.00.00》的(de)(de)(de)第1046頁提供給了一(yi)段(duan)關于LPDDR2-S4的(de)(de)(de)初始(shi)化步驟,LPDDR2表示(shi)低功耗(hao)DDR2,DDR3的(de)(de)(de)初始(shi)化過(guo)(guo)程應(ying)和這個(ge)一(yi)樣,我們就按這個(ge)過(guo)(guo)程來初始(shi)化DDR3

初始(shi)化流程(cheng),如手冊(ce)中 18.3.1 LPDDR2-S4 描(miao)述(shu):

18.3.1 LPDDR2-S4

Use the sequence given here to initialize LPDDR2 devices. Unlessspecified otherwise, these steps are

mandatory. Note that the memory CK/CKn must be less than or equal to50 MHz before you initialize the

LPDDR2-S4 device.

1. DMC must assert and holdCKE to a logic low level to provide stable power for memory device and thenapply

stable clock.

2. Set thePhyControl0.ctrl_start_point and PhyControl0.ctrl_inc bit-fields to a correctvalue according to clock

frequency. Set the PhyControl0.ctrl_dll_on bit-field to"1" to activate the PHY DLL.

3. DQS cleaning: Set thePhyControl1.ctrl_shiftc and PhyControl1.ctrl_offsetc bit-fields to theappropriate value

according to clock frequency, board delay, and memory tDQSCKparameter.

4. Set thePhyControl0.ctrl_start bit-field to "1".

5. Set the ConControl. Atthis moment, an auto-refresh counter should be disabled.

6. Set the MemControl. Atthis moment, all power down modes should be disabled.

7. Set the MemConfig0register. When there are two external memory chips, set the MemConfig1register.

8. Set the PrechConfig andPwrdnConfig registers.

9. Set the TimingAref,TimingRow, TimingData, and TimingPower registers according to memory AC

parameters.

10. Set the QosControl0 to 15and QosConfig0 to 15 registers when a certain bus master requires QoS scheme.

11. Wait for thePhyStatus0.ctrl_locked bit-fields to change to "1". Verify whetherPHY DLL is locked.

PHY DLL compensates the changes of delay amount that pressure,volume, and temperature variation

causes during memory operation. Therefore, you should not power offPHY DLL for reliable operation.

It can be in power-off mode except when it runs at low frequency.When you use the power-off mode,

set the PhyControl0.ctrl_force bit-field to the correct valueaccording to the PhyStatus0.ctrl_lock_value[9:2]

bit-field for fix delay amount. Clear the PhyControl0.ctrl_dll_onbit-field to turn off PHY DLL.

12. Set thePhyControl1.fp_resync bit-field to "1" to update DLL information.

13. Confirm that Clock Enable(CKE) is in a logic low level at least 100ns after power on.

14. Issue a NOP command byusing the DirectCmd register to assert and hold CKE to a logic high level.

15. Wait for a minimum of 200ms.

16. Issue a MRS command byusing the DirectCmd register to reset memory devices and program the operating

parameters.

17. Wait for minimum of 1 μs.

18. Issue a MRR command byusing the DirectCmd register to poll the DAI bit of the MRStatus register.

This is to know whether or not Device Auto-Initialization iscomplete.

19. If there are two externalmemory chips, execute step 14 to 19 for chip1 memory device.

20. Set the ConControl toturn on an auto-refresh counter.

21. Set MemControl registerwhen you require power-down modes.

翻譯(yi)上面的步驟:

 1、DMC功能必須設置,并且(qie)要(yao)保持CKE為低電平,以便(bian)可以提(ti)供穩定的電源和時(shi)鐘給DDR

2、根(gen)據時鐘頻率(lv)設置PhyControl0.ctrl_start_point 和(he)PhyControl0.ctrl_inc bit-fields,并且設置PhyControl0.ctrl_dll_on bit-field 為 "1" 已啟動(dong)PHY DLL。

3、DQS 清除,根(gen)據時鐘頻率、板子(zi)延時和(he)芯片的tDQSCK參數設置(zhi)PhyControl1.ctrl_shiftc 和(he)PhyControl1.ctrl_offsetcbit-fields。

4、設置 PhyControl0.ctrl_start bit-field 為(wei)"1"。

5、設置ConControl,此時,不能(neng)(neng)使能(neng)(neng)自動(dong)刷(shua)新計數(shu)器(auto-refresh counter )。

6. 設置MemControl,此(ci)時,所有的power down模式應關(guan)閉。

7、設置MemConfig0 寄存器,當外面(mian)有兩片存儲(chu)芯片時,設置MemConfig1寄存器。

8、設置 PrechConfig和 PwrdnConfig寄存器(qi)。

9、根據DDR3的 AC參數設(she)置TimingAref, TimingRow, TimingData, 和 TimingPower寄存器。

10、當總(zong)線主控者需要QoS時(shi)序參(can)數時(shi),設置QosControl0 到15寄(ji)存器和QosConfig0 到 15寄(ji)存器。

11、等待 PhyStatus0.ctrl_locked bit-fields 變成(cheng) "1",以(yi)確(que)定 PHY DLL 是否鎖定。PHY DLL 可以(yi)補償壓力、體積?和溫度等環境的(de)變化,因為在芯片(pian)工作(zuo)期(qi)間,我們不能(neng)關閉了PHY DLL的(de)電(dian)源,只有當(dang)他(ta)在低的(de)時(shi)鐘頻率時(shi)才可以(yi)切換到Power-off 模式(shi),當(dang)我們用power-off 模式(shi),參(can)考(kao)PhyStatus0.ctrl_lock_value[9:2]的(de)延(yan)時(shi)參(can)數來設置PhyControl0.ctrl_forcebit-field,清楚PhyControl0.ctrl_dll_on bit-field來關閉 PHY DLL。

12、設(she)(she)置(zhi)PhyControl1.fp_resync bit-field 為(wei) "1" 來更新 DLL的設(she)(she)置(zhi)。

13、確保在電(dian)(dian)源(yuan)上電(dian)(dian)后至少保持(chi)Clock Enable (CKE)在低電(dian)(dian)平100ns。

14、用DirectCmd 寄存器來執行一條(tiao)NOP指令且(qie)保持CKE 為(wei)高電平。

15、至少(shao)等待200us。

16、發出MRS指令(ling)來重新設(she)置(zhi)存儲芯片的操作參數。

17、至少等待1us。

18、用MRR指令來查詢MRStatus的寄存器的DAI位,用這們(men)來確(que)定(ding)自動初始化過程是否完(wan)成。

19、如果外部(bu)有(you)別的存(cun)儲(chu)芯(xin)片(pian)(pian),重復執行14到19步(bu)來設置芯(xin)片(pian)(pian)1。

20、設置(zhi)ConControl來啟動auto-refresh counter.

21、當(dang)我(wo)們要進行power-down模式,設(she)置(zhi)MemControl寄(ji)存(cun)器(qi)。

按(an)照上邊(bian)的步驟來(lai)設置(zhi)就可以完成DDR的初始化。

更多exynos4412內存分析問題

Exynos4412特殊功能寄存器的封裝

上一篇:arm11開發板適合新手學習嗎

下一篇:Linux平臺下pci總線驅動

熱點文(wen)章推薦
華清學員(yuan)就業榜單
高薪學員經驗(yan)分享
熱點(dian)新聞推薦
前臺專線:010-82525158 企(qi)業培訓洽(qia)談專線:010-82525379 院校(xiao)合作洽談專線:010-82525379 Copyright © 2004-2022 北京華清遠見科技集團有限公司 版權所有 ,,京公海網安備11010802025203號

回到頂部