Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2271390imm; Thu, 16 Aug 2018 07:30:03 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyvoy5oymwTJgs7lTm9+Y7iLO9ksCpuZj4x09JTEQqHmh978KiISJu/OAlU0AXhdhK0k5H1 X-Received: by 2002:a62:1314:: with SMTP id b20-v6mr32642122pfj.230.1534429803070; Thu, 16 Aug 2018 07:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534429803; cv=none; d=google.com; s=arc-20160816; b=drr8Y1fvCLdunLOnCVEFuuu1oSzYHwVQbxlBy9vXeppEQzppi4AHN1kIMB6TFSV744 HdTq33Jpe99Il509jdLWD3p2++1UcNny4rPxjCmt4nVLcQNEGgI6HquGqF0X37W+YC7H U1JuKxYYAuaW4+cPUESl4kv0jh2GcxewV+Nll+Foqj4E5kvDkdNkipS8/YFuPkaW9Mn/ /TPm0L5g2cj3Wf2fFdRr4qvMyLm9824BapKs4jWzcx3wBREvPVZ1qol80m+zvJctpN5w EvNaJnLAfrjTVUW42VzshcBXZNIl9vC6++gtHkVwdjCOS2NbRFR3cn1kHVa66n0kHGqz YF+w== 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 o184-v6si26937150pga.520.2018.08.16.07.29.24; Thu, 16 Aug 2018 07:30:03 -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 S2389678AbeHPKwd (ORCPT + 99 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(-) 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"); -- 2.7.4