blob: b124b77c90c5c929d3b536ff57f9f0b4178afe93 [file] [log] [blame]
Kevin Hilman7c6337e2007-04-30 19:37:19 +01001/*
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
Thomas Koeller280faff2010-04-21 15:33:32 +020015#include <linux/compiler.h>
16#include <linux/types.h>
17
Stephen Warren6bb27d72012-11-08 12:40:59 -070018extern void davinci_timer_init(void);
Kevin Hilman7c6337e2007-04-30 19:37:19 +010019
Kevin Hilmand0e47fb2009-04-14 11:30:11 -050020extern void davinci_irq_init(void);
Mark A. Greer673dd362009-04-15 12:40:00 -070021extern void __iomem *davinci_intc_base;
Mark A. Greer0b0c4c22009-04-15 12:41:40 -070022extern int davinci_intc_type;
Kevin Hilmand0e47fb2009-04-14 11:30:11 -050023
Mark A. Greerf64691b2009-04-15 12:40:11 -070024struct davinci_timer_instance {
Cyril Chemparathy1bcd38a2010-05-07 17:06:35 -040025 u32 base;
Mark A. Greerf64691b2009-04-15 12:40:11 -070026 u32 bottom_irq;
27 u32 top_irq;
Mark A. Greer3abd5ac2009-04-15 12:41:54 -070028 unsigned long cmp_off;
29 unsigned int cmp_irq;
Mark A. Greerf64691b2009-04-15 12:40:11 -070030};
31
32struct davinci_timer_info {
33 struct davinci_timer_instance *timers;
34 unsigned int clockevent_id;
35 unsigned int clocksource_id;
36};
37
Cyril Chemparathyc12f4152010-05-01 18:37:53 -040038struct davinci_gpio_controller;
39
Cyril Chemparathybcd6a1c2010-05-07 17:06:39 -040040/*
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 */
Mark A. Greer79c3c0b2009-04-15 12:38:58 -070047struct davinci_soc_info {
48 struct map_desc *io_desc;
49 unsigned long io_desc_num;
Mark A. Greerb9ab1272009-04-15 12:39:09 -070050 u32 cpu_id;
51 u32 jtag_id;
Cyril Chemparathy3347db82010-05-07 17:06:34 -040052 u32 jtag_id_reg;
Mark A. Greerb9ab1272009-04-15 12:39:09 -070053 struct davinci_id *ids;
54 unsigned long ids_num;
Kevin Hilman08aca082010-01-11 08:22:23 -080055 struct clk_lookup *cpu_clks;
Cyril Chemparathye4c822c2010-05-07 17:06:36 -040056 u32 *psc_bases;
Mark A. Greerd81d1882009-04-15 12:39:33 -070057 unsigned long psc_bases_num;
Cyril Chemparathy779b0d52010-05-07 17:06:38 -040058 u32 pinmux_base;
Mark A. Greer0e585952009-04-15 12:39:48 -070059 const struct mux_config *pinmux_pins;
60 unsigned long pinmux_pins_num;
Cyril Chemparathybd808942010-05-07 17:06:37 -040061 u32 intc_base;
Mark A. Greer673dd362009-04-15 12:40:00 -070062 int intc_type;
63 u8 *intc_irq_prios;
64 unsigned long intc_irq_num;
Cyril Chemparathybd808942010-05-07 17:06:37 -040065 u32 *intc_host_map;
Mark A. Greerf64691b2009-04-15 12:40:11 -070066 struct davinci_timer_info *timer_info;
Cyril Chemparathy686b6342010-05-01 18:37:54 -040067 int gpio_type;
Cyril Chemparathyb8d44292010-05-07 17:06:32 -040068 u32 gpio_base;
Mark A. Greera9949552009-04-15 12:40:35 -070069 unsigned gpio_num;
70 unsigned gpio_irq;
David Brownell7a360712009-06-25 17:01:31 -070071 unsigned gpio_unbanked;
Cyril Chemparathyc12f4152010-05-01 18:37:53 -040072 struct davinci_gpio_controller *gpio_ctlrs;
73 int gpio_ctlrs_num;
Mark A. Greer65e866a2009-03-18 12:36:08 -050074 struct platform_device *serial_dev;
Mark A. Greer972412b2009-04-15 12:40:56 -070075 struct emac_platform_data *emac_pdata;
David Brownell0d04eb42009-04-30 17:35:48 -070076 dma_addr_t sram_dma;
77 unsigned sram_len;
Mark A. Greer79c3c0b2009-04-15 12:38:58 -070078};
79
80extern struct davinci_soc_info davinci_soc_info;
81
82extern void davinci_common_init(struct davinci_soc_info *soc_info);
Sergei Shtylyov7a9978a2010-04-21 18:11:33 +040083extern void davinci_init_ide(void);
Sekhar Noric6121dd2011-12-05 11:29:46 +010084void davinci_restart(char mode, const char *cmd);
Shawn Guo3aa3e842012-04-26 09:45:39 +080085void davinci_init_late(void);
86
87#ifdef CONFIG_DAVINCI_RESET_CLOCKS
88int davinci_clk_disable_unused(void);
89#else
90static inline int davinci_clk_disable_unused(void) { return 0; }
91#endif
92
93#ifdef CONFIG_CPU_FREQ
94int davinci_cpufreq_init(void);
95#else
96static inline int davinci_cpufreq_init(void) { return 0; }
97#endif
98
99#ifdef CONFIG_SUSPEND
100int davinci_pm_init(void);
101#else
102static inline int davinci_pm_init(void) { return 0; }
103#endif
Mark A. Greer79c3c0b2009-04-15 12:38:58 -0700104
David Brownell0d04eb42009-04-30 17:35:48 -0700105#define SRAM_SIZE SZ_128K
106
Kevin Hilman7c6337e2007-04-30 19:37:19 +0100107#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */