分类: LINUX
2013-10-28 17:08:58
ARM9(S3C2440)的13个存储控制寄存器
内存控制器地址,摘自三星技术手册:
BWSCON 0x48000000 R/W Bus Width & Wait Status Control BANKCON0 0x48000004 Boot ROM Control BANKCON1 0x48000008 BANK1 Control BANKCON2 0x4800000C BANK2 Control BANKCON3 0x48000010 BANK3 Control BANKCON4 0x48000014 BANK4 Control BANKCON5 0x48000018 BANK5 Control BANKCON6 0x4800001C BANK6 Control BANKCON7 0x48000020 BANK7 Control REFRESH 0x48000024 DRAM/SDRAM Refresh Control BANKSIZE 0x48000028 Flexible Bank Size MRSRB6 0x4800002C Mode register set for SDRAM BANK6 MRSRB7 0x48000030 Mode register set for SDRAM BANK7 BWSCON,共32位: 31~28:BANK7 27~24:BANK6 。。。。。 3~0:BANK0 BANK7~BANK1设置一致 四位分别代表: STx:和树上说的不一样,手册说表示 SRAM for using UB/LB ,0不使用,1使用,一般接0 WSx :是否插入等待信号,0否,1是,一般选0 DWx(2位):00 8位,01 16位,10 32位,11 保留。这个每一个BANK可以根据书上 P91页表格看BANK的宽度。 BANK0比较特殊, 3:保留,写0 2~1(只读):取00,由硬件决定,因为你写不进去东西。。 0:保留,取0 总之BANK0就是0000(2进制)就对了 由此就得来了,这块板子上,0x22011110 BANKCON0~5(对应BANK 0~5,每个寄存器32位):保留值,写入0x00000700即可。 BANKCON6~7(对应BANK 6~7,每个寄存器32位): 31~17位,设为0 16~15,11表示BANKx接了SDRAM,00 SRAM,我的开发板BANK6接的是SRAM当然是11了 如果是SRAM就按照上面的000700就好了,如果是SDRAM,只需要设置3~0 3~2:CAS用几个周期,推荐为3个周期,01 1~0:列信号有几根线。。 mini2440的SDRAM芯片是HY57V561620(L)T, 光盘里的pdf手册显示了如下内容:Column Address : CA0 ~ CA8,因此是9根,所以取01 综上,BANKCON6~7的取值为 0x00018005 REFRESH(32位,用于设定SDRAM的刷新): 23:是否开启SDRAM刷新,自然选1开启 22:SDRAM刷新模式,选0 21~20:取00或者10,RAS的change时间 19~18:行时间,取11 17~11:0 10~0:就是刷新频率了~~ 计算公式,R_CNT=2^11+1-SDRAM时钟频率(Mhz)*SDRAM刷新周期(uS) HY那个手册上写到:8192个刷新周期用64ms,因此刷新周期=64000/8192=7.8125 时钟频率有好多种啊,先实验为100Mhz的吧。。 因此计算出来就是1267.75,四舍五入1268->0x04f4 因此这个REFRESH取值是 0x008c04f4,简单计算方法就是0x008c0000 + 04f4 BANKSIZE(32为寄存器): 支持核突发,使用SCKE,仅在SDRAM期间发出SCLK,地址空间64Mb 因此BANKSIZE为 0x000000B1 MRSRB6~7(SDRAM模式设置) 3个时钟周期,0x30 |
The S3C2410X has 117 multi-functional input/output port pins. The ports are:
— Port A (GPA): 23-output port
— Port B (GPB): 11-input/output port
— Port C (GPC): 16-input/output port
— Port D (GPD): 16-input/output port
— Port E (GPE): 16-input/output port
— Port F (GPF): 8-input/output port
— Port G (GPG): 16-input/output port
— Port H (GPH): 11-input/output port
---PORT A 23-output
GPACON 0x56000000
GPADAT 0x56000004
---PORT B 11-input/output
GPBCON 0x56000010
GPBDAT 0x56000014
GPBUP 0x56000018
---PORT C 16-input/output
GPCCON 0x56000020
GPCDAT 0x56000024
GPCUP 0x56000028
---PORT D 16-input/output
GPDCON 0x56000030
GPDDAT 0x56000034
GPDUP 0x56000038
---PORT E 16-input/output
GPECON 0x56000040
GPEDAT 0x56000044
GPEUP 0x56000048
---PORT F 8-input/output
GPFCON 0x56000050
GPFDAT 0x56000054
GPFUP 0x56000058
---PORT G 16-input/output
GPGCON 0x56000060
GPGDAT 0x56000064
GPGUP 0x56000068
---PORT H 11-input/output
GPHCON 0x56000070
GPHDAT 0x56000074
GPHUP 0x56000078
NFCONF 0x4E000000 R/W NAND Flash configuration
NFCMD 0x4E000004 R/W NAND flash command set register [7:0] Address NAND flash memory address value
NFDATA 0x4E00000C R/W NAND flash data register
NFSTAT 0x4E000010 R NAND Flash operation status
NFECC 0x4E000014 R NAND Flash ECC (Error Correction Code) register |
PWM TIMER
TCFG0 0x51000000 R/W Configures the two 8-bit prescalers
TCFG0 0x51000000 R/W Configures the two 8-bit prescalers
TCFG1 0x51000004 R/W 5-MUX & DMA mode selecton register
TCON 0x51000008 R/W Timer control register
TCNTB0 0x5100000C R/W Timer 0 count buffer register
TCNTB1 0x51000018 R/W Timer 1 count buffer register
TCNTB2 0x51000024 R/W Timer 2 count buffer register
TCNTB3 0x51000030 R/W Timer 3 count buffer register
TCNTB4 0x5100003C R/W Timer 4 count buffer register |
WATCHDOG TIMER
OVERVIEW t_watchdog = 1/[ PCLK / (Prescaler value + 1) / Division_factor ] Once the watchdog timer is enabled, the value of watchdog timer data (WTDAT) register cannot be automatically reloaded into the timer counter (WTCNT). In this reason, an initial value must be written to the watchdog timer count (WTCNT) register, before the watchdog timer starts. When the S3C2440A is in debug mode using Embedded ICE, the watchdog timer must not operate.
The WTCON register allows the user to enable/disable the watchdog timer, select the clock signal from 4 different sources, enable/disable interrupts, and enable/disable the watchdog timer output. The Watchdog timer is used to resume the S3C2440A restart on mal-function after its power on; if controller restart is not desired, the Watchdog timer should be disabled.
WTCON 0x53000000 R/W Watchdog timer control register 0x8021
WTDAT 0x53000004 R/W Watchdog timer data register 0x8000
WTCNT 0x53000008 R/W Watchdog timer count register 0x8000 |
S3C2440 IO口寄存器地址
GPACON:0x56000000,默认7FFFFF
GPBCON:0x56000010,默认0x0
GPCCON 0x56000020
GPFCON 0x56000050 |