vserver 1.9.3
[linux-2.6.git] / include / asm-arm / arch-s3c2410 / hardware.h
1 /* linux/include/asm-arm/arch-s3c2410/hardware.h
2  *
3  * (c) 2003 Simtec Electronics
4  *  Ben Dooks <ben@simtec.co.uk>
5  *
6  * S3C2410 - hardware
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  * Changelog:
13  *  21-May-2003 BJD  Created file
14  *  06-Jun-2003 BJD  Added CPU frequency settings
15  *  03-Sep-2003 BJD  Linux v2.6 support
16  *  12-Mar-2004 BJD  Fixed include protection, fixed type of clock vars
17  *  14-Sep-2004 BJD  Added misccr and getpin to gpio
18  *  01-Oct-2004 BJD  Added the new gpio functions
19 */
20
21 #ifndef __ASM_ARCH_HARDWARE_H
22 #define __ASM_ARCH_HARDWARE_H
23
24 #ifndef __ASSEMBLY__
25
26 /* processor clock settings, in Hz */
27 extern unsigned long s3c2410_pclk;
28 extern unsigned long s3c2410_hclk;
29 extern unsigned long s3c2410_fclk;
30
31 /* external functions for GPIO support
32  *
33  * These allow various different clients to access the same GPIO
34  * registers without conflicting. If your driver only owns the entire
35  * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
36 */
37
38 /* s3c2410_gpio_cfgpin
39  *
40  * set the configuration of the given pin to the value passed.
41  *
42  * eg:
43  *    s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
44  *    s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
45 */
46
47 extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
48
49 extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
50
51 /* s3c2410_gpio_getirq
52  *
53  * turn the given pin number into the corresponding IRQ number
54  *
55  * returns:
56  *      < 0 = no interrupt for this pin
57  *      >=0 = interrupt number for the pin
58 */
59
60 extern int s3c2410_gpio_getirq(unsigned int pin);
61
62 /* s3c2410_gpio_irqfilter
63  *
64  * set the irq filtering on the given pin
65  *
66  * on = 0 => disable filtering
67  *      1 => enable filtering
68  *
69  * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
70  *          width of filter (0 through 63)
71  *
72  *
73 */
74
75 extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
76                                   unsigned int config);
77
78 /* s3c2410_gpio_pullup
79  *
80  * configure the pull-up control on the given pin
81  *
82  * to = 1 => disable the pull-up
83  *      0 => enable the pull-up
84  *
85  * eg;
86  *
87  *   s3c2410_gpio_pullup(S3C2410_GPB0, 0);
88  *   s3c2410_gpio_pullup(S3C2410_GPE8, 0);
89 */
90
91 extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
92
93 extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
94
95 extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
96
97 extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
98
99 #endif /* __ASSEMBLY__ */
100
101 #include <asm/sizes.h>
102 #include <asm/arch/map.h>
103
104 /* machine specific includes, such as the BAST */
105
106 #if defined(CONFIG_ARCH_BAST)
107 #include <asm/arch/bast-cpld.h>
108 #endif
109
110 /* currently here until moved into config (todo) */
111 #define CONFIG_NO_MULTIWORD_IO
112
113 #endif /* __ASM_ARCH_HARDWARE_H */