1 /* linux/include/asm-arm/arch-s3c2410/hardware.h
3 * (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
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.
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
21 #ifndef __ASM_ARCH_HARDWARE_H
22 #define __ASM_ARCH_HARDWARE_H
26 /* processor clock settings, in Hz */
27 extern unsigned long s3c2410_pclk;
28 extern unsigned long s3c2410_hclk;
29 extern unsigned long s3c2410_fclk;
31 /* external functions for GPIO support
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.
38 /* s3c2410_gpio_cfgpin
40 * set the configuration of the given pin to the value passed.
43 * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
44 * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
47 extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
49 extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
51 /* s3c2410_gpio_getirq
53 * turn the given pin number into the corresponding IRQ number
56 * < 0 = no interrupt for this pin
57 * >=0 = interrupt number for the pin
60 extern int s3c2410_gpio_getirq(unsigned int pin);
62 /* s3c2410_gpio_irqfilter
64 * set the irq filtering on the given pin
66 * on = 0 => disable filtering
67 * 1 => enable filtering
69 * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
70 * width of filter (0 through 63)
75 extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
78 /* s3c2410_gpio_pullup
80 * configure the pull-up control on the given pin
82 * to = 1 => disable the pull-up
83 * 0 => enable the pull-up
87 * s3c2410_gpio_pullup(S3C2410_GPB0, 0);
88 * s3c2410_gpio_pullup(S3C2410_GPE8, 0);
91 extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
93 extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
95 extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
97 extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
99 #endif /* __ASSEMBLY__ */
101 #include <asm/sizes.h>
102 #include <asm/arch/map.h>
104 /* machine specific includes, such as the BAST */
106 #if defined(CONFIG_ARCH_BAST)
107 #include <asm/arch/bast-cpld.h>
110 /* currently here until moved into config (todo) */
111 #define CONFIG_NO_MULTIWORD_IO
113 #endif /* __ASM_ARCH_HARDWARE_H */