1 #ifndef __ASM_ARM_PLATFORM_H
2 #define __ASM_ARM_PLATFORM_H
3 
4 #include <xen/init.h>
5 #include <xen/sched.h>
6 #include <xen/mm.h>
7 #include <xen/device_tree.h>
8 
9 /* Describe specific operation for a board */
10 struct platform_desc {
11     /* Platform name */
12     const char *name;
13     /* Array of device tree 'compatible' strings */
14     const char *const *compatible;
15     /* Platform initialization */
16     int (*init)(void);
17     int (*init_time)(void);
18 #ifdef CONFIG_ARM_32
19     /* SMP */
20     int (*smp_init)(void);
21     int (*cpu_up)(int cpu);
22 #endif
23     /* Specific mapping for dom0 */
24     int (*specific_mapping)(struct domain *d);
25     /* Platform reset */
26     void (*reset)(void);
27     /* Platform power-off */
28     void (*poweroff)(void);
29     /*
30      * Platform quirks
31      * Defined has a function because a platform can support multiple
32      * board with different quirk on each
33      */
34     uint32_t (*quirks)(void);
35     /*
36      * Platform blacklist devices
37      * List of devices which must not pass-through to a guest
38      */
39     const struct dt_device_match *blacklist_dev;
40 };
41 
42 /*
43  * Quirk for platforms where device tree incorrectly reports 4K GICC
44  * size, but actually the two GICC register ranges are placed at 64K
45  * stride.
46  */
47 #define PLATFORM_QUIRK_GIC_64K_STRIDE (1 << 0)
48 
49 void __init platform_init(void);
50 int __init platform_init_time(void);
51 int __init platform_specific_mapping(struct domain *d);
52 #ifdef CONFIG_ARM_32
53 int platform_smp_init(void);
54 int platform_cpu_up(int cpu);
55 #endif
56 void platform_reset(void);
57 void platform_poweroff(void);
58 bool platform_has_quirk(uint32_t quirk);
59 bool platform_device_is_blacklisted(const struct dt_device_node *node);
60 
61 #define PLATFORM_START(_name, _namestr)                         \
62 static const struct platform_desc  __plat_desc_##_name __used   \
63 __section(".arch.info") = {                                     \
64     .name = _namestr,
65 
66 #define PLATFORM_END                                            \
67 };
68 
69 #endif /* __ASM_ARM_PLATFORM_H */
70 
71 /*
72  * Local variables:
73  * mode: C
74  * c-file-style: "BSD"
75  * c-basic-offset: 4
76  * indent-tabs-mode: nil
77  * End:
78  */
79