From patchwork Mon Dec 15 02:28:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5489861 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CE6C89F456 for ; Mon, 15 Dec 2014 02:28:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04C7820A01 for ; Mon, 15 Dec 2014 02:28:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1723D20A0A for ; Mon, 15 Dec 2014 02:28:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751068AbaLOC2K (ORCPT ); Sun, 14 Dec 2014 21:28:10 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:53741 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751037AbaLOC2J (ORCPT ); Sun, 14 Dec 2014 21:28:09 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 15 Dec 2014 11:28:08 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id A68323B2F2; Mon, 15 Dec 2014 11:28:08 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 9016C2806E; Mon, 15 Dec 2014 11:28:08 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 823DD2806D; Mon, 15 Dec 2014 11:28:08 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id MBD11618; Mon, 15 Dec 2014 11:28:08 +0900 X-IronPort-AV: E=Sophos;i="5.07,577,1413212400"; d="scan'208";a="176807983" Received: from mail-sg1lp0094.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.94]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Dec 2014 11:28:07 +0900 Received: from remon.renesas.com (211.11.155.132) by SINPR06MB172.apcprd06.prod.outlook.com (10.242.57.21) with Microsoft SMTP Server (TLS) id 15.1.31.17; Mon, 15 Dec 2014 02:28:05 +0000 Message-ID: <87bnn5ve7t.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/7] mmc: tmio: enable SoC specific DMA buswidth settings User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Ulf Hansson , Chris Ball CC: Simon , Linux-SH , linux-mmc In-Reply-To: <87egs1ve96.wl%kuninori.morimoto.gx@renesas.com> References: <87egs1ve96.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Date: Mon, 15 Dec 2014 02:28:05 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: SINPR01CA0052.apcprd01.prod.exchangelabs.com (10.141.109.52) To SINPR06MB172.apcprd06.prod.outlook.com (10.242.57.21) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB172; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601003); SRVR:SINPR06MB172; X-Forefront-PRVS: 04267075BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(81156004)(86362001)(77096005)(31966008)(77156002)(53416004)(46406003)(50466002)(42186005)(33646002)(575784001)(106356001)(46102003)(21056001)(120916001)(107046002)(19580405001)(101416001)(97736003)(87976001)(229853001)(64706001)(36756003)(20776003)(122386002)(105586002)(66066001)(62966003)(19580395003)(47776003)(76176999)(69596002)(23726002)(40100003)(92566001)(54356999)(4396001)(68736005)(99396003)(50986999)(83506001); DIR:OUT; SFP:1102; SCL:1; SRVR:SINPR06MB172; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB172; X-OriginatorOrg: renesas.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Kuninori Morimoto Renesas SDHI which is based on TMIO driver has 2 type SoC. 1st one is used as SH-Mobile series, and 2nd is R-Car series. R-Car series SoC has DMA buswidth setting register which enables 32bit access. This patch adds .dma_buswidth and enables it. Signed-off-by: Kuninori Morimoto --- drivers/mmc/host/tmio_mmc_dma.c | 8 ++++++-- include/linux/mfd/tmio.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c index f0bf6df..be82257 100644 --- a/drivers/mmc/host/tmio_mmc_dma.c +++ b/drivers/mmc/host/tmio_mmc_dma.c @@ -295,7 +295,9 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat cfg.slave_id = pdata->dma->slave_id_tx; cfg.direction = DMA_MEM_TO_DEV; cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->pdata->bus_shift); - cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + cfg.dst_addr_width = host->pdata->dma_buswidth; + if (!cfg.dst_addr_width) + cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; cfg.src_addr = 0; ret = dmaengine_slave_config(host->chan_tx, &cfg); if (ret < 0) @@ -314,7 +316,9 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat cfg.slave_id = pdata->dma->slave_id_rx; cfg.direction = DMA_DEV_TO_MEM; cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset; - cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + cfg.src_addr_width = host->pdata->dma_buswidth; + if (!cfg.src_addr_width) + cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; cfg.dst_addr = 0; ret = dmaengine_slave_config(host->chan_rx, &cfg); if (ret < 0) diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 6788f9b..85bd65b 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h @@ -2,6 +2,7 @@ #define MFD_TMIO_H #include +#include #include #include #include @@ -133,6 +134,7 @@ struct tmio_mmc_data { unsigned long capabilities2; unsigned long flags; unsigned long bus_shift; + enum dma_slave_buswidth dma_buswidth; u32 ocr_mask; /* available voltages */ struct tmio_mmc_dma *dma; struct device *dev;