1 /*
2  * Header for code common to all DaVinci machines.
3  *
4  * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
5  *
6  * 2007 (c) MontaVista Software, Inc. This file is licensed under
7  * the terms of the GNU General Public License version 2. This program
8  * is licensed "as is" without any warranty of any kind, whether express
9  * or implied.
10  */
11 
12 #ifndef __ARCH_ARM_MACH_DAVINCI_COMMON_H
13 #define __ARCH_ARM_MACH_DAVINCI_COMMON_H
14 
15 #include <linux/clk.h>
16 #include <linux/compiler.h>
17 #include <linux/types.h>
18 #include <linux/reboot.h>
19 
20 void davinci_timer_init(struct clk *clk);
21 
22 extern void davinci_irq_init(void);
23 extern void __iomem *davinci_intc_base;
24 extern int davinci_intc_type;
25 
26 struct davinci_timer_instance {
27 	u32		base;
28 	u32		bottom_irq;
29 	u32		top_irq;
30 	unsigned long	cmp_off;
31 	unsigned int	cmp_irq;
32 };
33 
34 struct davinci_timer_info {
35 	struct davinci_timer_instance	*timers;
36 	unsigned int			clockevent_id;
37 	unsigned int			clocksource_id;
38 };
39 
40 struct davinci_gpio_controller;
41 
42 /*
43  * SoC info passed into common davinci modules.
44  *
45  * Base addresses in this structure should be physical and not virtual.
46  * Modules that take such base addresses, should internally ioremap() them to
47  * use.
48  */
49 struct davinci_soc_info {
50 	struct map_desc			*io_desc;
51 	unsigned long			io_desc_num;
52 	u32				cpu_id;
53 	u32				jtag_id;
54 	u32				jtag_id_reg;
55 	struct davinci_id		*ids;
56 	unsigned long			ids_num;
57 	u32				pinmux_base;
58 	const struct mux_config		*pinmux_pins;
59 	unsigned long			pinmux_pins_num;
60 	u32				intc_base;
61 	int				intc_type;
62 	u8				*intc_irq_prios;
63 	unsigned long			intc_irq_num;
64 	u32				*intc_host_map;
65 	struct davinci_timer_info	*timer_info;
66 	int				gpio_type;
67 	u32				gpio_base;
68 	unsigned			gpio_num;
69 	unsigned			gpio_irq;
70 	unsigned			gpio_unbanked;
71 	struct davinci_gpio_controller	*gpio_ctlrs;
72 	int				gpio_ctlrs_num;
73 	struct emac_platform_data	*emac_pdata;
74 	dma_addr_t			sram_dma;
75 	unsigned			sram_len;
76 };
77 
78 extern struct davinci_soc_info davinci_soc_info;
79 
80 extern void davinci_common_init(const struct davinci_soc_info *soc_info);
81 extern void davinci_init_ide(void);
82 void davinci_init_late(void);
83 
84 #ifdef CONFIG_CPU_FREQ
85 int davinci_cpufreq_init(void);
86 #else
davinci_cpufreq_init(void)87 static inline int davinci_cpufreq_init(void) { return 0; }
88 #endif
89 
90 #ifdef CONFIG_SUSPEND
91 int davinci_pm_init(void);
92 #else
davinci_pm_init(void)93 static inline int davinci_pm_init(void) { return 0; }
94 #endif
95 
96 void __init pdata_quirks_init(void);
97 
98 #define SRAM_SIZE	SZ_128K
99 
100 #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
101