From owner-svn-src-projects@FreeBSD.ORG Wed Aug 13 12:31:37 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 2FDBC8E9; Wed, 13 Aug 2014 12:31:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 029C62123; Wed, 13 Aug 2014 12:31:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7DCVanv004250; Wed, 13 Aug 2014 12:31:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7DCVaMf004244; Wed, 13 Aug 2014 12:31:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201408131231.s7DCVaMf004244@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 13 Aug 2014 12:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r269927 - in projects/arm64/sys: arm64/arm64 dev/fdt X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 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: Wed, 13 Aug 2014 12:31:37 -0000 Author: andrew Date: Wed Aug 13 12:31:36 2014 New Revision: 269927 URL: http://svnweb.freebsd.org/changeset/base/269927 Log: Remove the hack to map interrupts from simplebus to nexus so it can be used with ofwbus. Modified: projects/arm64/sys/arm64/arm64/nexus.c projects/arm64/sys/dev/fdt/simplebus.c Modified: projects/arm64/sys/arm64/arm64/nexus.c ============================================================================== --- projects/arm64/sys/arm64/arm64/nexus.c Wed Aug 13 12:04:45 2014 (r269926) +++ projects/arm64/sys/arm64/arm64/nexus.c Wed Aug 13 12:31:36 2014 (r269927) @@ -114,11 +114,9 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), -#if 0 #ifdef FDT DEVMETHOD(ofw_bus_map_intr, nexus_ofw_map_intr), #endif -#endif { 0, 0 } }; @@ -320,36 +318,23 @@ nexus_deactivate_resource(device_t bus, return (rman_deactivate_resource(r)); } -#if 0 #ifdef FDT static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr) { - fdt_pic_decode_t intr_decode; - phandle_t intr_offset; - int i, rv, interrupt, trig, pol; - - intr_offset = OF_xref_phandle(iparent); - for (i = 0; i < icells; i++) - intr[i] = cpu_to_fdt32(intr[i]); - - for (i = 0; fdt_pic_table[i] != NULL; i++) { - intr_decode = fdt_pic_table[i]; - rv = intr_decode(intr_offset, intr, &interrupt, &trig, &pol); - - if (rv == 0) { - /* This was recognized as our PIC and decoded. */ - interrupt = FDT_MAP_IRQ(intr_parent, interrupt); - return (interrupt); - } - } + int irq; - /* Not in table, so guess */ - interrupt = FDT_MAP_IRQ(intr_parent, fdt32_to_cpu(intr[0])); + if (icells == 3) { + irq = intr[1]; + if (intr[0] == 0) + irq += 32; /* SPI */ + else + irq += 16; /* PPI */ + } else + irq = intr[0]; - return (interrupt); + return (irq); } #endif -#endif Modified: projects/arm64/sys/dev/fdt/simplebus.c ============================================================================== --- projects/arm64/sys/dev/fdt/simplebus.c Wed Aug 13 12:04:45 2014 (r269926) +++ projects/arm64/sys/dev/fdt/simplebus.c Wed Aug 13 12:31:36 2014 (r269927) @@ -310,18 +310,10 @@ 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, irq, - irq, 1); + resource_list_add(&ndi->rl, SYS_RES_IRQ, k, intr[i], + intr[i], 1); } free(intr, M_OFWPROP); }