Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp572561imm; Fri, 8 Jun 2018 01:27:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKXugH6IUYFDmoyLTRntMts4k162wYFR8uK+0LIoESgt73NRZw3QoEVq/lDZcPJJTtOGfJb X-Received: by 2002:a62:62c2:: with SMTP id w185-v6mr5071937pfb.78.1528446473953; Fri, 08 Jun 2018 01:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528446473; cv=none; d=google.com; s=arc-20160816; b=b/cETnkrakzcHBaLh/CmZjd94Rv/SdIW2yvYMe968uQr35+mvKil7I+JiGcmXYvAHT y+S5rIAAYvZnlBb+ODdPTyftVlYQnBPqZ0hSRhbRMTjO1ObtU8HPZZi5ZuqqMicSenFi 5bev+tnLV/Zfopoydu0l/COB0J8wcqx94JLAh3QWskP3FG1KDMg68teL0VonCCxrAW/8 5Z8rncgNkCn2sdBWqPEGqqbq4v7YVLHSt8XhmmCLatNcL4r2FHp9Agj4mmO/szXlo30g 0H4jDLPWCzhfiO7FT3G/EKsE6NlMjN0CYh0D52TCY743qeKw+xQ+xUn9uTfoiJBB7nuK w71g== 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=Y2y/xY2dusr5GMTlLcs29f19Nju3/wuuxjplM+exAbo=; b=sqsj/9TFRsp8xnAmHMpa9884C9p+6Yui0EE430rakRYU2Z7farhQvtF2ZWRl0+DIKa yQLxawvLDMndC+IZuB7UbBEocLEJZTt1umWhTRaNl7WN/sOLo6qibFDTxehlzWffZ79e mTXDsYqWL4PnTmr2Ou1Wt/7OTSMBfHXjA3UIN3rOaIHHxqza0QkW8lJ8AAZ5dkgc5riY Sr9NKshSsZj/MxzedP/oEcD8gQN4HR0VtSIBULGANvkGOtTXhGK+TY7MRmM9y/GKoHTl AUxYj4sS9RDMTkZQMUxWFS2mQBjWALIldTvMDnPaKtHB8w9O2SYSesSMNgTTx3HRPZ/l mRzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FKieoiP+; 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 124-v6si27732232pgg.29.2018.06.08.01.27.39; Fri, 08 Jun 2018 01:27:53 -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=FKieoiP+; 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 S932344AbeFHIZn (ORCPT + 99 others); Fri, 8 Jun 2018 04:25:43 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:46057 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752910AbeFHITS (ORCPT ); Fri, 8 Jun 2018 04:19:18 -0400 Received: by mail-pg0-f68.google.com with SMTP id z1-v6so6030970pgv.12 for ; Fri, 08 Jun 2018 01:19:18 -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=Y2y/xY2dusr5GMTlLcs29f19Nju3/wuuxjplM+exAbo=; b=FKieoiP+oTs39Jw8HxQ3lxOLeBs5f6t7CE83ff/85RIfHalbD8s+wfshp/M8iV4tbI I1r33vk+lPq7y6XD3ZVaO8Fh6nIg6wFXcDFUNOrKdsTKnDpXZsMJyl9eo8ZphQ+Z5LFb J6x6a2dFhQjM7Y1pZdermG1QvPPODua+nlxqs= 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=Y2y/xY2dusr5GMTlLcs29f19Nju3/wuuxjplM+exAbo=; b=nECMdiFDmNyI1wCI+iPx0WbTZ8QsW2Hp2DMZ7GXQRJMaLiHbzFyBdm/DVfYY642C98 vdZJ88kdmtCW0Cyyfr0X9YCBJRPmutuDl+6H9UstiJjR6EZDixHAxIE8F964+FH5YFFa OnUuZqIOrzX324BT0Etzk+4Fm+YnvrNzdA1NI3x24FrkQP28RrOcfBYZ9u/+3hRZbyrr FHQoCXPLHVLKX4TEwMdX03z9SUxQABJE4qh8/uKyBi18nd/5EtxJ+0cBk3KQxHjyZPkE +ZWhkuQyoAmCruQDHoGv2f8dmEXKJkkTOFZc7vEHXLpBOUkeZVP+3ZrRLICzCkdO90TQ jYow== X-Gm-Message-State: APt69E2c3QVJTPY/SastqmAYkIRwKuJvt1iEkT34lCQYzmXuigyD6tg6 wzjwttawQ2bSPCzmAbvk5oImTA== X-Received: by 2002:a62:e816:: with SMTP id c22-v6mr5006819pfi.124.1528445958137; Fri, 08 Jun 2018 01:19:18 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id s4-v6sm72243947pgp.35.2018.06.08.01.19.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jun 2018 01:19:17 -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 , zhang.lyra@gmail.com Subject: [PATCH 5/6] mmc: sdhci: add CMD23 support for v4 mode Date: Fri, 8 Jun 2018 16:18:12 +0800 Message-Id: <1528445893-14530-6-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528445893-14530-1-git-send-email-zhang.chunyan@linaro.org> References: <1528445893-14530-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 Host Driver Version 4.10 adds a new bit in Host Control 2 Register for selecting Auto CMD23 or Auto CMD12 for ADMA3 data transfer. Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci.c | 16 +++++++++++++++- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index b8ee124..3b2af7e 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -954,6 +954,20 @@ static inline bool sdhci_auto_cmd12(struct sdhci_host *host, !mrq->cap_cmd_during_tfr; } +static inline void sdhci_set_auto_cmd23(struct sdhci_host *host, + struct mmc_command *cmd) +{ + u16 ctrl2; + + if (host->v4_mode) { + ctrl2 = sdhci_readw(host, SDHCI_HOST_CONTROL2); + ctrl2 |= SDHCI_CMD23_ENABLE; + sdhci_writew(host, ctrl2, SDHCI_HOST_CONTROL2); + } else { + sdhci_writel(host, cmd->mrq->sbc->arg, SDHCI_ARGUMENT2); + } +} + static void sdhci_set_transfer_mode(struct sdhci_host *host, struct mmc_command *cmd) { @@ -989,7 +1003,7 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, mode |= SDHCI_TRNS_AUTO_CMD12; else if (cmd->mrq->sbc && (host->flags & SDHCI_AUTO_CMD23)) { mode |= SDHCI_TRNS_AUTO_CMD23; - sdhci_writel(host, cmd->mrq->sbc->arg, SDHCI_ARGUMENT2); + sdhci_set_auto_cmd23(host, cmd); } } diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 1e84539..d5e1c10 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -185,6 +185,7 @@ #define SDHCI_CTRL_DRV_TYPE_D 0x0030 #define SDHCI_CTRL_EXEC_TUNING 0x0040 #define SDHCI_CTRL_TUNED_CLK 0x0080 +#define SDHCI_CMD23_ENABLE 0x0800 #define SDHCI_CTRL_V4_MODE 0x1000 #define SDHCI_CTRL_64BIT_ADDR 0x2000 #define SDHCI_CTRL_PRESET_VAL_ENABLE 0x8000 -- 2.7.4