From patchwork Thu Aug 30 08:21:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 145530 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp536775ljw; Thu, 30 Aug 2018 01:22:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZW8PPXfPSY1pcfbATi/lzxsvCwYW+/vWIkbzkLrzv6NzVeo9JACaK21xfRG576J7eCxmhP X-Received: by 2002:a62:760a:: with SMTP id r10-v6mr9492924pfc.207.1535617352335; Thu, 30 Aug 2018 01:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535617352; cv=none; d=google.com; s=arc-20160816; b=WTrdQI46SIOKa9k+PpfZawgJjXslz/tvtWrzPnuvO7qzhN75xjDmHEJ4Raa42bsHL0 LdmrX1fG+z4Q5J6Pid+sUL+nhc+g6rKXB5zFNI1UxHXHuwurtyWlzYinKWeZFTvXuvt5 EHPxhXohAXJ8N9p6qR0JzRUwoHIgrgwI0YpDkiQ+iRVlGFXicx2w2fdHQeAMul+sEb6l HUT2p2VyT6aLPiLBuTETzLDQAgstI2Rx20WdW/pJRBVPCwYMQ7B51g5ypjXFDWdm4dTd J6l33IM988H9F00+oX1JazsfK85kmqIBNHT6H0qYRk6KavtNw0mqgCgol+qNo3KdB3ra DMUw== 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=Ah8c1s4NQMeDLK8VDxuLb0Way+MTHYiFrnLMxjLrOic=; b=1J9pn7xdteb7KU+R6rJDunyPVVD/4rckKLmdpi/6wbZCGHy1X/4mUVuM1fTdaPRztB M93o5JDz0+WVl0cLjR1MuwGbulREe7AuIwpgdqs7jrjdvXIQRUXZVr0Alj0etabvQ0SG Sy5Hj2Pyr70Sxy1K7pVKEMxyvTCr/8wd4fLJPCEYXzlpAlzxGJeSWxKf1hg1eVyEuwq7 QyL3CwTnMITXkvHXXXf3dCpSNiHninl6dTkhYA5HvfBtIzgQJpyzEWPgKNJvIcreBmHc SINFSzJC7XUbrWHIfIVeagRc8pC76ynxWF73eKHYnE0RpVMLVswLy4uET9SnxOOY7eFB iwFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ci2esfNn; 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 a24-v6si4848191pgi.515.2018.08.30.01.22.32; Thu, 30 Aug 2018 01:22:32 -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=Ci2esfNn; 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 S1728109AbeH3MX2 (ORCPT + 32 others); Thu, 30 Aug 2018 08:23:28 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:38981 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728068AbeH3MX1 (ORCPT ); Thu, 30 Aug 2018 08:23:27 -0400 Received: by mail-pg1-f193.google.com with SMTP id g20-v6so3565829pgv.6 for ; Thu, 30 Aug 2018 01:22:29 -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=Ah8c1s4NQMeDLK8VDxuLb0Way+MTHYiFrnLMxjLrOic=; b=Ci2esfNnkrultBR2JC8oOpP8798ra5xy2lQVamINyr0vxNV8Va0QyFMobOXx5BrTzh 6AYTQroAWBjY4/dEK9n5xbBTh1ejAtr+e3CihREeL95NRivmUT87sZVVp+HWAHO8tLJb gQM80n7RDnruyd9l43yPB0goqCGQYGKbd3n5M= 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=Ah8c1s4NQMeDLK8VDxuLb0Way+MTHYiFrnLMxjLrOic=; b=liml2WMh12h40TF8sjpuPpoTFNwCjsIRoP2OHsyqDUq5wO7Y2MuZYLKT/4o9U2cZDH stESk/krcJyeUE36qLbh4iDkvKMBEFIlHG2gRI+ztaTsg12bBh4/bdHd0Ot3+9ikIgob rZinNp64dkU0UMaLMfEayqILP56bX0Do2VIZ6t8VeCScNI6TXPHePv91wA+dnF5LAc9h OF4kyG6ODn9MMDy/jzTTJUx2+wk9gBS29QJVSaOkRLzqFW0RGJwL06bo6ZTbsYDmSpKu HvFlkHv6iAj+2AjubpgIEyxw1gweUkvvwHTmCoWuSiXycYtqJSBfpKZadse6BP9313jx qgKQ== X-Gm-Message-State: APzg51C2bcczmlcGMHFSmYnEMwQ6YRbkaE4OFY2vAKT1YXNi20wUKgjy blHuaPvPsJjQlx9RVbzcvK1s/A== X-Received: by 2002:aa7:88d3:: with SMTP id p19-v6mr9499481pfo.160.1535617349542; Thu, 30 Aug 2018 01:22:29 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id j22-v6sm8224885pfh.45.2018.08.30.01.22.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Aug 2018 01:22:28 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter , Rob Herring 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 V8 7/9] mmc: sdhci: SDMA may use Auto-CMD23 in v4 mode Date: Thu, 30 Aug 2018 16:21:43 +0800 Message-Id: <1535617305-16952-8-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535617305-16952-1-git-send-email-zhang.chunyan@linaro.org> References: <1535617305-16952-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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 62d843ac90..606d331 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3834,10 +3834,13 @@ 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->flags & SDHCI_USE_SDMA) || host->v4_mode) && !(host->quirks2 & SDHCI_QUIRK2_ACMD23_BROKEN)) { host->flags |= SDHCI_AUTO_CMD23; DBG("Auto-CMD23 available\n");