• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/compiler.h>
16 #include <linux/types.h>
17 
18 extern void davinci_timer_init(void);
19 
20 extern void davinci_irq_init(void);
21 extern void __iomem *davinci_intc_base;
22 extern int davinci_intc_type;
23 
24 struct davinci_timer_instance {
25 	u32		base;
26 	u32		bottom_irq;
27 	u32		top_irq;
28 	unsigned long	cmp_off;
29 	unsigned int	cmp_irq;
30 };
31 
32 struct davinci_timer_info {
33 	struct davinci_timer_instance	*timers;
34 	unsigned int			clockevent_id;
35 	unsigned int			clocksource_id;
36 };
37 
38 struct davinci_gpio_controller;
39 
40 /*
41  * SoC info passed into common davinci modules.
42  *
43  * Base addresses in this structure should be physical and not virtual.
44  * Modules that take such base addresses, should internally ioremap() them to
45  * use.
46  */
47 struct davinci_soc_info {
48 	struct map_desc			*io_desc;
49 	unsigned long			io_desc_num;
50 	u32				cpu_id;
51 	u32				jtag_id;
52 	u32				jtag_id_reg;
53 	struct davinci_id		*ids;
54 	unsigned long			ids_num;
55 	struct clk_lookup		*cpu_clks;
56 	u32				*psc_bases;
57 	unsigned long			psc_bases_num;
58 	u32				pinmux_base;
59 	const struct mux_config		*pinmux_pins;
60 	unsigned long			pinmux_pins_num;
61 	u32				intc_base;
62 	int				intc_type;
63 	u8				*intc_irq_prios;
64 	unsigned long			intc_irq_num;
65 	u32				*intc_host_map;
66 	struct davinci_timer_info	*timer_info;
67 	int				gpio_type;
68 	u32				gpio_base;
69 	unsigned			gpio_num;
70 	unsigned			gpio_irq;
71 	unsigned			gpio_unbanked;
72 	struct davinci_gpio_controller	*gpio_ctlrs;
73 	int				gpio_ctlrs_num;
74 	struct platform_device		*serial_dev;
75 	struct emac_platform_data	*emac_pdata;
76 	dma_addr_t			sram_dma;
77 	unsigned			sram_len;
78 };
79 
80 extern struct davinci_soc_info davinci_soc_info;
81 
82 extern void davinci_common_init(struct davinci_soc_info *soc_info);
83 extern void davinci_init_ide(void);
84 void davinci_restart(char mode, const char *cmd);
85 void davinci_init_late(void);
86 
87 #ifdef CONFIG_DAVINCI_RESET_CLOCKS
88 int davinci_clk_disable_unused(void);
89 #else
davinci_clk_disable_unused(void)90 static inline int davinci_clk_disable_unused(void) { return 0; }
91 #endif
92 
93 #ifdef CONFIG_CPU_FREQ
94 int davinci_cpufreq_init(void);
95 #else
davinci_cpufreq_init(void)96 static inline int davinci_cpufreq_init(void) { return 0; }
97 #endif
98 
99 #ifdef CONFIG_SUSPEND
100 int davinci_pm_init(void);
101 #else
davinci_pm_init(void)102 static inline int davinci_pm_init(void) { return 0; }
103 #endif
104 
105 #define SRAM_SIZE	SZ_128K
106 
107 #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
108