From patchwork Tue Jan 13 04:59:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5617811 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3CA719F9E8 for ; Tue, 13 Jan 2015 04:59:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F7CC205F9 for ; Tue, 13 Jan 2015 04:59:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 843C1205F7 for ; Tue, 13 Jan 2015 04:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751434AbbAME7T (ORCPT ); Mon, 12 Jan 2015 23:59:19 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:43795 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751415AbbAME7S (ORCPT ); Mon, 12 Jan 2015 23:59:18 -0500 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie2.idc.renesas.com with ESMTP; 13 Jan 2015 13:59:17 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 3CE9849FCD; Tue, 13 Jan 2015 13:59:17 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 1ED812806E; Tue, 13 Jan 2015 13:59:17 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 199442806D; Tue, 13 Jan 2015 13:59:17 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id PAE04620; Tue, 13 Jan 2015 13:59:17 +0900 X-IronPort-AV: E=Sophos;i="5.07,747,1413212400"; d="scan'208";a="177445243" Received: from mail-hk1lp0121.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.121]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 13 Jan 2015 13:59:16 +0900 Received: from remon.renesas.com (211.11.155.132) by HKNPR06MB161.apcprd06.prod.outlook.com (10.242.104.16) with Microsoft SMTP Server (TLS) id 15.1.53.17; Tue, 13 Jan 2015 04:59:14 +0000 Message-ID: <87egqzuvg4.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 11/17] mmc: tmio: enable SoC specific DMA buswidth settings User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Ulf Hansson CC: Arnd Bergmann , Chris Ball , Simon , Linux-SH , linux-mmc In-Reply-To: <87twzvuvl1.wl%kuninori.morimoto.gx@renesas.com> References: <87twzvuvl1.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Date: Tue, 13 Jan 2015 04:59:14 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: HKXPR02CA0033.apcprd02.prod.outlook.com (25.161.48.18) To HKNPR06MB161.apcprd06.prod.outlook.com (10.242.104.16) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; X-DmarcAction-Test: None X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(3005003);SRVR:HKNPR06MB161; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:HKNPR06MB161; X-Forefront-PRVS: 045584D28C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(42186005)(64706001)(62966003)(77156002)(86362001)(92566002)(87976001)(83506001)(2950100001)(66066001)(68736005)(77096005)(47776003)(105586002)(101416001)(97736003)(50986999)(122386002)(76176999)(81156004)(33646002)(36756003)(106356001)(19580395003)(19580405001)(53416004)(69596002)(50466002)(46406003)(23726002)(54356999)(110136001)(40100003)(229853001)(46102003); DIR:OUT; SFP:1102; SCL:1; SRVR:HKNPR06MB161; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKNPR06MB161; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2015 04:59:14.9954 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKNPR06MB161 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.h | 2 ++ drivers/mmc/host/tmio_mmc_dma.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index 0699edb..fc3805e 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -16,6 +16,7 @@ #ifndef TMIO_MMC_H #define TMIO_MMC_H +#include #include #include #include @@ -46,6 +47,7 @@ struct tmio_mmc_dma { void *chan_priv_rx; int slave_id_tx; int slave_id_rx; + enum dma_slave_buswidth dma_buswidth; bool (*filter)(struct dma_chan *chan, void *arg); void (*enable)(struct tmio_mmc_host *host, bool enable); }; diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c index eb6b45c..aa5f4b6 100644 --- a/drivers/mmc/host/tmio_mmc_dma.c +++ b/drivers/mmc/host/tmio_mmc_dma.c @@ -293,7 +293,9 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat cfg.slave_id = host->dma->slave_id_tx; cfg.direction = DMA_MEM_TO_DEV; cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift); - cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + cfg.dst_addr_width = host->dma->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) @@ -312,7 +314,9 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat cfg.slave_id = host->dma->slave_id_rx; cfg.direction = DMA_DEV_TO_MEM; cfg.src_addr = cfg.dst_addr + host->pdata->dma_rx_offset; - cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; + cfg.src_addr_width = host->dma->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)