Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp307848imm; Wed, 29 Aug 2018 00:05:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYEK4PCEVvEk9dxH4hdF7+fcs+Z7iwC2pya8wK6/N8fgZd3P9umZpETd5ywa9wQchAV7EYM X-Received: by 2002:a63:f44d:: with SMTP id p13-v6mr4628126pgk.257.1535526336238; Wed, 29 Aug 2018 00:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535526336; cv=none; d=google.com; s=arc-20160816; b=jihErWwE2GgkoZiX2akH4yRCjmogvtvh4ymBSmPsMIqNGciWwmDs2N9KNsjZ7jcLPP DrXvRjR6i59+2v4cu+BUn3BchnWiL5/zki3i8stbKcm/xZHQRxNig+Jt1JflWCv0Lt7k QBo3S60SUE6MeimmYfCB1pTTnog4zkkSbTgM4Vn1Fy+E7WEjQBkiV8am6j1ySAnQHWl+ vv5AvQ7d2HthTPcr53e4rJBg4lR1NHsgc+2qDGetpUXNPLMtS+b5XXgq7/cxrB+2I43Y +gSrwEnmC5zajIfUO2DmK2V7r5bZQgOw6UWRFrVDcSlg7cmHgWhc9NvQhEOafvAMjf2N YgPg== 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=F6JNjnqOBxraoAmJ2G9nQq3A9aaEWZWPodCkmFELEA4=; b=qkn0GPkVJCx2V8a7Ep9N36CgVOy333kNez6QpGBxmKl4KN2I+zuspvlMTrLOL+WYPt V9zf44ECvTTVwrAhcAySrenRJnU8ypKQi/EHVMKX0+nyujmxCOKKod/aXlgYadgGvdPY 7hTzPtubA5fsVjXErneILdw7Yevu36Ui+hF7QktJ8i9LkGL/Bn9cAUwmT0DqDksjz4yP N5IlED4C0JDPBMRlZ7sQtc0rwlS/U3PZayx8gh15yjU1DJmgHBo/qsQmDLw9Ervoq51C tjdlX8Nwx9JahRpaQBYZxcxSzcAsuv0HmIaSqFkiZxZI1VpSQIfDOsJQi/hapqjSy8E1 t2qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FTt8+uiI; 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 205-v6si3047658pgd.271.2018.08.29.00.05.21; Wed, 29 Aug 2018 00:05:36 -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=FTt8+uiI; 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 S1727811AbeH2K7K (ORCPT + 99 others); Wed, 29 Aug 2018 06:59:10 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:37307 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727785AbeH2K7J (ORCPT ); Wed, 29 Aug 2018 06:59:09 -0400 Received: by mail-pl1-f193.google.com with SMTP id d12-v6so1893802pls.4 for ; Wed, 29 Aug 2018 00:03:44 -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=F6JNjnqOBxraoAmJ2G9nQq3A9aaEWZWPodCkmFELEA4=; b=FTt8+uiIDtMNr76i4SHHbEdmo3x0fQckM4/6nQz3cKegXczL/kS8xRQ86loF+ym1uP 3Fpd5LHKwS30oEPpmqKE/5WBxvTynx6qm7zdYVXJzSnMnivIcq/YIMSSdvCqnFxpwflb ohKMYLCNY5PjsqLIsr49T3uTBongbaNEe/jJg= 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=F6JNjnqOBxraoAmJ2G9nQq3A9aaEWZWPodCkmFELEA4=; b=UydP+YzQ4Agt3W67qlrekxq4/q9sasFw1w3btTTFHzcmbyp0JUGO4+jjuzyOrv0f05 MaLd20NkklNibnDWkAtbao7GX7bBaHdRVgCqUkDt17c93Sp/ZKbKOtac883Z7lZ8QZKZ EhZ6jcKFPa96L/MolL+qwL8UeVeWM1Obmsg7l3uRsFMiL243ELLS0x/msKD71xh/MeIt U/xowuQ4PxexWVnNKonl9/BzsR7KutzFwHcwgatRi4sFXqC/nVcVAGbqQzWpVdFYybTK G+aM4wHaWU0tquew9kYsNmf02bFGsIpUKQM/5gxH6e4pJRS3SPUE8+y+oCDUoIQ/WhaF OXdw== X-Gm-Message-State: APzg51Aiwfq/dsvwVCboYtMD1t1lJbRRvfOgQpJb7IO4DgH/1UJOSwz1 jA1nAqB7aH/QYXjrkB4AI034UA== X-Received: by 2002:a17:902:a987:: with SMTP id bh7-v6mr4834081plb.182.1535526224623; Wed, 29 Aug 2018 00:03:44 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id d81-v6sm4317342pfj.122.2018.08.29.00.03.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Aug 2018 00:03:43 -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 V7 7/9] mmc: sdhci: SDMA may use Auto-CMD23 in v4 mode Date: Wed, 29 Aug 2018 15:03:02 +0800 Message-Id: <1535526184-32718-8-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535526184-32718-1-git-send-email-zhang.chunyan@linaro.org> References: <1535526184-32718-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 62d843ac90..ac92e0f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3834,10 +3834,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