|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 08/15] xen/arm: use device api to detect GIC version
On Wed, 2014-04-09 at 15:32 +0100, Julien Grall wrote:
> On 04/09/2014 03:28 PM, Vijay Kilari wrote:
> >>> +
> >>> + dt_for_each_device_node(dt_host, node)
> >>> + {
> >>> + rc = device_init(node, DEVICE_GIC, NULL);
> >>> + if ( !rc )
> >>> + num_gics++;
> >>
> >> Xen only supports a single GIC for now. You have to initialized the
> >> correct one (see dt_find_interrupt_controller).
> >
> > dt_find_interrupt_controller expects compatibility string as below to fetch
> > the gic node which can be passed to device_init().
> >
> > static const struct dt_device_match gic_ids[] __initconst =
> > {
> > DT_MATCH_GIC,
> > { /* sentinel */ },
> > };
> >
> > In such case, generic driver has to pass compatibility strings of both
> > GIC v3 & GIC v2 to find the node in dt. Is this ok?
> >
> > Other way is to break when num_gics = 1 when it finds the first gic node.
>
> Why can't you modify dt_find_interrupt_controller? Or even better, take
> the code from it and use it directly in your function...
The patch here looks like a pretty natural use of the DT device API to
me, I think all that is needed is for gicv2_init to call
dt_get_parent(np) and skip any non-root gic with a warning message and
return error.
Something should also check for the "interrupt-controller" property,
either the inner or outer init function.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |