Kevin Hilman | 7c6337e | 2007-04-30 19:37:19 +0100 | [diff] [blame] | 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 | |
Thomas Koeller | 280faff | 2010-04-21 15:33:32 +0200 | [diff] [blame] | 15 | #include <linux/compiler.h> |
| 16 | #include <linux/types.h> |
| 17 | |
Kevin Hilman | 7c6337e | 2007-04-30 19:37:19 +0100 | [diff] [blame] | 18 | struct sys_timer; |
| 19 | |
| 20 | extern struct sys_timer davinci_timer; |
| 21 | |
Kevin Hilman | d0e47fb | 2009-04-14 11:30:11 -0500 | [diff] [blame] | 22 | extern void davinci_irq_init(void); |
Mark A. Greer | 673dd36 | 2009-04-15 12:40:00 -0700 | [diff] [blame] | 23 | extern void __iomem *davinci_intc_base; |
Mark A. Greer | 0b0c4c2 | 2009-04-15 12:41:40 -0700 | [diff] [blame] | 24 | extern int davinci_intc_type; |
Kevin Hilman | d0e47fb | 2009-04-14 11:30:11 -0500 | [diff] [blame] | 25 | |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame] | 26 | struct davinci_timer_instance { |
Cyril Chemparathy | 1bcd38a | 2010-05-07 17:06:35 -0400 | [diff] [blame] | 27 | u32 base; |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame] | 28 | u32 bottom_irq; |
| 29 | u32 top_irq; |
Mark A. Greer | 3abd5ac | 2009-04-15 12:41:54 -0700 | [diff] [blame] | 30 | unsigned long cmp_off; |
| 31 | unsigned int cmp_irq; |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame] | 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 | |
Cyril Chemparathy | c12f415 | 2010-05-01 18:37:53 -0400 | [diff] [blame] | 40 | struct davinci_gpio_controller; |
| 41 | |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 42 | /* SoC specific init support */ |
| 43 | struct davinci_soc_info { |
| 44 | struct map_desc *io_desc; |
| 45 | unsigned long io_desc_num; |
Mark A. Greer | b9ab127 | 2009-04-15 12:39:09 -0700 | [diff] [blame] | 46 | u32 cpu_id; |
| 47 | u32 jtag_id; |
Cyril Chemparathy | 3347db8 | 2010-05-07 17:06:34 -0400 | [diff] [blame] | 48 | u32 jtag_id_reg; |
Mark A. Greer | b9ab127 | 2009-04-15 12:39:09 -0700 | [diff] [blame] | 49 | struct davinci_id *ids; |
| 50 | unsigned long ids_num; |
Kevin Hilman | 08aca08 | 2010-01-11 08:22:23 -0800 | [diff] [blame] | 51 | struct clk_lookup *cpu_clks; |
Cyril Chemparathy | e4c822c | 2010-05-07 17:06:36 -0400 | [diff] [blame^] | 52 | u32 *psc_bases; |
Mark A. Greer | d81d188 | 2009-04-15 12:39:33 -0700 | [diff] [blame] | 53 | unsigned long psc_bases_num; |
Mark A. Greer | 0e58595 | 2009-04-15 12:39:48 -0700 | [diff] [blame] | 54 | void __iomem *pinmux_base; |
| 55 | const struct mux_config *pinmux_pins; |
| 56 | unsigned long pinmux_pins_num; |
Mark A. Greer | 673dd36 | 2009-04-15 12:40:00 -0700 | [diff] [blame] | 57 | void __iomem *intc_base; |
| 58 | int intc_type; |
| 59 | u8 *intc_irq_prios; |
| 60 | unsigned long intc_irq_num; |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame] | 61 | struct davinci_timer_info *timer_info; |
Cyril Chemparathy | 686b634 | 2010-05-01 18:37:54 -0400 | [diff] [blame] | 62 | int gpio_type; |
Cyril Chemparathy | b8d4429 | 2010-05-07 17:06:32 -0400 | [diff] [blame] | 63 | u32 gpio_base; |
Mark A. Greer | a994955 | 2009-04-15 12:40:35 -0700 | [diff] [blame] | 64 | unsigned gpio_num; |
| 65 | unsigned gpio_irq; |
David Brownell | 7a36071 | 2009-06-25 17:01:31 -0700 | [diff] [blame] | 66 | unsigned gpio_unbanked; |
Cyril Chemparathy | c12f415 | 2010-05-01 18:37:53 -0400 | [diff] [blame] | 67 | struct davinci_gpio_controller *gpio_ctlrs; |
| 68 | int gpio_ctlrs_num; |
Mark A. Greer | 65e866a | 2009-03-18 12:36:08 -0500 | [diff] [blame] | 69 | struct platform_device *serial_dev; |
Mark A. Greer | 972412b | 2009-04-15 12:40:56 -0700 | [diff] [blame] | 70 | struct emac_platform_data *emac_pdata; |
David Brownell | 0d04eb4 | 2009-04-30 17:35:48 -0700 | [diff] [blame] | 71 | dma_addr_t sram_dma; |
| 72 | unsigned sram_len; |
Cyril Chemparathy | c78a5bc | 2010-05-01 18:38:28 -0400 | [diff] [blame] | 73 | struct platform_device *reset_device; |
| 74 | void (*reset)(struct platform_device *); |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | extern struct davinci_soc_info davinci_soc_info; |
| 78 | |
| 79 | extern void davinci_common_init(struct davinci_soc_info *soc_info); |
Sergei Shtylyov | 7a9978a | 2010-04-21 18:11:33 +0400 | [diff] [blame] | 80 | extern void davinci_init_ide(void); |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 81 | |
David Brownell | 0d04eb4 | 2009-04-30 17:35:48 -0700 | [diff] [blame] | 82 | /* standard place to map on-chip SRAMs; they *may* support DMA */ |
| 83 | #define SRAM_VIRT 0xfffe0000 |
| 84 | #define SRAM_SIZE SZ_128K |
| 85 | |
Kevin Hilman | 7c6337e | 2007-04-30 19:37:19 +0100 | [diff] [blame] | 86 | #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */ |