]> bbs.cooldavid.org Git - net-next-2.6.git/blob - include/asm-arm/arch-s3c2410/regs-mem.h
Linux-2.6.12-rc2
[net-next-2.6.git] / include / asm-arm / arch-s3c2410 / regs-mem.h
1 /* linux/include/asm-arm/arch-s3c2410/regs-mem.h
2  *
3  * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4  *              http://www.simtec.co.uk/products/SWLINUX/
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * S3C2410 Memory Control register definitions
11  *
12  *  Changelog:
13  *      29-Sep-2004  BJD  Initial include for Linux
14  *      10-Mar-2005  LCVR Changed S3C2410_VA to S3C24XX_VA
15  *
16 */
17
18 #ifndef __ASM_ARM_MEMREGS_H
19 #define __ASM_ARM_MEMREGS_H "$Id: regs.h,v 1.8 2003/05/01 15:55:41 ben Exp $"
20
21 #ifndef S3C2410_MEMREG
22 #define S3C2410_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
23 #endif
24
25 /* bus width, and wait state control */
26 #define S3C2410_BWSCON                  S3C2410_MEMREG(0x0000)
27
28 /* bank zero config - note, pinstrapped from OM pins! */
29 #define S3C2410_BWSCON_DW0_16           (1<<1)
30 #define S3C2410_BWSCON_DW0_32           (2<<1)
31
32 /* bank one configs */
33 #define S3C2410_BWSCON_DW1_8            (0<<4)
34 #define S3C2410_BWSCON_DW1_16           (1<<4)
35 #define S3C2410_BWSCON_DW1_32           (2<<4)
36 #define S3C2410_BWSCON_WS1              (1<<6)
37 #define S3C2410_BWSCON_ST1              (1<<7)
38
39 /* bank 2 configurations */
40 #define S3C2410_BWSCON_DW2_8            (0<<8)
41 #define S3C2410_BWSCON_DW2_16           (1<<8)
42 #define S3C2410_BWSCON_DW2_32           (2<<8)
43 #define S3C2410_BWSCON_WS2              (1<<10)
44 #define S3C2410_BWSCON_ST2              (1<<11)
45
46 /* bank 3 configurations */
47 #define S3C2410_BWSCON_DW3_8            (0<<12)
48 #define S3C2410_BWSCON_DW3_16           (1<<12)
49 #define S3C2410_BWSCON_DW3_32           (2<<12)
50 #define S3C2410_BWSCON_WS3              (1<<14)
51 #define S3C2410_BWSCON_ST3              (1<<15)
52
53 /* bank 4 configurations */
54 #define S3C2410_BWSCON_DW4_8            (0<<16)
55 #define S3C2410_BWSCON_DW4_16           (1<<16)
56 #define S3C2410_BWSCON_DW4_32           (2<<16)
57 #define S3C2410_BWSCON_WS4              (1<<18)
58 #define S3C2410_BWSCON_ST4              (1<<19)
59
60 /* bank 5 configurations */
61 #define S3C2410_BWSCON_DW5_8            (0<<20)
62 #define S3C2410_BWSCON_DW5_16           (1<<20)
63 #define S3C2410_BWSCON_DW5_32           (2<<20)
64 #define S3C2410_BWSCON_WS5              (1<<22)
65 #define S3C2410_BWSCON_ST5              (1<<23)
66
67 /* bank 6 configurations */
68 #define S3C2410_BWSCON_DW6_8            (0<<24)
69 #define S3C2410_BWSCON_DW6_16           (1<<24)
70 #define S3C2410_BWSCON_DW6_32           (2<<24)
71 #define S3C2410_BWSCON_WS6              (1<<26)
72 #define S3C2410_BWSCON_ST6              (1<<27)
73
74 /* bank 7 configurations */
75 #define S3C2410_BWSCON_DW7_8            (0<<28)
76 #define S3C2410_BWSCON_DW7_16           (1<<28)
77 #define S3C2410_BWSCON_DW7_32           (2<<28)
78 #define S3C2410_BWSCON_WS7              (1<<30)
79 #define S3C2410_BWSCON_ST7              (1<<31)
80
81 /* memory set (rom, ram) */
82 #define S3C2410_BANKCON0                S3C2410_MEMREG(0x0004)
83 #define S3C2410_BANKCON1                S3C2410_MEMREG(0x0008)
84 #define S3C2410_BANKCON2                S3C2410_MEMREG(0x000C)
85 #define S3C2410_BANKCON3                S3C2410_MEMREG(0x0010)
86 #define S3C2410_BANKCON4                S3C2410_MEMREG(0x0014)
87 #define S3C2410_BANKCON5                S3C2410_MEMREG(0x0018)
88 #define S3C2410_BANKCON6                S3C2410_MEMREG(0x001C)
89 #define S3C2410_BANKCON7                S3C2410_MEMREG(0x0020)
90
91 /* bank configuration registers */
92
93 #define S3C2410_BANKCON_PMCnorm         (0x00)
94 #define S3C2410_BANKCON_PMC4            (0x01)
95 #define S3C2410_BANKCON_PMC8            (0x02)
96 #define S3C2410_BANKCON_PMC16           (0x03)
97
98 /* bank configurations for banks 0..7, note banks
99  * 6 and 7 have differnt configurations depending on
100  * the memory type bits */
101
102 #define S3C2410_BANKCON_Tacp2           (0x0 << 2)
103 #define S3C2410_BANKCON_Tacp3           (0x1 << 2)
104 #define S3C2410_BANKCON_Tacp4           (0x2 << 2)
105 #define S3C2410_BANKCON_Tacp6           (0x3 << 2)
106
107 #define S3C2410_BANKCON_Tcah0           (0x0 << 4)
108 #define S3C2410_BANKCON_Tcah1           (0x1 << 4)
109 #define S3C2410_BANKCON_Tcah2           (0x2 << 4)
110 #define S3C2410_BANKCON_Tcah4           (0x3 << 4)
111
112 #define S3C2410_BANKCON_Tcoh0           (0x0 << 6)
113 #define S3C2410_BANKCON_Tcoh1           (0x1 << 6)
114 #define S3C2410_BANKCON_Tcoh2           (0x2 << 6)
115 #define S3C2410_BANKCON_Tcoh4           (0x3 << 6)
116
117 #define S3C2410_BANKCON_Tacc1           (0x0 << 8)
118 #define S3C2410_BANKCON_Tacc2           (0x1 << 8)
119 #define S3C2410_BANKCON_Tacc3           (0x2 << 8)
120 #define S3C2410_BANKCON_Tacc4           (0x3 << 8)
121 #define S3C2410_BANKCON_Tacc6           (0x4 << 8)
122 #define S3C2410_BANKCON_Tacc8           (0x5 << 8)
123 #define S3C2410_BANKCON_Tacc10          (0x6 << 8)
124 #define S3C2410_BANKCON_Tacc14          (0x7 << 8)
125
126 #define S3C2410_BANKCON_Tcos0           (0x0 << 11)
127 #define S3C2410_BANKCON_Tcos1           (0x1 << 11)
128 #define S3C2410_BANKCON_Tcos2           (0x2 << 11)
129 #define S3C2410_BANKCON_Tcos4           (0x3 << 11)
130
131 #define S3C2410_BANKCON_Tacs0           (0x0 << 13)
132 #define S3C2410_BANKCON_Tacs1           (0x1 << 13)
133 #define S3C2410_BANKCON_Tacs2           (0x2 << 13)
134 #define S3C2410_BANKCON_Tacs4           (0x3 << 13)
135
136 #define S3C2410_BANKCON_SRAM            (0x0 << 15)
137 #define S3C2400_BANKCON_EDODRAM         (0x2 << 15)
138 #define S3C2410_BANKCON_SDRAM           (0x3 << 15)
139
140 /* next bits only for EDO DRAM in 6,7 */
141 #define S3C2400_BANKCON_EDO_Trdc1      (0x00 << 4)
142 #define S3C2400_BANKCON_EDO_Trdc2      (0x01 << 4)
143 #define S3C2400_BANKCON_EDO_Trdc3      (0x02 << 4)
144 #define S3C2400_BANKCON_EDO_Trdc4      (0x03 << 4)
145
146 /* CAS pulse width */
147 #define S3C2400_BANKCON_EDO_PULSE1     (0x00 << 3)
148 #define S3C2400_BANKCON_EDO_PULSE2     (0x01 << 3)
149
150 /* CAS pre-charge */
151 #define S3C2400_BANKCON_EDO_TCP1       (0x00 << 2)
152 #define S3C2400_BANKCON_EDO_TCP2       (0x01 << 2)
153
154 /* control column address select */
155 #define S3C2400_BANKCON_EDO_SCANb8     (0x00 << 0)
156 #define S3C2400_BANKCON_EDO_SCANb9     (0x01 << 0)
157 #define S3C2400_BANKCON_EDO_SCANb10    (0x02 << 0)
158 #define S3C2400_BANKCON_EDO_SCANb11    (0x03 << 0)
159
160 /* next bits only for SDRAM in 6,7 */
161 #define S3C2410_BANKCON_Trdc2           (0x00 << 2)
162 #define S3C2410_BANKCON_Trdc3           (0x01 << 2)
163 #define S3C2410_BANKCON_Trdc4           (0x02 << 2)
164
165 /* control column address select */
166 #define S3C2410_BANKCON_SCANb8          (0x00 << 0)
167 #define S3C2410_BANKCON_SCANb9          (0x01 << 0)
168 #define S3C2410_BANKCON_SCANb10         (0x02 << 0)
169
170 #define S3C2410_REFRESH                 S3C2410_MEMREG(0x0024)
171 #define S3C2410_BANKSIZE                S3C2410_MEMREG(0x0028)
172 #define S3C2410_MRSRB6                  S3C2410_MEMREG(0x002C)
173 #define S3C2410_MRSRB7                  S3C2410_MEMREG(0x0030)
174
175 /* refresh control */
176
177 #define S3C2410_REFRESH_REFEN           (1<<23)
178 #define S3C2410_REFRESH_SELF            (1<<22)
179 #define S3C2410_REFRESH_REFCOUNTER      ((1<<11)-1)
180
181 #define S3C2410_REFRESH_TRP_MASK        (3<<20)
182 #define S3C2410_REFRESH_TRP_2clk        (0<<20)
183 #define S3C2410_REFRESH_TRP_3clk        (1<<20)
184 #define S3C2410_REFRESH_TRP_4clk        (2<<20)
185
186 #define S3C2410_REFRESH_TSRC_MASK       (3<<18)
187 #define S3C2410_REFRESH_TSRC_4clk       (0<<18)
188 #define S3C2410_REFRESH_TSRC_5clk       (1<<18)
189 #define S3C2410_REFRESH_TSRC_6clk       (2<<18)
190 #define S3C2410_REFRESH_TSRC_7clk       (3<<18)
191
192
193 /* mode select register(s) */
194
195 #define  S3C2410_MRSRB_CL1              (0x00 << 4)
196 #define  S3C2410_MRSRB_CL2              (0x02 << 4)
197 #define  S3C2410_MRSRB_CL3              (0x03 << 4)
198
199 /* bank size register */
200 #define S3C2410_BANKSIZE_128M           (0x2 << 0)
201 #define S3C2410_BANKSIZE_64M            (0x1 << 0)
202 #define S3C2410_BANKSIZE_32M            (0x0 << 0)
203 #define S3C2410_BANKSIZE_16M            (0x7 << 0)
204 #define S3C2410_BANKSIZE_8M             (0x6 << 0)
205 #define S3C2410_BANKSIZE_4M             (0x5 << 0)
206 #define S3C2410_BANKSIZE_2M             (0x4 << 0)
207 #define S3C2410_BANKSIZE_MASK           (0x7 << 0)
208 #define S3C2410_BANKSIZE_SCLK_EN        (1<<4)
209 #define S3C2410_BANKSIZE_SCKE_EN        (1<<5)
210 #define S3C2410_BANKSIZE_BURST          (1<<7)
211
212 #endif /* __ASM_ARM_MEMREGS_H */