xref: /linux/arch/arm/mach-pxa/generic.h (revision 5a3d96519040f9736b9f8089e2a1e33a81a6eafe)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds  *  linux/arch/arm/mach-pxa/generic.h
31da177e4SLinus Torvalds  *
41da177e4SLinus Torvalds  * Author:	Nicolas Pitre
51da177e4SLinus Torvalds  * Copyright:	MontaVista Software Inc.
61da177e4SLinus Torvalds  *
71da177e4SLinus Torvalds  * This program is free software; you can redistribute it and/or modify
81da177e4SLinus Torvalds  * it under the terms of the GNU General Public License version 2 as
91da177e4SLinus Torvalds  * published by the Free Software Foundation.
101da177e4SLinus Torvalds  */
111da177e4SLinus Torvalds 
12b9e25aceSeric miao typedef int (*set_wake_t)(unsigned int, unsigned int);
13b9e25aceSeric miao 
141da177e4SLinus Torvalds struct sys_timer;
151da177e4SLinus Torvalds 
161da177e4SLinus Torvalds extern struct sys_timer pxa_timer;
17b9e25aceSeric miao extern void __init pxa_init_irq(int irq_nr, set_wake_t fn);
18b9e25aceSeric miao extern void __init pxa_init_gpio(int gpio_nr, set_wake_t fn);
19cd49104dSEric Miao extern void __init pxa25x_init_irq(void);
20cd49104dSEric Miao extern void __init pxa27x_init_irq(void);
212c8086a5Seric miao extern void __init pxa3xx_init_irq(void);
221da177e4SLinus Torvalds extern void __init pxa_map_io(void);
231da177e4SLinus Torvalds 
241da177e4SLinus Torvalds extern unsigned int get_clk_frequency_khz(int info);
2530f0b408Seric miao extern int pxa_last_gpio;
261da177e4SLinus Torvalds 
271da177e4SLinus Torvalds #define SET_BANK(__nr,__start,__size) \
281da177e4SLinus Torvalds 	mi->bank[__nr].start = (__start), \
291da177e4SLinus Torvalds 	mi->bank[__nr].size = (__size), \
301da177e4SLinus Torvalds 	mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
311da177e4SLinus Torvalds 
323d3934c3Seric miao #define ARRAY_AND_SIZE(x)	(x), ARRAY_SIZE(x)
333d3934c3Seric miao 
3415a40333SRussell King #ifdef CONFIG_PXA25x
3515a40333SRussell King extern unsigned pxa25x_get_clk_frequency_khz(int);
3615a40333SRussell King extern unsigned pxa25x_get_memclk_frequency_10khz(void);
3715a40333SRussell King #else
3815a40333SRussell King #define pxa25x_get_clk_frequency_khz(x)		(0)
3915a40333SRussell King #define pxa25x_get_memclk_frequency_10khz()	(0)
4015a40333SRussell King #endif
4115a40333SRussell King 
4215a40333SRussell King #ifdef CONFIG_PXA27x
4315a40333SRussell King extern unsigned pxa27x_get_clk_frequency_khz(int);
4415a40333SRussell King extern unsigned pxa27x_get_memclk_frequency_10khz(void);
4515a40333SRussell King #else
4615a40333SRussell King #define pxa27x_get_clk_frequency_khz(x)		(0)
4715a40333SRussell King #define pxa27x_get_memclk_frequency_10khz()	(0)
4815a40333SRussell King #endif
4915a40333SRussell King 
5004fef228SEric Miao #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
5104fef228SEric Miao extern void pxa2xx_clear_reset_status(unsigned int);
5204fef228SEric Miao #else
5304fef228SEric Miao static inline void pxa2xx_clear_reset_status(unsigned int mask) {}
5404fef228SEric Miao #endif
5504fef228SEric Miao 
562c8086a5Seric miao #ifdef CONFIG_PXA3xx
572c8086a5Seric miao extern unsigned pxa3xx_get_clk_frequency_khz(int);
582c8086a5Seric miao extern unsigned pxa3xx_get_memclk_frequency_10khz(void);
5904fef228SEric Miao extern void pxa3xx_clear_reset_status(unsigned int);
602c8086a5Seric miao #else
612c8086a5Seric miao #define pxa3xx_get_clk_frequency_khz(x)		(0)
622c8086a5Seric miao #define pxa3xx_get_memclk_frequency_10khz()	(0)
6304fef228SEric Miao static inline void pxa3xx_clear_reset_status(unsigned int mask) {}
642c8086a5Seric miao #endif
65c0165504Seric miao 
66c0165504Seric miao extern struct sysdev_class pxa_irq_sysclass;
6716dfdbf0Seric miao extern struct sysdev_class pxa_gpio_sysclass;
68*5a3d9651SEric Miao extern struct sysdev_class pxa2xx_mfp_sysclass;
694be35e23Seric miao extern struct sysdev_class pxa3xx_mfp_sysclass;
70