diff options
author | Julien Grall <julien.grall@linaro.org> | 2013-04-27 23:03:25 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-05-13 12:00:00 +0100 |
commit | 93f8194038ebddca5898cf889b45a5dc0ba903c1 (patch) | |
tree | 6c074e7c33b28dd0686a3fa9bb8424275c9f03af /xen/include/asm-arm/platform.h | |
parent | e20feb2925e4dc7459c18accb667b32892463ce0 (diff) | |
download | xen-93f8194038ebddca5898cf889b45a5dc0ba903c1.tar.gz xen-93f8194038ebddca5898cf889b45a5dc0ba903c1.tar.bz2 xen-93f8194038ebddca5898cf889b45a5dc0ba903c1.zip |
xen/arm: Allow Xen to run on multiple platform without recompilation
Xen can include various platform support (ie: exynos5, versatile express...)
and choose during boot time a set of callbacks for the current board.
These callbacks will be called in places where each board can have specific
code. For the moment the callbacks are:
- platform_init: additional initialization for the platform
- platform_init_time: some platform (ie: Exynos 5) needs to initialize
the timer with an uncommon way
- platform_specific_mapping: add mapping to dom0 which are not specified
in the device tree
- platform_reset: reset the platform
- platform_poweroff: poweroff the platform
- platform_quirks: list of quirks for a specific board.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen/include/asm-arm/platform.h')
-rw-r--r-- | xen/include/asm-arm/platform.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h new file mode 100644 index 0000000000..e116265b24 --- /dev/null +++ b/xen/include/asm-arm/platform.h @@ -0,0 +1,55 @@ +#ifndef __ASM_ARM_PLATFORM_H +#define __ASM_ARM_PLATFORM_H + +#include <xen/init.h> +#include <xen/sched.h> +#include <xen/mm.h> + +/* Describe specific operation for a board */ +struct platform_desc { + /* Platform name */ + const char *name; + /* Array of device tree 'compatible' strings */ + const char *const *compatible; + /* Platform initialization */ + int (*init)(void); + int (*init_time)(void); + /* Specific mapping for dom0 */ + int (*specific_mapping)(struct domain *d); + /* Platform reset */ + void (*reset)(void); + /* Platform power-off */ + void (*poweroff)(void); + /* + * Platform quirks + * Defined has a function because a platform can support multiple + * board with different quirk on each + */ + uint32_t (*quirks)(void); +}; + +int __init platform_init(void); +int __init platform_init_time(void); +int __init platform_specific_mapping(struct domain *d); +void platform_reset(void); +void platform_poweroff(void); +bool_t platform_has_quirk(uint32_t quirk); + +#define PLATFORM_START(_name, _namestr) \ +static const struct platform_desc __plat_desc_##_name __used \ +__attribute__((__section__(".arch.info"))) = { \ + .name = _namestr, + +#define PLATFORM_END \ +}; + +#endif /* __ASM_ARM_PLATFORM_H */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ |