From owner-svn-src-all@FreeBSD.ORG Mon Sep 15 07:48:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73DFAA7F; Mon, 15 Sep 2014 07:48:51 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 58335A0A; Mon, 15 Sep 2014 07:48:51 +0000 (UTC) Received: from bender (unknown [94.5.79.253]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id E3DDB5CBF4; Mon, 15 Sep 2014 07:48:48 +0000 (UTC) Date: Mon, 15 Sep 2014 08:48:38 +0100 From: Andrew Turner To: Ian Lepore 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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 07:48:51 -0000 On Sun, 14 Sep 2014 21:21:04 +0000 (UTC) Ian Lepore 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