From patchwork Thu Aug 16 07:54:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 144333 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1760698ljj; Thu, 16 Aug 2018 00:55:54 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyxL4GFWAQSOvpz5Wtngtca/cW5aRYMFBhM+RO3U5EDSLZSO+9/bVsli7IDqy+fkmMjT8jb X-Received: by 2002:a63:c24c:: with SMTP id l12-v6mr563467pgg.255.1534406154431; Thu, 16 Aug 2018 00:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534406154; cv=none; d=google.com; s=arc-20160816; b=qx0A4+uOYzmzWHm7+AUOkj7kUEYmlz2qT3WZNoikwH/JWIqmaj6Qw5XycccEKQvj20 RlzMwD6z4gp4HclZkmaAcb534UV52At+sesKmKZEKkMA4isEeTe698qx/c+HfbIiS5C4 1FDa5fU4QOSFCpKnj6BCD0k1QxUueiQm2kHEY88Pn9gZot2K+yiB4VpYDBqY0VyZf/vS RbPbEvdGqhKpLnCWpxyRJwM4v19EMAO1p0AcBy7R6rjDX03Qagd7zP7iuc8kl14YxIZ8 h0jYntXgTFovvUs56JC/nD29W0/U8GxgsiVhq9fLhQ2qYiO6J7u7sqJINR/wUbQVhnaz rhAQ== 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=SEBlkogmEohz2U3nc5fI7y654TSOo9JJM7mLC82YFnA=; b=moqLAAYNPO+D0l1Dm63f9lBDPldxyfoaJzaQHfIe7H4QPNlYdz+xaxnlM5VqtjfNX6 +K8yEHDJkD+6OV/6MZasAElnBFXZMh/THQWorsIYB96o7tZuemkuLU8aNd5SjdbBAORo 5BjzxmAa0Bu2EKJ05myPe6nUaZ8svmkhOQm7BA7jD26rsJhqzSX6+d2mFTeV/UYUaTsW GjF8Hc4LxvI7oosNquyhgZUkti/hKZWE2+/JdG1BUKHYemuy0l6IKRlIvjUS4+4zMdvL Mm1VMbjerdliQw+PC95h/av+o6v7m1/gH8yIjIi4AiLdsj2bas5nfWQ995np/ywffHJL Rbbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=da46NtEU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 f10-v6si23116824pga.559.2018.08.16.00.55.54; Thu, 16 Aug 2018 00:55:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=da46NtEU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S2389680AbeHPKwd (ORCPT + 32 others); Thu, 16 Aug 2018 06:52:33 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39113 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389650AbeHPKwc (ORCPT ); Thu, 16 Aug 2018 06:52:32 -0400 Received: by mail-pg1-f196.google.com with SMTP id a11-v6so1686416pgw.6 for ; Thu, 16 Aug 2018 00:55:51 -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=SEBlkogmEohz2U3nc5fI7y654TSOo9JJM7mLC82YFnA=; b=da46NtEU5Ug4Om6wZtWuQHwd+hFF2zllHKs+JbYzsDUlbBfD0xGlpAhZf3CM3ZA5x/ +4VSvJ9xt1t5xOgkBwQ8atBx50t44vVkq+hRsOS1eLcbyjXhStvdLGuIrmee0HFgmhOG /VJllXsKy0CVv3XGxjujRG0vKJxMwhtkg+fqY= 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=SEBlkogmEohz2U3nc5fI7y654TSOo9JJM7mLC82YFnA=; b=ss9jpua7krjNNZrcIgvGcXzUdDas1nEslCHMC7K2cRYWhvyiY3V4N4ssgLMDHx+Ujj TVNP2XUXErxadxdZWEIZ2F6XHOF0bWymlqnBfEcvBDawX/WboCakz1jS9AGHeSXmx85y 2s3Go1BjqNJfqIqhFSGm+egEyRl+Sn4iildkb1XseThuMow6JEdg3XHLXqjbRUeMEtrX BTG1T3QgPrJfXj/ghGazPZ5A6e4/LuoiQi4jC+GDSMPjDoYN7IpADhaHREKkGcQqRX6J S40iHmZMAzTyCMJMym4CJdX85+9HpUVnZaRQgdusK1aC6/qaf9zr52V4rqb587/idDEX 8zuQ== X-Gm-Message-State: AOUpUlGsmNgR8mMouy9xExXUFXALFzGKYdgcSG17Uq8Q6FbcM0FA9Zt9 nutSaYLlmfOt8C2hRa+ubgerpg== X-Received: by 2002:a63:28c1:: with SMTP id o184-v6mr27929422pgo.225.1534406151671; Thu, 16 Aug 2018 00:55:51 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id i25-v6sm50838137pfi.150.2018.08.16.00.55.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Aug 2018 00:55:50 -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 Subject: [PATCH V5 08/10] mmc: sdhci: SDMA may use Auto-CMD23 in v4 mode Date: Thu, 16 Aug 2018 15:54:22 +0800 Message-Id: <1534406064-10065-9-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534406064-10065-1-git-send-email-zhang.chunyan@linaro.org> References: <1534406064-10065-1-git-send-email-zhang.chunyan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 06c2ae9..4e375ba 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3851,10 +3851,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");