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