From patchwork Mon Jul 22 13:16:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2831480 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 528D4C0319 for ; Mon, 22 Jul 2013 16:17:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C269202BA for ; Mon, 22 Jul 2013 16:17:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 11F2C202B9 for ; Mon, 22 Jul 2013 16:17:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933004Ab3GVQRN (ORCPT ); Mon, 22 Jul 2013 12:17:13 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:58516 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932998Ab3GVQRL (ORCPT ); Mon, 22 Jul 2013 12:17:11 -0400 Received: from axis700.grange (dslb-178-009-251-173.pools.arcor-ip.net [178.9.251.173]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MQdCf-1UXI1g32th-00U6WK; Mon, 22 Jul 2013 18:17:10 +0200 Received: from 6a.grange (unknown [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 2120B40BCC; Mon, 22 Jul 2013 15:16:22 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1V1FyP-0001NY-TC; Mon, 22 Jul 2013 15:16:21 +0200 From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org Cc: Magnus Damm , Simon Horman , Guennadi Liakhovetski Subject: [PATCH 5/6] ARM: shmobile: sh73a0: add support for the DMA0 controller in DT Date: Mon, 22 Jul 2013 15:16:20 +0200 Message-Id: <1374498981-5263-6-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1374498981-5263-1-git-send-email-g.liakhovetski@gmx.de> References: <1374498981-5263-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:G4E6fXgFFAupJqGCxB9rPXHw/8aJMlT4u7p5LQfthnd LcGjnCwRTMdmhGY0gCKPinCU2sxHNMzhh0vX7+PuXo3risZ6Lx a2J4O+hzVcpHGwYzcIPLNp4CSsfGuR2z1z0Zl9ei3hg7Mc1eDN edffHB9IkJbodEYi8I3jwQUNQOj+PxKWVw5h7Ed7ZO0Rqfz52b yjMbJ5ZJ68jTfrjqPbDGxCtpPV0CF8T/3+vgkRoBlBAUZu9Ito MLWBT/FjpYr9Gra2KcUUl6A/2v25LpxpYiuDOZ9Asv8Iya3LiZ rAyLoGbjHXOw9UDagvdgAldM1cih67ROpsSGjPsxWUyhRvANLq vyq8z6eQR+JgchvABzux8uSLz/ZPjDJgu8EmIheBmoc6WqbLN3 337gmZXgCkMZQ== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a Device Tree node for the DMA0 controller on sh73a0 and a clock alias. To enable the DMA0 controller it also has to be taken out of reset. Signed-off-by: Guennadi Liakhovetski --- arch/arm/boot/dts/sh73a0.dtsi | 43 +++++++++++++++++++++++++++++++++ arch/arm/mach-shmobile/clock-sh73a0.c | 1 + arch/arm/mach-shmobile/setup-sh73a0.c | 3 ++ 3 files changed, 47 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi index 86e79fe..5016c93 100644 --- a/arch/arm/boot/dts/sh73a0.dtsi +++ b/arch/arm/boot/dts/sh73a0.dtsi @@ -119,6 +119,49 @@ 0 32 0x4>; }; + dmac: dma-multiplexer@0 { + compatible = "renesas,shdma-mux"; + #dma-cells = <1>; + dma-channels = <20>; + dma-requests = <256>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + dma0: dma-controller@fe000020 { + compatible = "renesas,shdma-sh73a0"; + reg = <0xfe000020 0x89e0>; + interrupt-parent = <&gic>; + interrupts = <0 129 4 + 0 109 4 + 0 110 4 + 0 111 4 + 0 112 4 + 0 113 4 + 0 114 4 + 0 115 4 + 0 116 4 + 0 117 4 + 0 118 4 + 0 119 4 + 0 120 4 + 0 121 4 + 0 122 4 + 0 123 4 + 0 124 4 + 0 125 4 + 0 126 4 + 0 127 4 + 0 128 4>; + interrupt-names = "error", + "ch0", "ch1", "ch2", "ch3", + "ch4", "ch5", "ch6", "ch7", + "ch8", "ch9", "ch10", "ch11", + "ch12", "ch13", "ch14", "ch15", + "ch16", "ch17", "ch18", "ch19"; + }; + }; + i2c0: i2c@e6820000 { #address-cells = <1>; #size-cells = <0>; diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 04a32fc..28a5e02 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c @@ -645,6 +645,7 @@ static struct clk_lookup lookups[] = { CLKDEV_DEV_ID("e6820000.i2c", &mstp_clks[MSTP116]), /* I2C0 */ CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ + CLKDEV_DEV_ID("fe000020.dma-controller", &mstp_clks[MSTP218]), /* SY-DMAC */ CLKDEV_DEV_ID("shdma-sh73a0.0", &mstp_clks[MSTP218]), /* SY-DMAC */ CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* MP-DMAC */ CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index 2e9f3cc..a83bdd4 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c @@ -771,6 +771,9 @@ void __init sh73a0_add_standard_devices_dt(void) /* clocks are setup late during boot in the case of DT */ sh73a0_clock_init(); + /* Clear software reset bit on SY-DMAC module */ + __raw_writel(__raw_readl(SRCR2) & ~(1 << 18), SRCR2); + platform_add_devices(sh73a0_devices_dt, ARRAY_SIZE(sh73a0_devices_dt)); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);