blob: 005f6242e0ba058f3300f6bd7eb9245ce3455524 [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
Kevin Hilman7c6337e2007-04-30 19:37:19 +010018struct sys_timer;
19
20extern struct sys_timer davinci_timer;
21
Kevin Hilmand0e47fb2009-04-14 11:30:11 -050022extern void davinci_irq_init(void);
Mark A. Greer673dd362009-04-15 12:40:00 -070023extern void __iomem *davinci_intc_base;
Mark A. Greer0b0c4c22009-04-15 12:41:40 -070024extern int davinci_intc_type;
Kevin Hilmand0e47fb2009-04-14 11:30:11 -050025
Mark A. Greerf64691b2009-04-15 12:40:11 -070026struct davinci_timer_instance {
Cyril Chemparathy1bcd38a2010-05-07 17:06:35 -040027 u32 base;
Mark A. Greerf64691b2009-04-15 12:40:11 -070028 u32 bottom_irq;
29 u32 top_irq;
Mark A. Greer3abd5ac2009-04-15 12:41:54 -070030 unsigned long cmp_off;
31 unsigned int cmp_irq;
Mark A. Greerf64691b2009-04-15 12:40:11 -070032};
33
34struct davinci_timer_info {
35 struct davinci_timer_instance *timers;
36 unsigned int clockevent_id;
37 unsigned int clocksource_id;
38};
39
Cyril Chemparathyc12f4152010-05-01 18:37:53 -040040struct davinci_gpio_controller;
41
Mark A. Greer79c3c0b2009-04-15 12:38:58 -070042/* SoC specific init support */
43struct davinci_soc_info {
44 struct map_desc *io_desc;
45 unsigned long io_desc_num;
Mark A. Greerb9ab1272009-04-15 12:39:09 -070046 u32 cpu_id;
47 u32 jtag_id;
Cyril Chemparathy3347db82010-05-07 17:06:34 -040048 u32 jtag_id_reg;
Mark A. Greerb9ab1272009-04-15 12:39:09 -070049 struct davinci_id *ids;
50 unsigned long ids_num;
Kevin Hilman08aca082010-01-11 08:22:23 -080051 struct clk_lookup *cpu_clks;
Cyril Chemparathye4c822c2010-05-07 17:06:36 -040052 u32 *psc_bases;
Mark A. Greerd81d1882009-04-15 12:39:33 -070053 unsigned long psc_bases_num;
Mark A. Greer0e585952009-04-15 12:39:48 -070054 void __iomem *pinmux_base;
55 const struct mux_config *pinmux_pins;
56 unsigned long pinmux_pins_num;
Cyril Chemparathybd808942010-05-07 17:06:37 -040057 u32 intc_base;
Mark A. Greer673dd362009-04-15 12:40:00 -070058 int intc_type;
59 u8 *intc_irq_prios;
60 unsigned long intc_irq_num;
Cyril Chemparathybd808942010-05-07 17:06:37 -040061 u32 *intc_host_map;
Mark A. Greerf64691b2009-04-15 12:40:11 -070062 struct davinci_timer_info *timer_info;
Cyril Chemparathy686b6342010-05-01 18:37:54 -040063 int gpio_type;
Cyril Chemparathyb8d44292010-05-07 17:06:32 -040064 u32 gpio_base;
Mark A. Greera9949552009-04-15 12:40:35 -070065 unsigned gpio_num;
66 unsigned gpio_irq;
David Brownell7a360712009-06-25 17:01:31 -070067 unsigned gpio_unbanked;
Cyril Chemparathyc12f4152010-05-01 18:37:53 -040068 struct davinci_gpio_controller *gpio_ctlrs;
69 int gpio_ctlrs_num;
Mark A. Greer65e866a2009-03-18 12:36:08 -050070 struct platform_device *serial_dev;
Mark A. Greer972412b2009-04-15 12:40:56 -070071 struct emac_platform_data *emac_pdata;
David Brownell0d04eb42009-04-30 17:35:48 -070072 dma_addr_t sram_dma;
73 unsigned sram_len;
Cyril Chemparathyc78a5bc2010-05-01 18:38:28 -040074 struct platform_device *reset_device;
75 void (*reset)(struct platform_device *);
Mark A. Greer79c3c0b2009-04-15 12:38:58 -070076};
77
78extern struct davinci_soc_info davinci_soc_info;
79
80extern void davinci_common_init(struct davinci_soc_info *soc_info);
Sergei Shtylyov7a9978a2010-04-21 18:11:33 +040081extern void davinci_init_ide(void);
Mark A. Greer79c3c0b2009-04-15 12:38:58 -070082
David Brownell0d04eb42009-04-30 17:35:48 -070083/* standard place to map on-chip SRAMs; they *may* support DMA */
84#define SRAM_VIRT 0xfffe0000
85#define SRAM_SIZE SZ_128K
86
Kevin Hilman7c6337e2007-04-30 19:37:19 +010087#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */