From patchwork Mon Aug 7 16:01:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 9885745 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C4FDA60363 for ; Mon, 7 Aug 2017 16:04:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFF81262AE for ; Mon, 7 Aug 2017 16:04:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4818274A3; Mon, 7 Aug 2017 16:04:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 826AF262AE for ; Mon, 7 Aug 2017 16:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbdHGQCE (ORCPT ); Mon, 7 Aug 2017 12:02:04 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:16498 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751904AbdHGQCB (ORCPT ); Mon, 7 Aug 2017 12:02:01 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v77G1uE6016524; Mon, 7 Aug 2017 11:01:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1502121716; bh=KlQ2DkNZuLGF3ZZozeLFRY2s2NP24+Z+pQkBe64fzJY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=j8dnsDLHC1adByzgisLcYWwivKAgmoKc7tXJDXo6/wgrbldSIzNKDL9eAfxDERZ+J jUkPQIkNDY8JsUUSEfJXF0kBztJ0/u5Kc8ZT6B7KswvCcGnf6tLHYPiRs9rnWJYcEa 37IYgxSf682tVjpEkZYWYXn3TvOqgyxVbHTOSX5M= Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v77G1uB3007450; Mon, 7 Aug 2017 11:01:56 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Mon, 7 Aug 2017 11:01:55 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v77G1jGs023497; Mon, 7 Aug 2017 11:01:53 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Tony Lindgren , Rob Herring , Adrian Hunter CC: , , , , , Subject: [RFC PATCH 2/7] mmc: sdhci: Add quirk to indicate controller supports ADMA2 Date: Mon, 7 Aug 2017 21:31:37 +0530 Message-ID: <20170807160142.12134-3-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170807160142.12134-1-kishon@ti.com> References: <20170807160142.12134-1-kishon@ti.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP TI's implementation of sdhci controller used in DRA7 SoC's doesn't have SDHCI_CAN_DO_ADMA2 set in CAPA register though it supports ADMA2. Add quirk to support using ADMA2 even if the controller reports incorrect capability in CAPA. Signed-off-by: Kishon Vijay Abraham I --- drivers/mmc/host/sdhci.c | 3 ++- drivers/mmc/host/sdhci.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index ece3751d2a25..fff0baadbc3e 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3264,7 +3264,8 @@ int sdhci_setup_host(struct sdhci_host *host) } if ((host->version >= SDHCI_SPEC_200) && - (host->caps & SDHCI_CAN_DO_ADMA2)) + ((host->caps & SDHCI_CAN_DO_ADMA2) || + (host->quirks2 & SDHCI_QUIRK2_FORCE_ADMA))) host->flags |= SDHCI_USE_ADMA; if ((host->quirks & SDHCI_QUIRK_BROKEN_ADMA) && diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 6905131f603d..d778034e324d 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -437,6 +437,8 @@ struct sdhci_host { #define SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN (1<<15) /* Controller does not have CRC stripped in Command Response */ #define SDHCI_QUIRK2_NO_CRC_STRIPPING (1<<16) +/* Controller has bad caps bits, but really supports DMA */ +#define SDHCI_QUIRK2_FORCE_ADMA (1<<17) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */