From owner-svn-src-all@freebsd.org Mon Apr 4 09:41:23 2016 Return-Path: Delivered-To: svn-src-all@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 A0908B011A1; Mon, 4 Apr 2016 09:41:23 +0000 (UTC) (envelope-from skra@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 55FD51B11; Mon, 4 Apr 2016 09:41:23 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u349fMNt005172; Mon, 4 Apr 2016 09:41:22 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u349fMJa005170; Mon, 4 Apr 2016 09:41:22 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201604040941.u349fMJa005170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Mon, 4 Apr 2016 09:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297545 - in head/sys: arm/broadcom/bcm2835 boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 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, 04 Apr 2016 09:41:23 -0000 Author: skra Date: Mon Apr 4 09:41:22 2016 New Revision: 297545 URL: https://svnweb.freebsd.org/changeset/base/297545 Log: Define local-intc for BCM2836 platform (RPI2) and make BCM2835 intc a child of it. This is done in conformity with Linux dts files and as preparation for rework of BCM2836 interrupt controller for INTRNG. Reviewed by: gonzo Differential Revision: https://reviews.freebsd.org/D5807 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_common.c head/sys/boot/fdt/dts/arm/bcm2836.dtsi Modified: head/sys/arm/broadcom/bcm2835/bcm2835_common.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_common.c Mon Apr 4 09:36:56 2016 (r297544) +++ head/sys/arm/broadcom/bcm2835/bcm2835_common.c Mon Apr 4 09:41:22 2016 (r297545) @@ -56,14 +56,21 @@ fdt_intc_decode_ic(phandle_t node, pcell int *pol) { - if (!fdt_is_compatible(node, "broadcom,bcm2835-armctrl-ic")) - return (ENXIO); - - *interrupt = fdt32_to_cpu(intr[0]); - *trig = INTR_TRIGGER_CONFORM; - *pol = INTR_POLARITY_CONFORM; - - return (0); + if (fdt_is_compatible(node, "broadcom,bcm2835-armctrl-ic")) { + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + return (0); + } +#ifdef SOC_BCM2836 + if (fdt_is_compatible(node, "brcm,bcm2836-l1-intc")) { + *interrupt = fdt32_to_cpu(intr[0]) + 72; + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + return (0); + } +#endif + return (ENXIO); } Modified: head/sys/boot/fdt/dts/arm/bcm2836.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/bcm2836.dtsi Mon Apr 4 09:36:56 2016 (r297544) +++ head/sys/boot/fdt/dts/arm/bcm2836.dtsi Mon Apr 4 09:41:22 2016 (r297545) @@ -32,8 +32,8 @@ timer { compatible = "arm,armv7-timer"; clock-frequency = <19200000>; - interrupts = <72 73 75 74>; - interrupt-parent = <&intc>; + interrupts = <0 1 3 2>; + interrupt-parent = <&local_intc>; }; SOC: axi { @@ -41,12 +41,23 @@ #address-cells = <1>; #size-cells = <1>; reg = <0x3f000000 0x01000000>; - ranges = <0 0x3f000000 0x01000000>; + ranges = <0 0x3f000000 0x01000000>, + <0x40000000 0x40000000 0x00001000>; + + local_intc: local_intc { + compatible = "brcm,bcm2836-l1-intc"; + reg = <0x40000000 0x100>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&local_intc>; + }; intc: interrupt-controller { compatible = "broadcom,bcm2835-armctrl-ic", "broadcom,bcm2708-armctrl-ic"; reg = <0xB200 0x200>; + interrupt-parent = <&local_intc>; + interrupts = <8>; interrupt-controller; #interrupt-cells = <1>;