日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

32.210内存的知识

發(fā)布時(shí)間:2025/4/14 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 32.210内存的知识 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

32.210內(nèi)存的知識(shí)

210可尋址的空間是4GB大小,內(nèi)存的起始地址是20000000,前面知道2440使用的內(nèi)存是SDRAM,6410使用的內(nèi)存是DDR,這里210使用的是DDR2.在210的地址空間中零地址處跟6410一樣也是映射鏡像區(qū),例如當(dāng)選擇從NandFlash啟動(dòng)的使用,就會(huì)把IROM的空間映射到0地址處。

?

?

內(nèi)存芯片連接:

在2440和6410兩款芯片中,它們的數(shù)據(jù)寬度是16bits,為了得到32bits的數(shù)據(jù)寬度,采用的是兩片芯片級(jí)聯(lián)的方式。而210采用的數(shù)據(jù)寬度是8bits的,要擴(kuò)張成32bits,所以需要4片級(jí)聯(lián)。每一片的大小是128MB,有四片總大小512MB。有一些芯片是8片的,構(gòu)成1GB*32的內(nèi)存芯片。

芯片手冊(cè)里DMC0對(duì)應(yīng)的是上圖中的DRAM0,DMC1對(duì)應(yīng)DRAM1.

接下來就是初始化DRAM0這512MB內(nèi)存。

初始化流程:

?

Initialization sequence for DDR2 memory type:

1. To provide stable power for controller and memory device, the controller must assert and hold CKE to a logic low level. Then apply stable clock. Note: XDDR2SEL should be High level to hold CKE to low.

2. Set the PhyControl0.ctrl_start_point and PhyControl0.ctrl_inc bit-fields to correct value according to clock frequency. Set the PhyControl0.ctrl_dll_on bit-field to '1' to turn on the PHY DLL.

3. DQS Cleaning: Set the PhyControl1.ctrl_shiftc and PhyControl1.ctrl_offsetc bit-fields to correct value according to clock frequency and memory tAC parameters.

4. Set the PhyControl0.ctrl_start bit-field to '1'.

5. Set the ConControl. At this moment, an auto refresh counter should be off.

6. Set the MemControl. At this moment, all power down modes should be off.

7. Set the MemConfig0 register. If there are two external memory chips, set the MemConfig1 register.

8. Set the PrechConfig and PwrdnConfig registers.

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

10. If QoS scheme is required, set the QosControl0~15 and QosConfig0~15 registers.

11. Wait for the PhyStatus0.ctrl_locked bit-fields to change to '1'. Check whether PHY DLL is locked.

12. PHY DLL compensates the changes of delay amount caused by Process, Voltage and Temperature (PVT) variation during memory operation. Therefore, PHY DLL should not be off for reliable operation. It can be off except runs at low frequency. If off mode is used, set the PhyControl0.ctrl_force bit-field to correct value according to the PhyStatus0.ctrl_lock_value[9:2] bit-field to fix delay amount. Clear the PhyControl0.ctrl_dll_on bit-field to turn off PHY DLL.

13. Confirm whether stable clock is issued minimum 200us after power on

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

15. Wait for minimum 400ns.

16. Issue a PALL command using the DirectCmd register.

17. Issue an EMRS2 command using the DirectCmd register to program the operating parameters.

18. Issue an EMRS3 command using the DirectCmd register to program the operating parameters.

19. Issue an EMRS command using the DirectCmd register to enable the memory DLLs.

20. Issue a MRS command using the DirectCmd register to reset the memory DLL.

21. Issue a PALL command using the DirectCmd register.

22. Issue two Auto Refresh commands using the DirectCmd register.

23. Issue a MRS command using the DirectCmd register to program the operating parameters without resetting the memory DLL.

24. Wait for minimum 200 clock cycles.

25. Issue an EMRS command using the DirectCmd register to program the operating parameters. If OCD calibration is not used, issue an EMRS command to set OCD Calibration Default. After that, issue an EMRS command to exit OCD Calibration Mode and to program the operating parameters.

26. If there are two external memory chips, perform steps 14~25 for chip1 memory device.

27. Set the ConControl to turn on an auto refresh counter. 28. If power down modes is required, set the MemControl registers.

