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: 145001 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1065536ljw; Fri, 24 Aug 2018 02:21:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaOkRsCjzg8r6jzWXOeGIX99cmZbHvcRblX8oytvzI93L29AvTN2sixRSeulF1HFpcGcgJB X-Received: by 2002:a63:4207:: with SMTP id p7-v6mr879282pga.201.1535102509726; Fri, 24 Aug 2018 02:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535102509; cv=none; d=google.com; s=arc-20160816; b=WuTGSvi/5r160jvvDPZtxpCF6qTI3+A1uGMcBbpEQFoJcCiv3kgOmtFbjZ4s7qZ01M 0UwgGRrNwRyoMv5YJFldEpI7nUcoDKSZh5WnQule1NWu5jPYkpFPjFS4WWdAPyVnqX0Q rcomHIWFv2HExWzyYlwPfwg/YG8jjR1h6FGX1bNMBt9ZiEUd2wdWXfnxbcS0ZjDzuW2s vBplOBCvHEgKJmOjqzTfiIRhvCOCMHILpHmoGEFqk0a7h8ydC1m4nbN1XHq9kcnpEWGY +WJ7rNtyi3HeiMgx/P8Fire9dlRCXdXZ3hhRIFxLbNatUyiaga0UKPSUNKHMprvySpnP 47tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=F8ycUMm5cEF7zHqTC/mFHa7ECSePE1v/XI0xbfy/QLA=; b=OuQgF7LF74BWGQPmaBwoBBeq32gYJQ443XIiMz3e1/2H04Yh89ojroPSXlw/HSQHLo ELYltb0DJryvVK2Gk2qhrBV17odhXMXbpT36WDQ0D/V+cn7d9CP+Y79ZCl4XxZspihD9 eAQyKuSC59y/BUHIf2wSJAAj0qwgW5YV5KDCuL2O/gx/OrHvvn3QJL1v4HFOksnqrzv0 QSp3G3ZsgvGoB+2Vw0ahAfWTNiFdD4/a58Ycp7zkcZv0pHy0Yvx3RDvy/5ywBTcGsLEE i3+NMFwF9P0LDI15K48tmrMn+fWEq7PEty3XMoYuM/nVMnNAHtg+NdJ5JyGzesZCc89K 4JqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z7qPe3TH; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay10-v6si6389276plb.293.2018.08.24.02.21.49; Fri, 24 Aug 2018 02:21:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z7qPe3TH; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727524AbeHXMze (ORCPT + 5 others); 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-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 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(-) -- 2.7.4 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");