Linux v2.6.13-rc3
[pohmelfs.git] / include / asm-arm / arch-s3c2410 / regs-gpio.h
blob2053cbacffc3d8c8c40523f63a2fb465dcb88888
1 /* linux/include/asm/hardware/s3c2410/regs-gpio.h
3 * Copyright (c) 2003,2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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.
10 * S3C2410 GPIO register definitions
12 * Changelog:
13 * 19-06-2003 BJD Created file
14 * 23-06-2003 BJD Updated GSTATUS registers
15 * 12-03-2004 BJD Updated include protection
16 * 20-07-2004 BJD Added GPIO pin numbers, added Port A definitions
17 * 04-10-2004 BJD Fixed number of bugs, added EXT IRQ filter defs
18 * 17-10-2004 BJD Added GSTATUS1 register definitions
19 * 18-11-2004 BJD Fixed definitions of GPE3, GPE4, GPE5 and GPE6
20 * 18-11-2004 BJD Added S3C2440 AC97 controls
21 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
22 * 28-Mar-2005 LCVR Fixed definition of GPB10
26 #ifndef __ASM_ARCH_REGS_GPIO_H
27 #define __ASM_ARCH_REGS_GPIO_H "$Id: gpio.h,v 1.5 2003/05/19 12:51:08 ben Exp $"
29 #define S3C2410_GPIONO(bank,offset) ((bank) + (offset))
31 #define S3C2410_GPIO_BANKA (32*0)
32 #define S3C2410_GPIO_BANKB (32*1)
33 #define S3C2410_GPIO_BANKC (32*2)
34 #define S3C2410_GPIO_BANKD (32*3)
35 #define S3C2410_GPIO_BANKE (32*4)
36 #define S3C2410_GPIO_BANKF (32*5)
37 #define S3C2410_GPIO_BANKG (32*6)
38 #define S3C2410_GPIO_BANKH (32*7)
40 #define S3C2410_GPIO_BASE(pin) ((((pin) & ~31) >> 1) + S3C24XX_VA_GPIO)
41 #define S3C2410_GPIO_OFFSET(pin) ((pin) & 31)
43 /* general configuration options */
45 #define S3C2410_GPIO_LEAVE (0xFFFFFFFF)
47 /* configure GPIO ports A..G */
49 #define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO)
51 /* port A - 22bits, zero in bit X makes pin X output
52 * 1 makes port special function, this is default
54 #define S3C2410_GPACON S3C2410_GPIOREG(0x00)
55 #define S3C2410_GPADAT S3C2410_GPIOREG(0x04)
57 #define S3C2410_GPA0 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 0)
58 #define S3C2410_GPA0_OUT (0<<0)
59 #define S3C2410_GPA0_ADDR0 (1<<0)
61 #define S3C2410_GPA1 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 1)
62 #define S3C2410_GPA1_OUT (0<<1)
63 #define S3C2410_GPA1_ADDR16 (1<<1)
65 #define S3C2410_GPA2 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 2)
66 #define S3C2410_GPA2_OUT (0<<2)
67 #define S3C2410_GPA2_ADDR17 (1<<2)
69 #define S3C2410_GPA3 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 3)
70 #define S3C2410_GPA3_OUT (0<<3)
71 #define S3C2410_GPA3_ADDR18 (1<<3)
73 #define S3C2410_GPA4 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 4)
74 #define S3C2410_GPA4_OUT (0<<4)
75 #define S3C2410_GPA4_ADDR19 (1<<4)
77 #define S3C2410_GPA5 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 5)
78 #define S3C2410_GPA5_OUT (0<<5)
79 #define S3C2410_GPA5_ADDR20 (1<<5)
81 #define S3C2410_GPA6 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 6)
82 #define S3C2410_GPA6_OUT (0<<6)
83 #define S3C2410_GPA6_ADDR21 (1<<6)
85 #define S3C2410_GPA7 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 7)
86 #define S3C2410_GPA7_OUT (0<<7)
87 #define S3C2410_GPA7_ADDR22 (1<<7)
89 #define S3C2410_GPA8 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 8)
90 #define S3C2410_GPA8_OUT (0<<8)
91 #define S3C2410_GPA8_ADDR23 (1<<8)
93 #define S3C2410_GPA9 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 9)
94 #define S3C2410_GPA9_OUT (0<<9)
95 #define S3C2410_GPA9_ADDR24 (1<<9)
97 #define S3C2410_GPA10 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 10)
98 #define S3C2410_GPA10_OUT (0<<10)
99 #define S3C2410_GPA10_ADDR25 (1<<10)
101 #define S3C2410_GPA11 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 11)
102 #define S3C2410_GPA11_OUT (0<<11)
103 #define S3C2410_GPA11_ADDR26 (1<<11)
105 #define S3C2410_GPA12 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 12)
106 #define S3C2410_GPA12_OUT (0<<12)
107 #define S3C2410_GPA12_nGCS1 (1<<12)
109 #define S3C2410_GPA13 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 13)
110 #define S3C2410_GPA13_OUT (0<<13)
111 #define S3C2410_GPA13_nGCS2 (1<<13)
113 #define S3C2410_GPA14 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 14)
114 #define S3C2410_GPA14_OUT (0<<14)
115 #define S3C2410_GPA14_nGCS3 (1<<14)
117 #define S3C2410_GPA15 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 15)
118 #define S3C2410_GPA15_OUT (0<<15)
119 #define S3C2410_GPA15_nGCS4 (1<<15)
121 #define S3C2410_GPA16 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 16)
122 #define S3C2410_GPA16_OUT (0<<16)
123 #define S3C2410_GPA16_nGCS5 (1<<16)
125 #define S3C2410_GPA17 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 17)
126 #define S3C2410_GPA17_OUT (0<<17)
127 #define S3C2410_GPA17_CLE (1<<17)
129 #define S3C2410_GPA18 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 18)
130 #define S3C2410_GPA18_OUT (0<<18)
131 #define S3C2410_GPA18_ALE (1<<18)
133 #define S3C2410_GPA19 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 19)
134 #define S3C2410_GPA19_OUT (0<<19)
135 #define S3C2410_GPA19_nFWE (1<<19)
137 #define S3C2410_GPA20 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 20)
138 #define S3C2410_GPA20_OUT (0<<20)
139 #define S3C2410_GPA20_nFRE (1<<20)
141 #define S3C2410_GPA21 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 21)
142 #define S3C2410_GPA21_OUT (0<<21)
143 #define S3C2410_GPA21_nRSTOUT (1<<21)
145 #define S3C2410_GPA22 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 22)
146 #define S3C2410_GPA22_OUT (0<<22)
147 #define S3C2410_GPA22_nFCE (1<<22)
149 /* 0x08 and 0x0c are reserved */
151 /* GPB is 10 IO pins, each configured by 2 bits each in GPBCON.
152 * 00 = input, 01 = output, 10=special function, 11=reserved
153 * bit 0,1 = pin 0, 2,3= pin 1...
155 * CPBUP = pull up resistor control, 1=disabled, 0=enabled
158 #define S3C2410_GPBCON S3C2410_GPIOREG(0x10)
159 #define S3C2410_GPBDAT S3C2410_GPIOREG(0x14)
160 #define S3C2410_GPBUP S3C2410_GPIOREG(0x18)
162 /* no i/o pin in port b can have value 3! */
164 #define S3C2410_GPB0 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0)
165 #define S3C2410_GPB0_INP (0x00 << 0)
166 #define S3C2410_GPB0_OUTP (0x01 << 0)
167 #define S3C2410_GPB0_TOUT0 (0x02 << 0)
169 #define S3C2410_GPB1 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 1)
170 #define S3C2410_GPB1_INP (0x00 << 2)
171 #define S3C2410_GPB1_OUTP (0x01 << 2)
172 #define S3C2410_GPB1_TOUT1 (0x02 << 2)
174 #define S3C2410_GPB2 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 2)
175 #define S3C2410_GPB2_INP (0x00 << 4)
176 #define S3C2410_GPB2_OUTP (0x01 << 4)
177 #define S3C2410_GPB2_TOUT2 (0x02 << 4)
179 #define S3C2410_GPB3 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 3)
180 #define S3C2410_GPB3_INP (0x00 << 6)
181 #define S3C2410_GPB3_OUTP (0x01 << 6)
182 #define S3C2410_GPB3_TOUT3 (0x02 << 6)
184 #define S3C2410_GPB4 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 4)
185 #define S3C2410_GPB4_INP (0x00 << 8)
186 #define S3C2410_GPB4_OUTP (0x01 << 8)
187 #define S3C2410_GPB4_TCLK0 (0x02 << 8)
188 #define S3C2410_GPB4_MASK (0x03 << 8)
190 #define S3C2410_GPB5 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 5)
191 #define S3C2410_GPB5_INP (0x00 << 10)
192 #define S3C2410_GPB5_OUTP (0x01 << 10)
193 #define S3C2410_GPB5_nXBACK (0x02 << 10)
195 #define S3C2410_GPB6 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 6)
196 #define S3C2410_GPB6_INP (0x00 << 12)
197 #define S3C2410_GPB6_OUTP (0x01 << 12)
198 #define S3C2410_GPB6_nXBREQ (0x02 << 12)
200 #define S3C2410_GPB7 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 7)
201 #define S3C2410_GPB7_INP (0x00 << 14)
202 #define S3C2410_GPB7_OUTP (0x01 << 14)
203 #define S3C2410_GPB7_nXDACK1 (0x02 << 14)
205 #define S3C2410_GPB8 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8)
206 #define S3C2410_GPB8_INP (0x00 << 16)
207 #define S3C2410_GPB8_OUTP (0x01 << 16)
208 #define S3C2410_GPB8_nXDREQ1 (0x02 << 16)
210 #define S3C2410_GPB9 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 9)
211 #define S3C2410_GPB9_INP (0x00 << 18)
212 #define S3C2410_GPB9_OUTP (0x01 << 18)
213 #define S3C2410_GPB9_nXDACK0 (0x02 << 18)
215 #define S3C2410_GPB10 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 10)
216 #define S3C2410_GPB10_INP (0x00 << 20)
217 #define S3C2410_GPB10_OUTP (0x01 << 20)
218 #define S3C2410_GPB10_nXDRE0 (0x02 << 20)
220 /* Port C consits of 16 GPIO/Special function
222 * almost identical setup to port b, but the special functions are mostly
223 * to do with the video system's sync/etc.
226 #define S3C2410_GPCCON S3C2410_GPIOREG(0x20)
227 #define S3C2410_GPCDAT S3C2410_GPIOREG(0x24)
228 #define S3C2410_GPCUP S3C2410_GPIOREG(0x28)
230 #define S3C2410_GPC0 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 0)
231 #define S3C2410_GPC0_INP (0x00 << 0)
232 #define S3C2410_GPC0_OUTP (0x01 << 0)
233 #define S3C2410_GPC0_LEND (0x02 << 0)
235 #define S3C2410_GPC1 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 1)
236 #define S3C2410_GPC1_INP (0x00 << 2)
237 #define S3C2410_GPC1_OUTP (0x01 << 2)
238 #define S3C2410_GPC1_VCLK (0x02 << 2)
240 #define S3C2410_GPC2 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 2)
241 #define S3C2410_GPC2_INP (0x00 << 4)
242 #define S3C2410_GPC2_OUTP (0x01 << 4)
243 #define S3C2410_GPC2_VLINE (0x02 << 4)
245 #define S3C2410_GPC3 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 3)
246 #define S3C2410_GPC3_INP (0x00 << 6)
247 #define S3C2410_GPC3_OUTP (0x01 << 6)
248 #define S3C2410_GPC3_VFRAME (0x02 << 6)
250 #define S3C2410_GPC4 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 4)
251 #define S3C2410_GPC4_INP (0x00 << 8)
252 #define S3C2410_GPC4_OUTP (0x01 << 8)
253 #define S3C2410_GPC4_VM (0x02 << 8)
255 #define S3C2410_GPC5 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 5)
256 #define S3C2410_GPC5_INP (0x00 << 10)
257 #define S3C2410_GPC5_OUTP (0x01 << 10)
258 #define S3C2410_GPC5_LCDVF0 (0x02 << 10)
260 #define S3C2410_GPC6 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 6)
261 #define S3C2410_GPC6_INP (0x00 << 12)
262 #define S3C2410_GPC6_OUTP (0x01 << 12)
263 #define S3C2410_GPC6_LCDVF1 (0x02 << 12)
265 #define S3C2410_GPC7 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 7)
266 #define S3C2410_GPC7_INP (0x00 << 14)
267 #define S3C2410_GPC7_OUTP (0x01 << 14)
268 #define S3C2410_GPC7_LCDVF2 (0x02 << 14)
270 #define S3C2410_GPC8 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 8)
271 #define S3C2410_GPC8_INP (0x00 << 16)
272 #define S3C2410_GPC8_OUTP (0x01 << 16)
273 #define S3C2410_GPC8_VD0 (0x02 << 16)
275 #define S3C2410_GPC9 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 9)
276 #define S3C2410_GPC9_INP (0x00 << 18)
277 #define S3C2410_GPC9_OUTP (0x01 << 18)
278 #define S3C2410_GPC9_VD1 (0x02 << 18)
280 #define S3C2410_GPC10 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 10)
281 #define S3C2410_GPC10_INP (0x00 << 20)
282 #define S3C2410_GPC10_OUTP (0x01 << 20)
283 #define S3C2410_GPC10_VD2 (0x02 << 20)
285 #define S3C2410_GPC11 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 11)
286 #define S3C2410_GPC11_INP (0x00 << 22)
287 #define S3C2410_GPC11_OUTP (0x01 << 22)
288 #define S3C2410_GPC11_VD3 (0x02 << 22)
290 #define S3C2410_GPC12 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 12)
291 #define S3C2410_GPC12_INP (0x00 << 24)
292 #define S3C2410_GPC12_OUTP (0x01 << 24)
293 #define S3C2410_GPC12_VD4 (0x02 << 24)
295 #define S3C2410_GPC13 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 13)
296 #define S3C2410_GPC13_INP (0x00 << 26)
297 #define S3C2410_GPC13_OUTP (0x01 << 26)
298 #define S3C2410_GPC13_VD5 (0x02 << 26)
300 #define S3C2410_GPC14 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 14)
301 #define S3C2410_GPC14_INP (0x00 << 28)
302 #define S3C2410_GPC14_OUTP (0x01 << 28)
303 #define S3C2410_GPC14_VD6 (0x02 << 28)
305 #define S3C2410_GPC15 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 15)
306 #define S3C2410_GPC15_INP (0x00 << 30)
307 #define S3C2410_GPC15_OUTP (0x01 << 30)
308 #define S3C2410_GPC15_VD7 (0x02 << 30)
310 /* Port D consists of 16 GPIO/Special function
312 * almost identical setup to port b, but the special functions are mostly
313 * to do with the video system's data.
316 #define S3C2410_GPDCON S3C2410_GPIOREG(0x30)
317 #define S3C2410_GPDDAT S3C2410_GPIOREG(0x34)
318 #define S3C2410_GPDUP S3C2410_GPIOREG(0x38)
320 #define S3C2410_GPD0 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 0)
321 #define S3C2410_GPD0_INP (0x00 << 0)
322 #define S3C2410_GPD0_OUTP (0x01 << 0)
323 #define S3C2410_GPD0_VD8 (0x02 << 0)
325 #define S3C2410_GPD1 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1)
326 #define S3C2410_GPD1_INP (0x00 << 2)
327 #define S3C2410_GPD1_OUTP (0x01 << 2)
328 #define S3C2410_GPD1_VD9 (0x02 << 2)
330 #define S3C2410_GPD2 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2)
331 #define S3C2410_GPD2_INP (0x00 << 4)
332 #define S3C2410_GPD2_OUTP (0x01 << 4)
333 #define S3C2410_GPD2_VD10 (0x02 << 4)
335 #define S3C2410_GPD3 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 3)
336 #define S3C2410_GPD3_INP (0x00 << 6)
337 #define S3C2410_GPD3_OUTP (0x01 << 6)
338 #define S3C2410_GPD3_VD11 (0x02 << 6)
340 #define S3C2410_GPD4 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 4)
341 #define S3C2410_GPD4_INP (0x00 << 8)
342 #define S3C2410_GPD4_OUTP (0x01 << 8)
343 #define S3C2410_GPD4_VD12 (0x02 << 8)
345 #define S3C2410_GPD5 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 5)
346 #define S3C2410_GPD5_INP (0x00 << 10)
347 #define S3C2410_GPD5_OUTP (0x01 << 10)
348 #define S3C2410_GPD5_VD13 (0x02 << 10)
350 #define S3C2410_GPD6 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 6)
351 #define S3C2410_GPD6_INP (0x00 << 12)
352 #define S3C2410_GPD6_OUTP (0x01 << 12)
353 #define S3C2410_GPD6_VD14 (0x02 << 12)
355 #define S3C2410_GPD7 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 7)
356 #define S3C2410_GPD7_INP (0x00 << 14)
357 #define S3C2410_GPD7_OUTP (0x01 << 14)
358 #define S3C2410_GPD7_VD15 (0x02 << 14)
360 #define S3C2410_GPD8 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 8)
361 #define S3C2410_GPD8_INP (0x00 << 16)
362 #define S3C2410_GPD8_OUTP (0x01 << 16)
363 #define S3C2410_GPD8_VD16 (0x02 << 16)
365 #define S3C2410_GPD9 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 9)
366 #define S3C2410_GPD9_INP (0x00 << 18)
367 #define S3C2410_GPD9_OUTP (0x01 << 18)
368 #define S3C2410_GPD9_VD17 (0x02 << 18)
370 #define S3C2410_GPD10 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 10)
371 #define S3C2410_GPD10_INP (0x00 << 20)
372 #define S3C2410_GPD10_OUTP (0x01 << 20)
373 #define S3C2410_GPD10_VD18 (0x02 << 20)
375 #define S3C2410_GPD11 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 11)
376 #define S3C2410_GPD11_INP (0x00 << 22)
377 #define S3C2410_GPD11_OUTP (0x01 << 22)
378 #define S3C2410_GPD11_VD19 (0x02 << 22)
380 #define S3C2410_GPD12 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 12)
381 #define S3C2410_GPD12_INP (0x00 << 24)
382 #define S3C2410_GPD12_OUTP (0x01 << 24)
383 #define S3C2410_GPD12_VD20 (0x02 << 24)
385 #define S3C2410_GPD13 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 13)
386 #define S3C2410_GPD13_INP (0x00 << 26)
387 #define S3C2410_GPD13_OUTP (0x01 << 26)
388 #define S3C2410_GPD13_VD21 (0x02 << 26)
390 #define S3C2410_GPD14 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 14)
391 #define S3C2410_GPD14_INP (0x00 << 28)
392 #define S3C2410_GPD14_OUTP (0x01 << 28)
393 #define S3C2410_GPD14_VD22 (0x02 << 28)
395 #define S3C2410_GPD15 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 15)
396 #define S3C2410_GPD15_INP (0x00 << 30)
397 #define S3C2410_GPD15_OUTP (0x01 << 30)
398 #define S3C2410_GPD15_VD23 (0x02 << 30)
400 /* Port E consists of 16 GPIO/Special function
402 * again, the same as port B, but dealing with I2S, SDI, and
403 * more miscellaneous functions
406 #define S3C2410_GPECON S3C2410_GPIOREG(0x40)
407 #define S3C2410_GPEDAT S3C2410_GPIOREG(0x44)
408 #define S3C2410_GPEUP S3C2410_GPIOREG(0x48)
410 #define S3C2410_GPE0 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 0)
411 #define S3C2410_GPE0_INP (0x00 << 0)
412 #define S3C2410_GPE0_OUTP (0x01 << 0)
413 #define S3C2410_GPE0_I2SLRCK (0x02 << 0)
414 #define S3C2410_GPE0_MASK (0x03 << 0)
416 #define S3C2410_GPE1 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 1)
417 #define S3C2410_GPE1_INP (0x00 << 2)
418 #define S3C2410_GPE1_OUTP (0x01 << 2)
419 #define S3C2410_GPE1_I2SSCLK (0x02 << 2)
420 #define S3C2410_GPE1_MASK (0x03 << 2)
422 #define S3C2410_GPE2 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 2)
423 #define S3C2410_GPE2_INP (0x00 << 4)
424 #define S3C2410_GPE2_OUTP (0x01 << 4)
425 #define S3C2410_GPE2_CDCLK (0x02 << 4)
427 #define S3C2410_GPE3 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 3)
428 #define S3C2410_GPE3_INP (0x00 << 6)
429 #define S3C2410_GPE3_OUTP (0x01 << 6)
430 #define S3C2410_GPE3_I2SSDI (0x02 << 6)
431 #define S3C2410_GPE3_nSS0 (0x03 << 6)
432 #define S3C2410_GPE3_MASK (0x03 << 6)
434 #define S3C2410_GPE4 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 4)
435 #define S3C2410_GPE4_INP (0x00 << 8)
436 #define S3C2410_GPE4_OUTP (0x01 << 8)
437 #define S3C2410_GPE4_I2SSDO (0x02 << 8)
438 #define S3C2410_GPE4_I2SSDI (0x03 << 8)
439 #define S3C2410_GPE4_MASK (0x03 << 8)
441 #define S3C2410_GPE5 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 5)
442 #define S3C2410_GPE5_INP (0x00 << 10)
443 #define S3C2410_GPE5_OUTP (0x01 << 10)
444 #define S3C2410_GPE5_SDCLK (0x02 << 10)
446 #define S3C2410_GPE6 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 6)
447 #define S3C2410_GPE6_INP (0x00 << 12)
448 #define S3C2410_GPE6_OUTP (0x01 << 12)
449 #define S3C2410_GPE6_SDCMD (0x02 << 12)
451 #define S3C2410_GPE7 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7)
452 #define S3C2410_GPE7_INP (0x00 << 14)
453 #define S3C2410_GPE7_OUTP (0x01 << 14)
454 #define S3C2410_GPE7_SDDAT0 (0x02 << 14)
456 #define S3C2410_GPE8 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8)
457 #define S3C2410_GPE8_INP (0x00 << 16)
458 #define S3C2410_GPE8_OUTP (0x01 << 16)
459 #define S3C2410_GPE8_SDDAT1 (0x02 << 16)
461 #define S3C2410_GPE9 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9)
462 #define S3C2410_GPE9_INP (0x00 << 18)
463 #define S3C2410_GPE9_OUTP (0x01 << 18)
464 #define S3C2410_GPE9_SDDAT2 (0x02 << 18)
466 #define S3C2410_GPE10 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 10)
467 #define S3C2410_GPE10_INP (0x00 << 20)
468 #define S3C2410_GPE10_OUTP (0x01 << 20)
469 #define S3C2410_GPE10_SDDAT3 (0x02 << 20)
471 #define S3C2410_GPE11 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11)
472 #define S3C2410_GPE11_INP (0x00 << 22)
473 #define S3C2410_GPE11_OUTP (0x01 << 22)
474 #define S3C2410_GPE11_SPIMISO0 (0x02 << 22)
476 #define S3C2410_GPE12 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 12)
477 #define S3C2410_GPE12_INP (0x00 << 24)
478 #define S3C2410_GPE12_OUTP (0x01 << 24)
479 #define S3C2410_GPE12_SPIMOSI0 (0x02 << 24)
481 #define S3C2410_GPE13 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 13)
482 #define S3C2410_GPE13_INP (0x00 << 26)
483 #define S3C2410_GPE13_OUTP (0x01 << 26)
484 #define S3C2410_GPE13_SPICLK0 (0x02 << 26)
486 #define S3C2410_GPE14 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 14)
487 #define S3C2410_GPE14_INP (0x00 << 28)
488 #define S3C2410_GPE14_OUTP (0x01 << 28)
489 #define S3C2410_GPE14_IICSCL (0x02 << 28)
490 #define S3C2410_GPE14_MASK (0x03 << 28)
492 #define S3C2410_GPE15 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 15)
493 #define S3C2410_GPE15_INP (0x00 << 30)
494 #define S3C2410_GPE15_OUTP (0x01 << 30)
495 #define S3C2410_GPE15_IICSDA (0x02 << 30)
496 #define S3C2410_GPE15_MASK (0x03 << 30)
498 #define S3C2440_GPE0_ACSYNC (0x03 << 0)
499 #define S3C2440_GPE1_ACBITCLK (0x03 << 2)
500 #define S3C2440_GPE2_ACRESET (0x03 << 4)
501 #define S3C2440_GPE3_ACIN (0x03 << 6)
502 #define S3C2440_GPE4_ACOUT (0x03 << 8)
504 #define S3C2410_GPE_PUPDIS(x) (1<<(x))
506 /* Port F consists of 8 GPIO/Special function
508 * GPIO / interrupt inputs
510 * GPFCON has 2 bits for each of the input pins on port F
511 * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 undefined
513 * pull up works like all other ports.
516 #define S3C2410_GPFCON S3C2410_GPIOREG(0x50)
517 #define S3C2410_GPFDAT S3C2410_GPIOREG(0x54)
518 #define S3C2410_GPFUP S3C2410_GPIOREG(0x58)
520 #define S3C2410_GPF0 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 0)
521 #define S3C2410_GPF0_INP (0x00 << 0)
522 #define S3C2410_GPF0_OUTP (0x01 << 0)
523 #define S3C2410_GPF0_EINT0 (0x02 << 0)
525 #define S3C2410_GPF1 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 1)
526 #define S3C2410_GPF1_INP (0x00 << 2)
527 #define S3C2410_GPF1_OUTP (0x01 << 2)
528 #define S3C2410_GPF1_EINT1 (0x02 << 2)
530 #define S3C2410_GPF2 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 2)
531 #define S3C2410_GPF2_INP (0x00 << 4)
532 #define S3C2410_GPF2_OUTP (0x01 << 4)
533 #define S3C2410_GPF2_EINT2 (0x02 << 4)
535 #define S3C2410_GPF3 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 3)
536 #define S3C2410_GPF3_INP (0x00 << 6)
537 #define S3C2410_GPF3_OUTP (0x01 << 6)
538 #define S3C2410_GPF3_EINT3 (0x02 << 6)
540 #define S3C2410_GPF4 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 4)
541 #define S3C2410_GPF4_INP (0x00 << 8)
542 #define S3C2410_GPF4_OUTP (0x01 << 8)
543 #define S3C2410_GPF4_EINT4 (0x02 << 8)
545 #define S3C2410_GPF5 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 5)
546 #define S3C2410_GPF5_INP (0x00 << 10)
547 #define S3C2410_GPF5_OUTP (0x01 << 10)
548 #define S3C2410_GPF5_EINT5 (0x02 << 10)
550 #define S3C2410_GPF6 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 6)
551 #define S3C2410_GPF6_INP (0x00 << 12)
552 #define S3C2410_GPF6_OUTP (0x01 << 12)
553 #define S3C2410_GPF6_EINT6 (0x02 << 12)
555 #define S3C2410_GPF7 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 7)
556 #define S3C2410_GPF7_INP (0x00 << 14)
557 #define S3C2410_GPF7_OUTP (0x01 << 14)
558 #define S3C2410_GPF7_EINT7 (0x02 << 14)
560 /* Port G consists of 8 GPIO/IRQ/Special function
562 * GPGCON has 2 bits for each of the input pins on port F
563 * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 special func
565 * pull up works like all other ports.
568 #define S3C2410_GPGCON S3C2410_GPIOREG(0x60)
569 #define S3C2410_GPGDAT S3C2410_GPIOREG(0x64)
570 #define S3C2410_GPGUP S3C2410_GPIOREG(0x68)
572 #define S3C2410_GPG0 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 0)
573 #define S3C2410_GPG0_INP (0x00 << 0)
574 #define S3C2410_GPG0_OUTP (0x01 << 0)
575 #define S3C2410_GPG0_EINT8 (0x02 << 0)
577 #define S3C2410_GPG1 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 1)
578 #define S3C2410_GPG1_INP (0x00 << 2)
579 #define S3C2410_GPG1_OUTP (0x01 << 2)
580 #define S3C2410_GPG1_EINT9 (0x02 << 2)
582 #define S3C2410_GPG2 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 2)
583 #define S3C2410_GPG2_INP (0x00 << 4)
584 #define S3C2410_GPG2_OUTP (0x01 << 4)
585 #define S3C2410_GPG2_EINT10 (0x02 << 4)
587 #define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3)
588 #define S3C2410_GPG3_INP (0x00 << 6)
589 #define S3C2410_GPG3_OUTP (0x01 << 6)
590 #define S3C2410_GPG3_EINT11 (0x02 << 6)
592 #define S3C2410_GPG4 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 4)
593 #define S3C2410_GPG4_INP (0x00 << 8)
594 #define S3C2410_GPG4_OUTP (0x01 << 8)
595 #define S3C2410_GPG4_EINT12 (0x02 << 8)
596 #define S3C2410_GPG4_LCDPWREN (0x03 << 8)
598 #define S3C2410_GPG5 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5)
599 #define S3C2410_GPG5_INP (0x00 << 10)
600 #define S3C2410_GPG5_OUTP (0x01 << 10)
601 #define S3C2410_GPG5_EINT13 (0x02 << 10)
602 #define S3C2410_GPG5_SPIMISO1 (0x03 << 10)
604 #define S3C2410_GPG6 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6)
605 #define S3C2410_GPG6_INP (0x00 << 12)
606 #define S3C2410_GPG6_OUTP (0x01 << 12)
607 #define S3C2410_GPG6_EINT14 (0x02 << 12)
608 #define S3C2410_GPG6_SPIMOSI1 (0x03 << 12)
610 #define S3C2410_GPG7 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 7)
611 #define S3C2410_GPG7_INP (0x00 << 14)
612 #define S3C2410_GPG7_OUTP (0x01 << 14)
613 #define S3C2410_GPG7_EINT15 (0x02 << 14)
614 #define S3C2410_GPG7_SPICLK1 (0x03 << 14)
616 #define S3C2410_GPG8 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 8)
617 #define S3C2410_GPG8_INP (0x00 << 16)
618 #define S3C2410_GPG8_OUTP (0x01 << 16)
619 #define S3C2410_GPG8_EINT16 (0x02 << 16)
621 #define S3C2410_GPG9 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 9)
622 #define S3C2410_GPG9_INP (0x00 << 18)
623 #define S3C2410_GPG9_OUTP (0x01 << 18)
624 #define S3C2410_GPG9_EINT17 (0x02 << 18)
626 #define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10)
627 #define S3C2410_GPG10_INP (0x00 << 20)
628 #define S3C2410_GPG10_OUTP (0x01 << 20)
629 #define S3C2410_GPG10_EINT18 (0x02 << 20)
631 #define S3C2410_GPG11 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 11)
632 #define S3C2410_GPG11_INP (0x00 << 22)
633 #define S3C2410_GPG11_OUTP (0x01 << 22)
634 #define S3C2410_GPG11_EINT19 (0x02 << 22)
635 #define S3C2410_GPG11_TCLK1 (0x03 << 22)
637 #define S3C2410_GPG12 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 12)
638 #define S3C2410_GPG12_INP (0x00 << 24)
639 #define S3C2410_GPG12_OUTP (0x01 << 24)
640 #define S3C2410_GPG12_EINT20 (0x02 << 24)
641 #define S3C2410_GPG12_XMON (0x03 << 24)
643 #define S3C2410_GPG13 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 13)
644 #define S3C2410_GPG13_INP (0x00 << 26)
645 #define S3C2410_GPG13_OUTP (0x01 << 26)
646 #define S3C2410_GPG13_EINT21 (0x02 << 26)
647 #define S3C2410_GPG13_nXPON (0x03 << 26)
649 #define S3C2410_GPG14 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 14)
650 #define S3C2410_GPG14_INP (0x00 << 28)
651 #define S3C2410_GPG14_OUTP (0x01 << 28)
652 #define S3C2410_GPG14_EINT22 (0x02 << 28)
653 #define S3C2410_GPG14_YMON (0x03 << 28)
655 #define S3C2410_GPG15 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 15)
656 #define S3C2410_GPG15_INP (0x00 << 30)
657 #define S3C2410_GPG15_OUTP (0x01 << 30)
658 #define S3C2410_GPG15_EINT23 (0x02 << 30)
659 #define S3C2410_GPG15_nYPON (0x03 << 30)
662 #define S3C2410_GPG_PUPDIS(x) (1<<(x))
664 /* Port H consists of11 GPIO/serial/Misc pins
666 * GPGCON has 2 bits for each of the input pins on port F
667 * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 special func
669 * pull up works like all other ports.
672 #define S3C2410_GPHCON S3C2410_GPIOREG(0x70)
673 #define S3C2410_GPHDAT S3C2410_GPIOREG(0x74)
674 #define S3C2410_GPHUP S3C2410_GPIOREG(0x78)
676 #define S3C2410_GPH0 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 0)
677 #define S3C2410_GPH0_INP (0x00 << 0)
678 #define S3C2410_GPH0_OUTP (0x01 << 0)
679 #define S3C2410_GPH0_nCTS0 (0x02 << 0)
681 #define S3C2410_GPH1 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 1)
682 #define S3C2410_GPH1_INP (0x00 << 2)
683 #define S3C2410_GPH1_OUTP (0x01 << 2)
684 #define S3C2410_GPH1_nRTS0 (0x02 << 2)
686 #define S3C2410_GPH2 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 2)
687 #define S3C2410_GPH2_INP (0x00 << 4)
688 #define S3C2410_GPH2_OUTP (0x01 << 4)
689 #define S3C2410_GPH2_TXD0 (0x02 << 4)
691 #define S3C2410_GPH3 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 3)
692 #define S3C2410_GPH3_INP (0x00 << 6)
693 #define S3C2410_GPH3_OUTP (0x01 << 6)
694 #define S3C2410_GPH3_RXD0 (0x02 << 6)
696 #define S3C2410_GPH4 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 4)
697 #define S3C2410_GPH4_INP (0x00 << 8)
698 #define S3C2410_GPH4_OUTP (0x01 << 8)
699 #define S3C2410_GPH4_TXD1 (0x02 << 8)
701 #define S3C2410_GPH5 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 5)
702 #define S3C2410_GPH5_INP (0x00 << 10)
703 #define S3C2410_GPH5_OUTP (0x01 << 10)
704 #define S3C2410_GPH5_RXD1 (0x02 << 10)
706 #define S3C2410_GPH6 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 6)
707 #define S3C2410_GPH6_INP (0x00 << 12)
708 #define S3C2410_GPH6_OUTP (0x01 << 12)
709 #define S3C2410_GPH6_TXD2 (0x02 << 12)
710 #define S3C2410_GPH6_nRTS1 (0x03 << 12)
712 #define S3C2410_GPH7 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 7)
713 #define S3C2410_GPH7_INP (0x00 << 14)
714 #define S3C2410_GPH7_OUTP (0x01 << 14)
715 #define S3C2410_GPH7_RXD2 (0x02 << 14)
716 #define S3C2410_GPH7_nCTS1 (0x03 << 14)
718 #define S3C2410_GPH8 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 8)
719 #define S3C2410_GPH8_INP (0x00 << 16)
720 #define S3C2410_GPH8_OUTP (0x01 << 16)
721 #define S3C2410_GPH8_UCLK (0x02 << 16)
723 #define S3C2410_GPH9 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 9)
724 #define S3C2410_GPH9_INP (0x00 << 18)
725 #define S3C2410_GPH9_OUTP (0x01 << 18)
726 #define S3C2410_GPH9_CLKOUT0 (0x02 << 18)
728 #define S3C2410_GPH10 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 10)
729 #define S3C2410_GPH10_INP (0x00 << 20)
730 #define S3C2410_GPH10_OUTP (0x01 << 20)
731 #define S3C2410_GPH10_CLKOUT1 (0x02 << 20)
733 /* miscellaneous control */
735 #define S3C2410_MISCCR S3C2410_GPIOREG(0x80)
736 #define S3C2410_DCLKCON S3C2410_GPIOREG(0x84)
738 /* see clock.h for dclk definitions */
740 /* pullup control on databus */
741 #define S3C2410_MISCCR_SPUCR_HEN (0)
742 #define S3C2410_MISCCR_SPUCR_HDIS (1<<0)
743 #define S3C2410_MISCCR_SPUCR_LEN (0)
744 #define S3C2410_MISCCR_SPUCR_LDIS (1<<1)
746 #define S3C2410_MISCCR_USBDEV (0)
747 #define S3C2410_MISCCR_USBHOST (1<<3)
749 #define S3C2410_MISCCR_CLK0_MPLL (0<<4)
750 #define S3C2410_MISCCR_CLK0_UPLL (1<<4)
751 #define S3C2410_MISCCR_CLK0_FCLK (2<<4)
752 #define S3C2410_MISCCR_CLK0_HCLK (3<<4)
753 #define S3C2410_MISCCR_CLK0_PCLK (4<<4)
754 #define S3C2410_MISCCR_CLK0_DCLK0 (5<<4)
756 #define S3C2410_MISCCR_CLK1_MPLL (0<<8)
757 #define S3C2410_MISCCR_CLK1_UPLL (1<<8)
758 #define S3C2410_MISCCR_CLK1_FCLK (2<<8)
759 #define S3C2410_MISCCR_CLK1_HCLK (3<<8)
760 #define S3C2410_MISCCR_CLK1_PCLK (4<<8)
761 #define S3C2410_MISCCR_CLK1_DCLK1 (5<<8)
763 #define S3C2410_MISCCR_USBSUSPND0 (1<<12)
764 #define S3C2410_MISCCR_USBSUSPND1 (1<<13)
766 #define S3C2410_MISCCR_nRSTCON (1<<16)
768 #define S3C2410_MISCCR_nEN_SCLK0 (1<<17)
769 #define S3C2410_MISCCR_nEN_SCLK1 (1<<18)
770 #define S3C2410_MISCCR_nEN_SCLKE (1<<19)
771 #define S3C2410_MISCCR_SDSLEEP (7<<17)
773 /* external interrupt control... */
774 /* S3C2410_EXTINT0 -> irq sense control for EINT0..EINT7
775 * S3C2410_EXTINT1 -> irq sense control for EINT8..EINT15
776 * S3C2410_EXTINT2 -> irq sense control for EINT16..EINT23
778 * note S3C2410_EXTINT2 has filtering options for EINT16..EINT23
780 * Samsung datasheet p9-25
783 #define S3C2410_EXTINT0 S3C2410_GPIOREG(0x88)
784 #define S3C2410_EXTINT1 S3C2410_GPIOREG(0x8C)
785 #define S3C2410_EXTINT2 S3C2410_GPIOREG(0x90)
787 /* values for S3C2410_EXTINT0/1/2 */
788 #define S3C2410_EXTINT_LOWLEV (0x00)
789 #define S3C2410_EXTINT_HILEV (0x01)
790 #define S3C2410_EXTINT_FALLEDGE (0x02)
791 #define S3C2410_EXTINT_RISEEDGE (0x04)
792 #define S3C2410_EXTINT_BOTHEDGE (0x06)
794 /* interrupt filtering conrrol for EINT16..EINT23 */
795 #define S3C2410_EINFLT0 S3C2410_GPIOREG(0x94)
796 #define S3C2410_EINFLT1 S3C2410_GPIOREG(0x98)
797 #define S3C2410_EINFLT2 S3C2410_GPIOREG(0x9C)
798 #define S3C2410_EINFLT3 S3C2410_GPIOREG(0xA0)
800 /* values for interrupt filtering */
801 #define S3C2410_EINTFLT_PCLK (0x00)
802 #define S3C2410_EINTFLT_EXTCLK (1<<7)
803 #define S3C2410_EINTFLT_WIDTHMSK(x) ((x) & 0x3f)
805 /* removed EINTxxxx defs from here, not meant for this */
807 /* GSTATUS have miscellaneous information in them
811 #define S3C2410_GSTATUS0 S3C2410_GPIOREG(0x0AC)
812 #define S3C2410_GSTATUS1 S3C2410_GPIOREG(0x0B0)
813 #define S3C2410_GSTATUS2 S3C2410_GPIOREG(0x0B4)
814 #define S3C2410_GSTATUS3 S3C2410_GPIOREG(0x0B8)
815 #define S3C2410_GSTATUS4 S3C2410_GPIOREG(0x0BC)
817 #define S3C2410_GSTATUS0_nWAIT (1<<3)
818 #define S3C2410_GSTATUS0_NCON (1<<2)
819 #define S3C2410_GSTATUS0_RnB (1<<1)
820 #define S3C2410_GSTATUS0_nBATTFLT (1<<0)
822 #define S3C2410_GSTATUS1_IDMASK (0xffff0000)
823 #define S3C2410_GSTATUS1_2410 (0x32410000)
824 #define S3C2410_GSTATUS1_2440 (0x32440000)
826 #define S3C2410_GSTATUS2_WTRESET (1<<2)
827 #define S3C2410_GSTATUS2_OFFRESET (1<<1)
828 #define S3C2410_GSTATUS2_PONRESET (1<<0)
830 #endif /* __ASM_ARCH_REGS_GPIO_H */