From patchwork Fri Jul 12 15:26:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerhard Sittig X-Patchwork-Id: 258769 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id E6A882C0AD4 for ; Sat, 13 Jul 2013 01:32:30 +1000 (EST) Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0F3D02C0410; Sat, 13 Jul 2013 01:27:53 +1000 (EST) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3bsJ1249fxz3hhbQ; Fri, 12 Jul 2013 17:27:50 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3bsJ123nYQzbbrg; Fri, 12 Jul 2013 17:27:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id vzHj7Y6ts-T3; Fri, 12 Jul 2013 17:27:49 +0200 (CEST) X-Auth-Info: 2KHW63nQ6afYiPMNOnRpT7sWefIakaU1PwfpdthTeuI= Received: from localhost (kons-4d03eed5.pool.mediaWays.net [77.3.238.213]) by mail.mnet-online.de (Postfix) with ESMTPA; Fri, 12 Jul 2013 17:27:49 +0200 (CEST) From: Gerhard Sittig To: linuxppc-dev@lists.ozlabs.org, devicetree-discuss@lists.ozlabs.org, Alexander Popov Subject: [PATCH RFC 5/8] dma: mpc512x: use symbolic specifiers for DMA channels Date: Fri, 12 Jul 2013 17:26:18 +0200 Message-Id: <1373642781-32631-6-git-send-email-gsi@denx.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1373642781-32631-1-git-send-email-gsi@denx.de> References: <1373642781-32631-1-git-send-email-gsi@denx.de> Cc: Lars-Peter Clausen , Arnd Bergmann , Vinod Koul , Gerhard Sittig , Dan Williams , Anatolij Gustschin X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" for the DMA controller of the MPC512x SoC, DMA channels directly correspond to specific peripherals, since requester lines directly map to channels while no additional flexibility or mapping is involved introduce a dt-bindings header file for MPC512x DMA channels, and make the shared DT specs in the mpc5121.dtsi as well as the DMA engine driver use those names instead of numbers Signed-off-by: Gerhard Sittig --- arch/powerpc/boot/dts/mpc5121.dtsi | 6 +++++- drivers/dma/mpc512x_dma.c | 6 ++++-- include/dt-bindings/dma/mpc512x-dma.h | 21 +++++++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 include/dt-bindings/dma/mpc512x-dma.h diff --git a/arch/powerpc/boot/dts/mpc5121.dtsi b/arch/powerpc/boot/dts/mpc5121.dtsi index bd14c00..384e692 100644 --- a/arch/powerpc/boot/dts/mpc5121.dtsi +++ b/arch/powerpc/boot/dts/mpc5121.dtsi @@ -9,6 +9,8 @@ * option) any later version. */ +#include + /dts-v1/; / { @@ -152,7 +154,7 @@ compatible = "fsl,mpc5121-sdhc"; reg = <0x1500 0x100>; interrupts = <8 0x8>; - dmas = <&dma0 30>; + dmas = <&dma0 MPC512x_DMACHAN_SDHC>; dma-names = "rx-tx"; }; @@ -262,6 +264,8 @@ lpc@10000 { compatible = "fsl,mpc5121-lpc"; reg = <0x10000 0x200>; + dmas = <&dma0 MPC512x_DMACHAN_SCLPC>; + dma-names = "rx-tx"; }; pata@10200 { diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c index 0053ff8..8f6d545 100644 --- a/drivers/dma/mpc512x_dma.c +++ b/drivers/dma/mpc512x_dma.c @@ -29,6 +29,8 @@ * file called COPYING. */ +#include + #include #include #include @@ -257,7 +259,7 @@ static void mpc_dma_execute(struct mpc_dma_chan *mchan) prev->tcd->dlast_sga = mdesc->tcd_paddr; prev->tcd->e_sg = 1; /* only start explicitly on MDDRC channel */ - if (cid == 32) + if (cid == MPC512x_DMACHAN_MDDRC) mdesc->tcd->start = 1; prev = mdesc; @@ -276,7 +278,7 @@ static void mpc_dma_execute(struct mpc_dma_chan *mchan) /* peripherals involved, use external request */ out_8(&mdma->regs->dmaserq, cid); break; - case 32: + case MPC512x_DMACHAN_MDDRC: /* memory transfer, software provided start signal */ out_8(&mdma->regs->dmassrt, cid); break; diff --git a/include/dt-bindings/dma/mpc512x-dma.h b/include/dt-bindings/dma/mpc512x-dma.h new file mode 100644 index 0000000..56b06d1 --- /dev/null +++ b/include/dt-bindings/dma/mpc512x-dma.h @@ -0,0 +1,21 @@ +/* + * This header file provides symbolic specifiers for DMA channels + * within the MPC512x SoC's DMA controller. Since requester lines + * directly map to channel numbers and no additional flexibility + * is involved, DMA channels can be considered directly associated + * with individual peripherals. + * + * This header file gets shared among DT bindings which provide + * hardware specs, and driver code which implements supporting logic. + */ + +#ifndef _DT_BINDINGS_DMA_MPC512x_DMA_H +#define _DT_BINDINGS_DMA_MPC512x_DMA_H + +#define MPC512x_DMACHAN_SCLPC 26 +#define MPC512x_DMACHAN_SDHC 30 +#define MPC512x_DMACHAN_MDDRC 32 + +#define MPC512x_DMACHAN_MAX 64 + +#endif