From owner-svn-src-projects@FreeBSD.ORG Mon Aug 11 17:24:53 2014 Return-Path: Delivered-To: svn-src-projects@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 018C5FF6; Mon, 11 Aug 2014 17:24:53 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBB922752; Mon, 11 Aug 2014 17:24:52 +0000 (UTC) Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU [128.32.117.67]) (authenticated bits=0) by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s7BHOhc5018362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 11 Aug 2014 10:24:44 -0700 Message-ID: <53E8FC5B.9070605@freebsd.org> Date: Mon, 11 Aug 2014 10:24:43 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Andrew Turner , src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: Re: svn commit: r269818 - projects/arm64/sys/dev/fdt References: <53e8f606.23db.c1d4a@svn.freebsd.org> In-Reply-To: <53e8f606.23db.c1d4a@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZXjudQKwDFimbSObrx+U8dfC6vxTUctfShY7AqtzWFsZ8OBjzH9WBCsJZn8h10EIV4GBZamXS6sMpk9ZPkdJusuXdEu8AT2jg= X-Sonic-ID: C;DrxyYnwh5BGzq+JAoK8kYw== M;6PTXYnwh5BGzq+JAoK8kYw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 17:24:53 -0000 On 08/11/14 09:57, Andrew Turner wrote: > Author: andrew > Date: Mon Aug 11 16:57:42 2014 > New Revision: 269818 > URL: http://svnweb.freebsd.org/changeset/base/269818 > > Log: > Hack to get the correct value for the interrupt from the vendor supplied > device tree. The GIC used the format where the type is > 0 for Shared Peripheral Interrupts (SPI), and 1 for Private Peripheral > Interrupts. The SPIs start at 32 in the GIc so we need to adjust their > values to match this. > > Modified: > projects/arm64/sys/dev/fdt/simplebus.c > > Modified: projects/arm64/sys/dev/fdt/simplebus.c > ============================================================================== > --- projects/arm64/sys/dev/fdt/simplebus.c Mon Aug 11 16:44:06 2014 (r269817) > +++ projects/arm64/sys/dev/fdt/simplebus.c Mon Aug 11 16:57:42 2014 (r269818) > @@ -310,10 +310,18 @@ simplebus_setup_dinfo(device_t dev, phan > icells = 1; > } > for (i = 0, k = 0; i < nintr; i += icells, k++) { > + u_int irq; > + > + if (icells == 3) { > + irq = intr[i + 1]; > + if (intr[i] == 0) > + irq += 32; > + } else > + irq = intr[i]; > intr[i] = ofw_bus_map_intr(dev, iparent, icells, > &intr[i]); > - resource_list_add(&ndi->rl, SYS_RES_IRQ, k, intr[i], > - intr[i], 1); > + resource_list_add(&ndi->rl, SYS_RES_IRQ, k, irq, > + irq, 1); > } > free(intr, M_OFWPROP); > } > The much better place to do this kind of hack is in the ARM nexus_ofw_map_intr() routine. Ian's intrng branch will push this into the PIC driver, where it actually belongs, but putting it in nexus isn't so bad for now and will apply to all buses, not just simplebus. -Nathan