From owner-svn-src-head@freebsd.org Sun Apr 9 20:41:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F0F7D36A1F; Sun, 9 Apr 2017 20:41:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 DB8F6EDE; Sun, 9 Apr 2017 20:41:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v39Kf1IV030324; Sun, 9 Apr 2017 20:41:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v39Kf1U4030323; Sun, 9 Apr 2017 20:41:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704092041.v39Kf1U4030323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 9 Apr 2017 20:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316661 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Apr 2017 20:41:02 -0000 Author: ian Date: Sun Apr 9 20:41:00 2017 New Revision: 316661 URL: https://svnweb.freebsd.org/changeset/base/316661 Log: Update the code that compensates for the lack of a GPC interrupt controller driver for imx6. Some newer dts source puts the GIC node at the root instead of under /soc, so look in both places. Also, sometimes the GIC node doesn't list itself as its own interrupt-parent, allow that too. Modified: head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Sun Apr 9 19:30:49 2017 (r316660) +++ head/sys/arm/freescale/imx/imx6_machdep.c Sun Apr 9 20:41:00 2017 (r316661) @@ -78,7 +78,7 @@ static platform_cpu_reset_t imx6_cpu_res * We validate that we have data that looks like we expect before changing it: * - SOC node exists and has GPC as its interrupt parent. * - GPC node exists and has GIC as its interrupt parent. - * - GIC node exists and is its own interrupt parent. + * - GIC node exists and is its own interrupt parent or has no parent. * * This applies to all models of imx6. Luckily all of them have the devices * involved at the same addresses on the same buses, so we don't need any @@ -102,14 +102,20 @@ fix_fdt_interrupt_data(void) if (result <= 0) return; + /* GIC node may be child of soc node, or appear directly at root. */ gicnode = OF_finddevice("/soc/interrupt-controller@00a01000"); + if (gicnode == -1) { + gicnode = OF_finddevice("/interrupt-controller@00a01000"); if (gicnode == -1) return; + } + gicxref = OF_xref_from_node(gicnode); + + /* If gic node has no parent, pretend it is its own parent. */ result = OF_getencprop(gicnode, "interrupt-parent", &gicipar, sizeof(gicipar)); if (result <= 0) - return; - gicxref = OF_xref_from_node(gicnode); + gicipar = gicxref; gpcnode = OF_finddevice("/soc/aips-bus@02000000/gpc@020dc000"); if (gpcnode == -1)