svn commit: r271601 - in head/sys/arm: arm include
Andrew Turner
andrew at fubar.geek.nz
Mon Sep 15 07:48:51 UTC 2014
On Sun, 14 Sep 2014 21:21:04 +0000 (UTC)
Ian Lepore <ian at FreeBSD.org> wrote:
...
> Modified: head/sys/arm/arm/gic.c
> ==============================================================================
> --- head/sys/arm/arm/gic.c Sun Sep 14 20:13:07 2014
> (r271600) +++ head/sys/arm/arm/gic.c Sun Sep 14 21:21:03
> 2014 (r271601) @@ -185,6 +185,51 @@ gic_init_secondary(void)
> gic_d_write_4(GICD_ISENABLER(30 >> 5), (1UL << (30 & 0x1F)));
> }
>
> +int
> +gic_decode_fdt(uint32_t iparent, uint32_t *intr, int *interrupt,
> + int *trig, int *pol)
> +{
> + static u_int num_intr_cells;
> +
> + if (num_intr_cells == 0) {
> + if (OF_searchencprop(OF_node_from_xref(iparent),
> + "#interrupt-cells", &num_intr_cells,
> + sizeof(num_intr_cells)) == -1) {
> + num_intr_cells = 1;
> + }
> + }
> +
> + if (num_intr_cells == 1) {
> + *interrupt = fdt32_to_cpu(intr[0]);
> + *trig = INTR_TRIGGER_CONFORM;
> + *pol = INTR_POLARITY_CONFORM;
> + } else {
> + if (intr[0] == 0)
> + *interrupt = fdt32_to_cpu(intr[1]) + 32;
> + else
> + *interrupt = fdt32_to_cpu(intr[1]);
Shouldn't the PPI case have a +16? The PPI interrupts start from 16
with 0-15 being used for software-generated interrupts. My copy of the
binding document state the values for the PPI interrupts should be in
the range 0 to 15 meaning they will be assigned an SGI value here.
Andrew
More information about the svn-src-head
mailing list