1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef _LINUX_VEXPRESS_H
15#define _LINUX_VEXPRESS_H
16
17#include <linux/device.h>
18#include <linux/reboot.h>
19
20#define VEXPRESS_SITE_MB 0
21#define VEXPRESS_SITE_DB1 1
22#define VEXPRESS_SITE_DB2 2
23#define VEXPRESS_SITE_MASTER 0xf
24
25#define VEXPRESS_CONFIG_STATUS_DONE 0
26#define VEXPRESS_CONFIG_STATUS_WAIT 1
27
28#define VEXPRESS_GPIO_MMC_CARDIN 0
29#define VEXPRESS_GPIO_MMC_WPROT 1
30#define VEXPRESS_GPIO_FLASH_WPn 2
31#define VEXPRESS_GPIO_LED0 3
32#define VEXPRESS_GPIO_LED1 4
33#define VEXPRESS_GPIO_LED2 5
34#define VEXPRESS_GPIO_LED3 6
35#define VEXPRESS_GPIO_LED4 7
36#define VEXPRESS_GPIO_LED5 8
37#define VEXPRESS_GPIO_LED6 9
38#define VEXPRESS_GPIO_LED7 10
39
40#define VEXPRESS_RES_FUNC(_site, _func) \
41{ \
42 .start = (_site), \
43 .end = (_func), \
44 .flags = IORESOURCE_BUS, \
45}
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70struct vexpress_config_bridge_info {
71 const char *name;
72 void *(*func_get)(struct device *dev, struct device_node *node);
73 void (*func_put)(void *func);
74 int (*func_exec)(void *func, int offset, bool write, u32 *data);
75};
76
77struct vexpress_config_bridge;
78
79struct vexpress_config_bridge *vexpress_config_bridge_register(
80 struct device_node *node,
81 struct vexpress_config_bridge_info *info);
82void vexpress_config_bridge_unregister(struct vexpress_config_bridge *bridge);
83
84void vexpress_config_complete(struct vexpress_config_bridge *bridge,
85 int status);
86
87
88
89struct vexpress_config_func;
90
91struct vexpress_config_func *__vexpress_config_func_get(struct device *dev,
92 struct device_node *node);
93#define vexpress_config_func_get_by_dev(dev) \
94 __vexpress_config_func_get(dev, NULL)
95#define vexpress_config_func_get_by_node(node) \
96 __vexpress_config_func_get(NULL, node)
97void vexpress_config_func_put(struct vexpress_config_func *func);
98
99
100int vexpress_config_read(struct vexpress_config_func *func, int offset,
101 u32 *data);
102int vexpress_config_write(struct vexpress_config_func *func, int offset,
103 u32 data);
104
105
106
107u32 vexpress_get_procid(int site);
108u32 vexpress_get_hbi(int site);
109void *vexpress_get_24mhz_clock_base(void);
110void vexpress_flags_set(u32 data);
111
112#define vexpress_get_site_by_node(node) __vexpress_get_site(NULL, node)
113#define vexpress_get_site_by_dev(dev) __vexpress_get_site(dev, NULL)
114unsigned __vexpress_get_site(struct device *dev, struct device_node *node);
115
116void vexpress_sysreg_early_init(void __iomem *base);
117void vexpress_sysreg_of_early_init(void);
118
119
120
121struct clk *vexpress_osc_setup(struct device *dev);
122void vexpress_osc_of_setup(struct device_node *node);
123
124void vexpress_clk_init(void __iomem *sp810_base);
125void vexpress_clk_of_init(void);
126
127#endif
128