Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp91587imm; Sun, 8 Jul 2018 20:22:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc68/7UDg6IKMU3jm/JjdU9kJ8NF6VkH01SnuRn22qoSVB1aXLPH0E51DC+Cw+eF59LaaUL X-Received: by 2002:a62:b20c:: with SMTP id x12-v6mr19898447pfe.64.1531106546619; Sun, 08 Jul 2018 20:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531106546; cv=none; d=google.com; s=arc-20160816; b=eAthhPlMZ6RkU6E4EytOE3ZwE9bguuzimWStIpuOkTnc5fHK7W8D6M9HM23kk49bIC OnNQFX8dRlMt1/a6MGr2TtPV8e9l0QJ854zIDZYqKEymJQKCXvxGOALA0Wv27tmngz7h qWzWBgyYJHQ7UPpcaJZaT9ILXLyBkjedL2g2FSn2uVLvt7O8OfqXa4aTwDVH518dpPkP jz85MZWTIebTh3xnsKTqg/5tZ4c+f4E+EJbuV+HTJhOjCamFO/YLDiVVxCpVmTTQJHq8 3cMJe/sOZsRevM9XRQi9oxv6FSlgS1oCWsYBKCERwLo/eLU5MayYtHgoqrQ6t9F3jXUi f5sQ== 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=m8EGOwYzbAaIOxZaEvnUYFUSYffN46UUlc+QT9vs7J0=; b=vtthBr+SYwM0y1r/KRJbbxyqpNUV5mxu0+myg6pB2+TB6n9iehT/43yMFLkJyktHkf SlJSJI/veYNgjZHlrezcWoQwYe9CYWGKOqMvYBoEgrbbuBc2Q581iXieIIOEfTzBioXU Ox4P+K+2O8tHMvW26LFnf2EHUh/DfovkhSAdj8aosDcOBDKTUl+xL36D5HIKZyYVMrP9 8fDmdjkiMnMhYMnC1EJHwXk7wDcOFlGei0IYPpctgal1bK+2GJRRe0uZgE/edahptrFP SdephIqACoKOzmXsRwHlfShiL+hHMTvV1vV7GMFP4pMc3hKJnls9R1PoXNKnl4gEFAFz PIqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SnDeB14O; 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 y78-v6si15295009pfj.159.2018.07.08.20.22.12; Sun, 08 Jul 2018 20:22:26 -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=SnDeB14O; 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 S933166AbeGIDVP (ORCPT + 99 others); Sun, 8 Jul 2018 23:21:15 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:35073 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933040AbeGIDVN (ORCPT ); Sun, 8 Jul 2018 23:21:13 -0400 Received: by mail-pl0-f68.google.com with SMTP id k1-v6so5347610plt.2 for ; Sun, 08 Jul 2018 20:21:13 -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=m8EGOwYzbAaIOxZaEvnUYFUSYffN46UUlc+QT9vs7J0=; b=SnDeB14O4ouu5FqBo7ZA6JwLGffg1pBsdrCcsOZKb+5AUdmAmtItFbIWWm1ARuQy+0 Y+JwbECOQRn8SikMb7kBQtTxuJFuGs33ZLQ5yrEWWVuFg8lGD53ncXevzAiHwO59483l 280KN37WNutY8dBL7Cci/QzL3X8gHXTQkXZ7k= 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=m8EGOwYzbAaIOxZaEvnUYFUSYffN46UUlc+QT9vs7J0=; b=VuJ79QItoZ5daLfXaT6V+N6zaf50VPs4O56qRflDSAcpObNcAqV66sqhYN91zT6ISK 95vq4f+ghmNH9OivDyrsN7jlo3YQc1jGuofqOJ5JBeHQgYxsv8pOlvPk1ilzW30ZcqmR SX+yzxZBeR+/NYeUEkjb4siWco1dcGeCrQWm5ZcSudjMvC5EyRMjnIm7GMMkonMiIMay sLEvy0JVcd9x6s40Bj75txlt4qH2xDZJCfUwpwbxgPrROciWej8vcMtI9Kpopvqpe35I AnYl251sKfTLoRL3CrwgM6tLnatEUijBkpNvwHrmC4FcpBN4onBM2UV0CUu/ypTAu5f/ dGHA== X-Gm-Message-State: APt69E2VpMLtxEq4wd4vkzGTVc3fj1JWrwqt8xkgDokjtCkPyXVVmzoW xjBSuNUC5bgWGawzAyNkJMmbwA== X-Received: by 2002:a17:902:294a:: with SMTP id g68-v6mr19351024plb.58.1531106473171; Sun, 08 Jul 2018 20:21:13 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id e82-v6sm41458950pfk.87.2018.07.08.20.20.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Jul 2018 20:21:12 -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 V3 1/7] mmc: sdhci: add sd host v4 mode Date: Mon, 9 Jul 2018 11:19:52 +0800 Message-Id: <1531106398-14062-2-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531106398-14062-1-git-send-email-zhang.chunyan@linaro.org> References: <1531106398-14062-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 For SD host controller version 4.00 or later ones, there're two modes of implementation - Version 3.00 compatible mode or Version 4 mode. This patch introduced an interface to enable v4 mode. Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci.c | 11 +++++++++++ drivers/mmc/host/sdhci.h | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1c828e0..525862f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3321,6 +3321,17 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev, EXPORT_SYMBOL_GPL(sdhci_alloc_host); +/* + * Vendor's Host Controller which supports v4 mode can call + * this function to enable v4 mode before calling + * __sdhci_add_host(). + */ +void sdhci_enable_v4_mode(struct sdhci_host *host) +{ + host->v4_mode = true; +} +EXPORT_SYMBOL_GPL(sdhci_enable_v4_mode); + static int sdhci_set_dma_mask(struct sdhci_host *host) { struct mmc_host *mmc = host->mmc; diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 23966f8..e98249b 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -184,6 +184,7 @@ #define SDHCI_CTRL_DRV_TYPE_D 0x0030 #define SDHCI_CTRL_EXEC_TUNING 0x0040 #define SDHCI_CTRL_TUNED_CLK 0x0080 +#define SDHCI_CTRL_V4_MODE 0x1000 #define SDHCI_CTRL_PRESET_VAL_ENABLE 0x8000 #define SDHCI_CAPABILITIES 0x40 @@ -566,6 +567,9 @@ struct sdhci_host { u64 data_timeout; unsigned long private[0] ____cacheline_aligned; + + /* Host Version 4 Enable */ + bool v4_mode; }; struct sdhci_ops { @@ -747,5 +751,6 @@ bool sdhci_cqe_irq(struct sdhci_host *host, u32 intmask, int *cmd_error, int *data_error); void sdhci_dumpregs(struct sdhci_host *host); +void sdhci_enable_v4_mode(struct sdhci_host *host); #endif /* __SDHCI_HW_H */ -- 2.7.4