2 * Originates from Samsung's u-boot 1.1.6 port to S3C6400 / SMDK6400
5 * Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de>
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 .globl mem_ctrl_asm_init
31 /* Memory subsystem address 0x7e00f120 */
32 ldr r0, =ELFIN_MEM_SYS_CFG
34 /* Xm0CSn2 = NFCON CS0, Xm0CSn3 = NFCON CS1 */
38 /* DMC1 base address 0x7e001000 */
39 ldr r0, =ELFIN_DMC1_BASE
42 str r1, [r0, #INDEX_DMC_MEMC_CMD]
44 ldr r1, =DMC_DDR_REFRESH_PRD
45 str r1, [r0, #INDEX_DMC_REFRESH_PRD]
47 ldr r1, =DMC_DDR_CAS_LATENCY
48 str r1, [r0, #INDEX_DMC_CAS_LATENCY]
50 ldr r1, =DMC_DDR_t_DQSS
51 str r1, [r0, #INDEX_DMC_T_DQSS]
53 ldr r1, =DMC_DDR_t_MRD
54 str r1, [r0, #INDEX_DMC_T_MRD]
56 ldr r1, =DMC_DDR_t_RAS
57 str r1, [r0, #INDEX_DMC_T_RAS]
60 str r1, [r0, #INDEX_DMC_T_RC]
62 ldr r1, =DMC_DDR_t_RCD
63 ldr r2, =DMC_DDR_schedule_RCD
65 str r1, [r0, #INDEX_DMC_T_RCD]
67 ldr r1, =DMC_DDR_t_RFC
68 ldr r2, =DMC_DDR_schedule_RFC
70 str r1, [r0, #INDEX_DMC_T_RFC]
73 ldr r2, =DMC_DDR_schedule_RP
75 str r1, [r0, #INDEX_DMC_T_RP]
77 ldr r1, =DMC_DDR_t_RRD
78 str r1, [r0, #INDEX_DMC_T_RRD]
81 str r1, [r0, #INDEX_DMC_T_WR]
83 ldr r1, =DMC_DDR_t_WTR
84 str r1, [r0, #INDEX_DMC_T_WTR]
87 str r1, [r0, #INDEX_DMC_T_XP]
89 ldr r1, =DMC_DDR_t_XSR
90 str r1, [r0, #INDEX_DMC_T_XSR]
92 ldr r1, =DMC_DDR_t_ESR
93 str r1, [r0, #INDEX_DMC_T_ESR]
96 str r1, [r0, #INDEX_DMC_MEMORY_CFG]
98 ldr r1, =DMC1_MEM_CFG2
99 str r1, [r0, #INDEX_DMC_MEMORY_CFG2]
101 ldr r1, =DMC1_CHIP0_CFG
102 str r1, [r0, #INDEX_DMC_CHIP_0_CFG]
104 ldr r1, =DMC_DDR_32_CFG
105 str r1, [r0, #INDEX_DMC_USER_CONFIG]
107 /* DMC0 DDR Chip 0 configuration direct command reg */
109 str r1, [r0, #INDEX_DMC_DIRECT_CMD]
113 str r1, [r0, #INDEX_DMC_DIRECT_CMD]
115 /* Auto Refresh 2 time */
117 str r1, [r0, #INDEX_DMC_DIRECT_CMD]
118 str r1, [r0, #INDEX_DMC_DIRECT_CMD]
121 ldr r1, =DMC_mDDR_EMR0
122 str r1, [r0, #INDEX_DMC_DIRECT_CMD]
125 ldr r1, =DMC_mDDR_MR0
126 str r1, [r0, #INDEX_DMC_DIRECT_CMD]
130 str r1, [r0, #INDEX_DMC_MEMC_CMD]
133 ldr r1, [r0, #INDEX_DMC_MEMC_STATUS]