先建立框架:

  • 在原來的過程里創(chuàng)建一個(gè)mem.S文件:
  • 在mem.S里聲明一個(gè)全局的標(biāo)號(hào):
  • 接著把mem.S加入到Makefile工程文件里:
  • 4.是在start.S里加入內(nèi)存初始化的標(biāo)識(shí):

    5.編譯一下,看看是否出錯(cuò):

    沒有報(bào)錯(cuò)說明框架沒問題,接下來就是mem.S的初始化代碼。

    1. To provide stable power for controller and memory device, the controller must assert and hold CKE to a logic low level. Then apply stable clock. Note: XDDR2SEL should be High level to hold CKE to low.

    這是電源為控制器和內(nèi)存設(shè)備提供穩(wěn)定電壓的要求,是硬件的,略過。

    ?

    2. Set the PhyControl0.ctrl_start_point and PhyControl0.ctrl_inc bit-fields to correct value according to clock frequency. Set the PhyControl0.ctrl_dll_on bit-field to '1' to turn on the PHY DLL.

    這里是要設(shè)置PhyControl0寄存器的ctrl_start_point位和ctrl_inc位,根據(jù)時(shí)鐘頻率,還有就是設(shè)置ctrl_dll_on來打開PHY DLL。

    @ step 2.1

    ????ldr????r0, =DMC_PHYCONTROL0

    ????ldr????r1, =0x00101000????????????????

    ????str????r1, [r0]

    ????

    ????@ step 2.2

    ????ldr????r0, =DMC_PHYCONTROL0

    ????ldr????r1, =0x00101002????????????????????

    ????str????r1, [r0]

    3. DQS Cleaning: Set the PhyControl1.ctrl_shiftc and PhyControl1.ctrl_offsetc bit-fields to correct value according to clock frequency and memory tAC parameters.

    沒有使用跳過。

    4. Set the PhyControl0.ctrl_start bit-field to '1'.

    ????@ step 4

    ????ldr????r0, =DMC_PHYCONTROL0

    ????ldr????r1, =0x00101003????????????????????

    ????str????r1, [r0]

    5. Set the ConControl. At this moment, an auto refresh counter should be off.

    @ step 5

    ????ldr????r0, =DMC_CONCONTROL????????????????

    ????ldr????r1, =0x0FFF1350

    ????str????r1, [r0]

    ?

    ?

    6. Set the MemControl. At this moment, all power down modes should be off.

    @ step 6

    ????ldr????r0, =DMC_MEMCONTROL

    ????ldr????r1, =DMC0_MEMCONTROL????????????????

    ????str????r1, [r0]

    ?

    7. Set the MemConfig0 register. If there are two external memory chips, set the MemConfig1 register.

    @ step 7

    ????ldr????r0, =DMC_MEMCONFIG0

    ????ldr????r1, =DMC0_MEMCONFIG_0????????????????

    ????str????r1, [r0]

    ?

    8. Set the PrechConfig and PwrdnConfig registers.

    @ step 8

    ????ldr????r0, =DMC_PRECHCONFIG

    ????ldr????r1, =0xFF000000????????????????????

    ????str????r1, [r0]

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

    ?

    ?

    ?

    ?

    ?

    ?

    ?

    ?

    #define DMC_PHYCONTROL0 0xf0000018

    #define DMC_PHYCONTROL1 0xf000001c

    #define DMC_CONCONTROL 0xf0000000

    #define DMC_MEMCONTROL 0xf0000004

    #define DMC_MEMCONFIG0 0xf0000008

    #define DMC_MEMCONFIG1 0xf000000c

    #define DMC_PRECHCONFIG 0xf0000014

    #define DMC_TIMINGAREF ????0xf0000030

    #define DMC_TIMINGROW ????0xf0000034

    #define DMC_TIMINGDATA ????0xf0000038

    #define DMC_TIMINGPOWER 0xf000003c

    #define DMC_PHYSTATUS 0xf0000040

    #define DMC_DIRECTCMD ????0xf0000010

    #define DMC_PWRDNCONFIG 0xf0000028

    ?

    #define DMC0_MEMCONTROL????????????0x00202400

    #define DMC0_MEMCONFIG_0????????0x20F00313????

    #define DMC0_MEMCONFIG_1????????0x00F00313????

    ?

    #define DMC0_TIMINGA_REF 0x00000618

    #define DMC0_TIMING_ROW 0x2B34438A

    #define DMC0_TIMING_DATA 0x24240000

    #define DMC0_TIMING_PWR 0x0BDC0343

    ?

    .globl mem_init

    mem_init:

    ????@ step 2.1 Set the PhyControl0.ctrl_start_point and PhyControl0.ctrl_inc

    ????ldr????r0, =DMC_PHYCONTROL0

    ????ldr????r1, =0x00101000????????????????

    ????str????r1, [r0]

    ????

    ????@ step 2.2 Set the PhyControl0.ctrl_dll_on bit-field to '1' to turn on the PHY DLL.

    ????ldr????r0, =DMC_PHYCONTROL0

    ????ldr????r1, =0x00101002????@是在上面的基礎(chǔ)上修改????????????????

    ????str????r1, [r0]

    ????

    ????@ step 4

    ????ldr????r0, =DMC_PHYCONTROL0

    ????ldr????r1, =0x00101003????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 5

    ????ldr????r0, =DMC_CONCONTROL????????????????

    ????ldr????r1, =0x0FFF1350

    ????str????r1, [r0]

    ????

    ????@ step 6

    ????ldr????r0, =DMC_MEMCONTROL

    ????ldr????r1, =DMC0_MEMCONTROL????????????????

    ????str????r1, [r0]

    ????

    ????@ step 7

    ????ldr????r0, =DMC_MEMCONFIG0

    ????ldr????r1, =DMC0_MEMCONFIG_0????????????????

    ????str????r1, [r0]

    ????

    ????@ step 8

    ????ldr????r0, =DMC_PRECHCONFIG

    ????ldr????r1, =0xFF000000????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 9.1

    ????ldr????r0, =DMC_TIMINGAREF

    ????ldr????r1, =DMC0_TIMINGA_REF????????????????

    ????str????r1, [r0]

    ????

    ????@ step 9.2

    ????ldr????r0, =DMC_TIMINGROW

    ????ldr????r1, =DMC0_TIMING_ROW????????????????

    ????str????r1, [r0]

    ????

    ????@ step 9.3

    ????ldr????r0, =DMC_TIMINGDATA

    ????ldr????r1, =DMC0_TIMING_DATA????????????????

    ????str????r1, [r0]

    ????

    ????@ step 9.4

    ????ldr????r0, =DMC_TIMINGPOWER

    ????ldr????r1, =DMC0_TIMING_PWR????????????????

    ????str????r1, [r0]

    ????

    ????@ step 11

    wait_lock:

    ????ldr????r0, =DMC_PHYSTATUS

    ????ldr????r1, [r0]????????????

    ????and????r2, r1, #0x4

    ????cmp????r2, #0x4????????????????????

    ????bne????wait_lock

    ?

    ????@ step 14

    ????ldr????r0, =DMC_DIRECTCMD

    ????ldr????r1, =0x07000000????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 16

    ????ldr????r1, =0x01000000????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 17

    ????ldr????r1, =0x00020000????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 18

    ????ldr????r1, =0x00030000????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 19

    ????ldr????r1, =0x00010400????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 20

    ????ldr????r1, =0x00000542????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 21

    ????ldr????r1, =0x01000000????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 22.1

    ????ldr????r1, =0x05000000????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 22.2

    ????ldr????r1, =0x05000000????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 23

    ????ldr????r1, =0x00000442????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 25.1

    ????ldr????r1, =0x00010780????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 25.2

    ????ldr????r1, =0x00010400????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 26, repeat step14~step25

    ????ldr????r1, =0x07100000????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x01100000????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x00120000????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x00130000????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x00110400????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x00100542????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x01100000????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x05100000????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x05100000????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x00100442????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x00110780????????????????????

    ????str????r1, [r0]

    ????

    ????ldr????r1, =0x00110400????????????????????

    ????str????r1, [r0]

    ????

    ????@ step 27

    ????ldr r0, =DMC_CONCONTROL

    ????ldr????r1, =0x0FF02030????????????????????

    ????str????r1, [r0]

    ????

    ????ldr r0, =DMC_PWRDNCONFIG

    ????ldr????r1, =0xFFFF00FF????????????????????

    ????str????r1, [r0]

    ????

    ????ldr r0, =DMC_CONCONTROL

    ????ldr????r1, =0x00202400????????????????????

    ????str????r1, [r0]

    ?

    ????mov????pc, lr

    ?

    轉(zhuǎn)載于:https://www.cnblogs.com/FORFISH/p/5188755.html

    總結(jié)

    以上是生活随笔為你收集整理的32.210内存的知识的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。