From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751208AbdH1IEI (ORCPT ); Mon, 28 Aug 2017 04:04:08 -0400 Received: from mga07.intel.com ([134.134.136.100]:31148 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750830AbdH1IEH (ORCPT ); Mon, 28 Aug 2017 04:04:07 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,440,1498546800"; d="scan'208";a="1211307012" Subject: Re: [PATCH 2/5] mmc: sdhci: Add quirk to indicate MMC_RSP_136 has CRC To: Kishon Vijay Abraham I , Ulf Hansson Cc: Rob Herring , Tony Lindgren , Sekhar Nori , Russell King , Ravikumar Kattekola , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20170821074132.4622-1-kishon@ti.com> <20170821074132.4622-3-kishon@ti.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <24fa9713-1367-08d7-54b6-b853e32fd6aa@intel.com> Date: Mon, 28 Aug 2017 10:57:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170821074132.4622-3-kishon@ti.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/08/17 10:41, Kishon Vijay Abraham I wrote: > TI's implementation of sdhci controller used in DRA7 SoC's has > CRC in responses with length 136 bits. Add quirk to indicate > the controller has CRC in MMC_RSP_136. If this quirk is > set sdhci library shouldn't shift the response present in > SDHCI_RESPONSE register. > > Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci.c | 3 +++ > drivers/mmc/host/sdhci.h | 2 ++ > 2 files changed, 5 insertions(+) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index ba639b7851cb..9c8d7428df3c 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -1182,6 +1182,9 @@ static void sdhci_read_rsp_136(struct sdhci_host *host, struct mmc_command *cmd) > cmd->resp[i] = sdhci_readl(host, reg); > } > > + if (host->quirks2 & SDHCI_QUIRK2_RSP_136_HAS_CRC) > + return; > + > /* CRC is stripped so we need to do some shifting */ > for (i = 0; i < 4; i++) { > cmd->resp[i] <<= 8; > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h > index 399edc681623..54bc444c317f 100644 > --- a/drivers/mmc/host/sdhci.h > +++ b/drivers/mmc/host/sdhci.h > @@ -435,6 +435,8 @@ struct sdhci_host { > #define SDHCI_QUIRK2_ACMD23_BROKEN (1<<14) > /* Broken Clock divider zero in controller */ > #define SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN (1<<15) > +/* Controller has CRC in 136 bit Command Response */ > +#define SDHCI_QUIRK2_RSP_136_HAS_CRC (1<<16) > > int irq; /* Device IRQ */ > void __iomem *ioaddr; /* Mapped address */ >