Date: Mon, 15 Sep 2014 08:48:38 +0100 From: Andrew Turner <andrew@fubar.geek.nz> To: Ian Lepore <ian@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r271601 - in head/sys/arm: arm include Message-ID: <20140915084838.7c00e41e@bender> In-Reply-To: <201409142121.s8ELL4ff038610@svn.freebsd.org> References: <201409142121.s8ELL4ff038610@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 14 Sep 2014 21:21:04 +0000 (UTC) Ian Lepore <ian@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140915084838.7c00e41e>