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 #include <linux/reboot.h> 18 19 extern void davinci_timer_init(void); 20 21 extern void davinci_irq_init(void); 22 extern void __iomem *davinci_intc_base; 23 extern int davinci_intc_type; 24 25 struct davinci_timer_instance { 26 u32 base; 27 u32 bottom_irq; 28 u32 top_irq; 29 unsigned long cmp_off; 30 unsigned int cmp_irq; 31 }; 32 33 struct davinci_timer_info { 34 struct davinci_timer_instance *timers; 35 unsigned int clockevent_id; 36 unsigned int clocksource_id; 37 }; 38 39 struct davinci_gpio_controller; 40 41 /* 42 * SoC info passed into common davinci modules. 43 * 44 * Base addresses in this structure should be physical and not virtual. 45 * Modules that take such base addresses, should internally ioremap() them to 46 * use. 47 */ 48 struct davinci_soc_info { 49 struct map_desc *io_desc; 50 unsigned long io_desc_num; 51 u32 cpu_id; 52 u32 jtag_id; 53 u32 jtag_id_reg; 54 struct davinci_id *ids; 55 unsigned long ids_num; 56 struct clk_lookup *cpu_clks; 57 u32 *psc_bases; 58 unsigned long psc_bases_num; 59 u32 pinmux_base; 60 const struct mux_config *pinmux_pins; 61 unsigned long pinmux_pins_num; 62 u32 intc_base; 63 int intc_type; 64 u8 *intc_irq_prios; 65 unsigned long intc_irq_num; 66 u32 *intc_host_map; 67 struct davinci_timer_info *timer_info; 68 int gpio_type; 69 u32 gpio_base; 70 unsigned gpio_num; 71 unsigned gpio_irq; 72 unsigned gpio_unbanked; 73 struct davinci_gpio_controller *gpio_ctlrs; 74 int gpio_ctlrs_num; 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(enum reboot_mode 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)90static 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)96static 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)102static 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