xref: /openbmc/linux/arch/arm/mach-davinci/common.h (revision 0c6dfa75)
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 	dma_addr_t			sram_dma;
49 	unsigned			sram_len;
50 };
51 
52 extern struct davinci_soc_info davinci_soc_info;
53 
54 extern void davinci_common_init(const struct davinci_soc_info *soc_info);
55 extern void davinci_init_ide(void);
56 void davinci_init_late(void);
57 
58 #ifdef CONFIG_SUSPEND
59 int davinci_pm_init(void);
60 #else
61 static inline int davinci_pm_init(void) { return 0; }
62 #endif
63 
64 void __init pdata_quirks_init(void);
65 
66 #define SRAM_SIZE	SZ_128K
67 
68 #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
69