From patchwork Fri Aug 24 09:20:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 10574945 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39A9B14BD for ; Fri, 24 Aug 2018 09:21:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 294362C1C8 for ; Fri, 24 Aug 2018 09:21:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D9982C767; Fri, 24 Aug 2018 09:21:50 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 BF2392C1C8 for ; Fri, 24 Aug 2018 09:21:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727524AbeHXMze (ORCPT ); Fri, 24 Aug 2018 08:55:34 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37187 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727252AbeHXMzd (ORCPT ); Fri, 24 Aug 2018 08:55:33 -0400 Received: by mail-pf1-f194.google.com with SMTP id h69-v6so4270238pfd.4 for ; Fri, 24 Aug 2018 02:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=F8ycUMm5cEF7zHqTC/mFHa7ECSePE1v/XI0xbfy/QLA=; b=Z7qPe3THEZioTqfmBT0VRxkEuJMLizX/DerVHLOSNrZCI2MSmODuw9sjtk9OfJ9+Fl D/qHOUKLUXODKZ8UbB/cFmv8tgDt7hNumQhM5lErvlyvQQ22+27KkijbhMKYB4B20VXc GgTu5PWE3jdRUwaT4fezdVhVpGHqKJbGnQQyA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=F8ycUMm5cEF7zHqTC/mFHa7ECSePE1v/XI0xbfy/QLA=; b=FGG1gDIrza266gG/46HQvfHcy6t4028r7iYFwdLx8ppB84RS3Fw3o1IePbPLLE1XJ4 i4rTZh4o4+bthSvJ2XVccqr8eENkFfIlg1m0N0qiY1Oa3SHfTSYIFinvpbPAJMrJAXHJ J2YNPI7AXkZAheDJSkSUIBddxdtRu74OZWst0REkY0hycoLLpLrh1BBLzA4wxQBMzjSg o4LKo3UHaGXcVW+RUWjLBZ74mv9/L2ddMbPL0iHITaKc5U3aOMzi4CkVtOJM3hk/NLVd uqO4V4uEnEGSXTw+tj6ujZjK0pHJuW8LUoTy02dpdeRceEUA07pRviDhmI68L3Ld6rEI MasA== X-Gm-Message-State: APzg51BELG+AwQyt07wBKavaSWm+Qi+sao6yDartYfEstlIC7oYq77+p JhAF5kmxfsqI8hAQv1OmBnCJoA== X-Google-Smtp-Source: ANB0VdZQK18eQxcC5TdU8bmpkHXvDCIIgQiAo0FSgNjWKd2BO8gCP/G/QX5blZg1G9R27WfktzIQgA== X-Received: by 2002:a63:1c07:: with SMTP id c7-v6mr888654pgc.109.1535102507976; Fri, 24 Aug 2018 02:21:47 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id g6-v6sm9520314pfb.11.2018.08.24.02.21.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 02:21:47 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Orson Zhai , Baolin Wang , Billows Wu , Jason Wu , Chunyan Zhang , Chunyan Zhang Subject: [PATCH V6 7/9] mmc: sdhci: SDMA may use Auto-CMD23 in v4 mode Date: Fri, 24 Aug 2018 17:20:26 +0800 Message-Id: <1535102428-20332-8-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535102428-20332-1-git-send-email-zhang.chunyan@linaro.org> References: <1535102428-20332-1-git-send-email-zhang.chunyan@linaro.org> 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 When Host Version 4 Enable is set to 1, SDMA uses ADMA System Address register (05Fh-058h) instead of using register (000h-004h) to indicate its system address of data location. The register (000h-004h) is re-assigned to 32-bit Block Count and Auto CMD23 argument, so then SDMA may use Auto CMD23. Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 7e01601..1cb55f2 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3828,10 +3828,14 @@ int sdhci_setup_host(struct sdhci_host *host) if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) host->flags |= SDHCI_AUTO_CMD12; - /* Auto-CMD23 stuff only works in ADMA or PIO. */ + /* + * For v3 mode, Auto-CMD23 stuff only works in ADMA or PIO; + * For v4 mode, SDMA may use Auto-CMD23 as well. + */ if ((host->version >= SDHCI_SPEC_300) && ((host->flags & SDHCI_USE_ADMA) || - !(host->flags & SDHCI_USE_SDMA)) && + (!host->v4_mode && !(host->flags & SDHCI_USE_SDMA)) || + (host->v4_mode && (host->flags & SDHCI_USE_SDMA))) && !(host->quirks2 & SDHCI_QUIRK2_ACMD23_BROKEN)) { host->flags |= SDHCI_AUTO_CMD23; DBG("Auto-CMD23 available\n");