xref: /linux/arch/arm/mach-davinci/common.h (revision b37042b2bb7cd751f03b73afb90364a418d870f4)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Header for code common to all DaVinci machines.
4  *
5  * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
6  *
7  * 2007 (c) MontaVista Software, Inc.
8  */
9 
10 #ifndef __ARCH_ARM_MACH_DAVINCI_COMMON_H
11 #define __ARCH_ARM_MACH_DAVINCI_COMMON_H
12 
13 #include <linux/clk.h>
14 #include <linux/compiler.h>
15 #include <linux/types.h>
16 #include <linux/reboot.h>
17 
18 #include <asm/irq.h>
19 
20 #define DAVINCI_INTC_START		NR_IRQS
21 #define DAVINCI_INTC_IRQ(_irqnum)	(DAVINCI_INTC_START + (_irqnum))
22 
23 struct davinci_gpio_controller;
24 
25 /*
26  * SoC info passed into common davinci modules.
27  *
28  * Base addresses in this structure should be physical and not virtual.
29  * Modules that take such base addresses, should internally ioremap() them to
30  * use.
31  */
32 struct davinci_soc_info {
33 	struct map_desc			*io_desc;
34 	unsigned long			io_desc_num;
35 	u32				cpu_id;
36 	u32				jtag_id;
37 	u32				jtag_id_reg;
38 	struct davinci_id		*ids;
39 	unsigned long			ids_num;
40 	u32				pinmux_base;
41 	const struct mux_config		*pinmux_pins;
42 	unsigned long			pinmux_pins_num;
43 	int				gpio_type;
44 	u32				gpio_base;
45 	unsigned			gpio_num;
46 	unsigned			gpio_irq;
47 	unsigned			gpio_unbanked;
48 	struct davinci_gpio_controller	*gpio_ctlrs;
49 	int				gpio_ctlrs_num;
50 	struct emac_platform_data	*emac_pdata;
51 	dma_addr_t			sram_dma;
52 	unsigned			sram_len;
53 };
54 
55 extern struct davinci_soc_info davinci_soc_info;
56 
57 extern void davinci_common_init(const struct davinci_soc_info *soc_info);
58 extern void davinci_init_ide(void);
59 void davinci_init_late(void);
60 
61 #ifdef CONFIG_CPU_FREQ
62 int davinci_cpufreq_init(void);
63 #else
64 static inline int davinci_cpufreq_init(void) { return 0; }
65 #endif
66 
67 #ifdef CONFIG_SUSPEND
68 int davinci_pm_init(void);
69 #else
70 static inline int davinci_pm_init(void) { return 0; }
71 #endif
72 
73 void __init pdata_quirks_init(void);
74 
75 #define SRAM_SIZE	SZ_128K
76 
77 #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
78