diff options
author | Julien Grall <julien.grall@linaro.org> | 2013-09-13 13:49:19 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-09-17 15:28:23 +0100 |
commit | e60d11198f7d7fa7cdb4260546d424de14449401 (patch) | |
tree | 461b04e9ea77f2aa0c422b063ef726d3708fbd0a | |
parent | d90abf9aa6aea90f2ffe402ca3bad8e6fdb9ef1b (diff) | |
download | xen-e60d11198f7d7fa7cdb4260546d424de14449401.tar.gz xen-e60d11198f7d7fa7cdb4260546d424de14449401.tar.bz2 xen-e60d11198f7d7fa7cdb4260546d424de14449401.zip |
xen/dts: dt_find_interrupt_controller: accept multiple compatible strings
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
-rw-r--r-- | xen/arch/arm/gic.c | 7 | ||||
-rw-r--r-- | xen/common/device_tree.c | 5 | ||||
-rw-r--r-- | xen/include/asm-arm/gic.h | 2 | ||||
-rw-r--r-- | xen/include/xen/device_tree.h | 3 |
4 files changed, 13 insertions, 4 deletions
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 7c24811510..aff57b9338 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -355,10 +355,15 @@ int gic_irq_xlate(const u32 *intspec, unsigned int intsize, /* Set up the GIC */ void __init gic_init(void) { + static const struct dt_device_match gic_ids[] __initconst = + { + DT_MATCH_GIC, + { /* sentinel */ }, + }; struct dt_device_node *node; int res; - node = dt_find_interrupt_controller("arm,cortex-a15-gic"); + node = dt_find_interrupt_controller(gic_ids); if ( !node ) panic("Unable to find compatible GIC in the device tree\n"); diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index d2262ce31f..215592e84e 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -1834,11 +1834,12 @@ static void __init dt_alias_scan(void) } } -struct dt_device_node * __init dt_find_interrupt_controller(const char *compat) +struct dt_device_node * __init +dt_find_interrupt_controller(const struct dt_device_match *matches) { struct dt_device_node *np = NULL; - while ( (np = dt_find_compatible_node(np, NULL, compat)) ) + while ( (np = dt_find_matching_node(np, matches)) ) { if ( !dt_find_property(np, "interrupt-controller", NULL) ) continue; diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index 513c1fca6c..92a3349c68 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -135,6 +135,8 @@ #ifndef __ASSEMBLY__ #include <xen/device_tree.h> +#define DT_MATCH_GIC DT_MATCH_COMPATIBLE("arm,cortex-a15-gic") + extern int domain_vgic_init(struct domain *d); extern void domain_vgic_free(struct domain *d); diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 5a51ab679d..fae9f97215 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -240,7 +240,8 @@ extern const struct dt_device_node *dt_interrupt_controller; * * If found, return the interrupt controller device node. */ -struct dt_device_node * __init dt_find_interrupt_controller(const char *compat); +struct dt_device_node * __init +dt_find_interrupt_controller(const struct dt_device_match *matches); #define dt_prop_cmp(s1, s2) strcmp((s1), (s2)) #define dt_node_cmp(s1, s2) strcasecmp((s1), (s2)) |