From patchwork Tue Jul 22 05:34:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4599671 Return-Path: X-Original-To: patchwork-linux-sh@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 58BDE9F375 for ; Tue, 22 Jul 2014 05:34:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7CA5620123 for ; Tue, 22 Jul 2014 05:34:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A020E20120 for ; Tue, 22 Jul 2014 05:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752182AbaGVFef (ORCPT ); Tue, 22 Jul 2014 01:34:35 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:61695 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751442AbaGVFee (ORCPT ); Tue, 22 Jul 2014 01:34:34 -0400 Received: by mail-pa0-f41.google.com with SMTP id rd3so10797974pab.0 for ; Mon, 21 Jul 2014 22:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:to:cc:in-reply-to:references:from:subject :user-agent:mime-version:content-type; bh=9skW1n4NY/RZtdIo3x+0ggYFFWmIXe0uIqdrTgMW6Pw=; b=nIN/Lghwb8naYXUuykQQGKM7/fWfHDdxrbmyTjB1f5Z7bEbyBIVbrpDrDkA5BqQ64r 4DqRhprzrHILAQnpDJ9ynYiDFoJ1V3/pA6P3Z0Y1D5Q2d7gHnlGZ9yeMtfKEP4xLUuNF UJ9aRBf0d36/rSUYnxLlXRVPEga2ml1mT5FhZJnJU/knnzn9WBatImwGxncLTQuJbQ9M Tuwx991ZE19KAglqasF+163G5s9/n+2s/ufonBOOaLYM30xpgCEQ1wVJxjirPySuCCOq YfjCwdDv7FLl+mDtefxm2CCwLNj/MXs8LetQ2LwuF0idvq8v04USc6nTbvJGvxVRH620 Akug== X-Received: by 10.68.134.198 with SMTP id pm6mr30564283pbb.9.1406007274167; Mon, 21 Jul 2014 22:34:34 -0700 (PDT) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id kh7sm65519801pad.8.2014.07.21.22.34.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 21 Jul 2014 22:34:33 -0700 (PDT) Date: Mon, 21 Jul 2014 22:34:33 -0700 (PDT) Message-ID: <877g36hs7s.wl%kuninori.morimoto.gx@renesas.com> To: Simon , Ian Molton , Chris Ball Cc: TOSHIAKI KOMATSU , NAOYA SHIIBA , Magnus , Linux-SH , (Renesas) goda , linux-mmc@vger.kernel.org, ryo.kataoka.wt@renesas.com, shinobu.uehara.xc@renesas.com, kouei.abe.cp@renesas.com In-Reply-To: <87egxehsec.wl%kuninori.morimoto.gx@gmail.com> References: <87simtenpi.wl%kuninori.morimoto.gx@renesas.com> <87pphxe2q0.wl%kuninori.morimoto.gx@renesas.com> <53AD638C.5060907@renesas.com> <87egxehsec.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto Subject: [PATCH 05/10] mmc: tmio: control multiple block transfer mode User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 From: Shinobu Uehara Renesas SDHI has "Multiple Block Transfer Mode" settings on SD_CMD register which controls CMD12 automatically. This patch cares it, because CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED) [Kuninori Morimoto: tidyuped for upstreaming enabled this flags for all SH-Mobile/R-Car] Signed-off-by: Shinobu Uehara Signed-off-by: Kuninori Morimoto --- drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_pio.c | 10 ++++++++++ include/linux/mfd/tmio.h | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index c53bd2f..7b9c816 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -226,6 +226,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) */ mmc_data->flags |= TMIO_MMC_SDIO_IRQ; + /* + * All SDHI have CMD12 controll bit + */ + mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL; + if (of_id && of_id->data) { const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags; diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index c3b1b4e..1f1fdfb 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work) #define TRANSFER_READ 0x1000 #define TRANSFER_MULTI 0x2000 #define SECURITY_CMD 0x4000 +#define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd) { @@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command if (data->blocks > 1) { sd_ctrl_write16(host, CTL_STOP_INTERNAL_ACTION, 0x100); c |= TRANSFER_MULTI; + + /* + * Disable auto CMD12 at IO_RW_EXTENDED when + * multiple block transfer + */ + if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) && + (cmd->opcode == SD_IO_RW_EXTENDED)) + c |= NO_CMD12_ISSUE; } if (data->flags & MMC_DATA_READ) c |= TRANSFER_READ; diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 777e29b..7432d95 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h @@ -83,6 +83,12 @@ */ #define TMIO_MMC_HAVE_HIGH_REG (1 << 6) +/* + * Some controllers have CMD12 automatically + * issue/non-issue register + */ +#define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) + int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);