From patchwork Fri Sep 15 09:43:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 140358 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp955130vqi; Fri, 15 Sep 2023 04:01:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPgDfiQZyFvTIoXgfJz2HzIf58uqVLNfzXaOzDQiSQIRk0lC0oqpSaTPgqqiiJ7QaqFXpo X-Received: by 2002:a05:6a00:22ce:b0:68e:2cf2:1613 with SMTP id f14-20020a056a0022ce00b0068e2cf21613mr1492294pfj.3.1694775665427; Fri, 15 Sep 2023 04:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694775665; cv=none; d=google.com; s=arc-20160816; b=ERcGVqUJjrPGpeHFq19owRPAOk/sXRHsTtzhzOhV36z3ff8b+0z+EJTU94cm3dRnzO QxV5N8+1oeKCl9eug1aI7zj+ONhVSxlPkl5KBFps7wy4u2y5yrTVHUUhc9w0jMY6jZQ7 6GNGaNMRZBPi2eqUnD4vJp35Oz3OY8TOgA796s6at/LJdinFNlfu34n45LAWroiXLqo0 ieIUUBFUZqXHQPZD2ns8Pea7k3gdGb/JbKd+9dVBpS9kdcwIHlnEgJ2uI0+3mjK9P+lM /JIuWsjHewIiW5ibR4y6vh//8ji16G/viysyd67ZO7+/qyndobKe5yi1RH1PxWjey9Qk GbhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JFzZ8I84cwmSh5chN+rYIopKyMDgjnG6h49lrdInWmY=; fh=y5fk6vguAkbcel7KoRWpitGO8B8BpGYTQpzSdaI/dY4=; b=UZ1gXMXpljF5yBul+8cuSyIRv/kje/fWw5OzNFuAxnAbjhra5PXP5nyuvXMARECUGw kQqvOqu3osk3jmTMmYKmynTjLGCP6BWtEx/6wVXt+RvkdeaxdkCznLpslA0GFsVp4huH 35H7eYxA5MQcfnrwqLhLpPwqsW77oJt/M4IQJZhb2mlkOMYG1zoW1T+JQg7JyQDhdDpX BSqXSCfcQyef1qqB/nQNein2eWaSrgUVW4LiKEYHw7j1JYw91GX1mzHwUwm+IHFA/KsY gv0qwIWHyeditWfv0LHx9N097rI5eIKC/nDeMRmGOzDefpriM8g3V841LAmxnflTdkqJ 5w+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JhLzfJWE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id w20-20020a63fb54000000b00577ac67a31dsi3000437pgj.757.2023.09.15.04.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 04:01:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JhLzfJWE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id A1BEF83EC970; Fri, 15 Sep 2023 02:48:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233925AbjIOJsK (ORCPT + 32 others); Fri, 15 Sep 2023 05:48:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233825AbjIOJsH (ORCPT ); Fri, 15 Sep 2023 05:48:07 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 783053AB8; Fri, 15 Sep 2023 02:45:00 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-573e67cc6eeso1534162a12.2; Fri, 15 Sep 2023 02:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694771099; x=1695375899; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JFzZ8I84cwmSh5chN+rYIopKyMDgjnG6h49lrdInWmY=; b=JhLzfJWEQEGvv6vd2wMBDbIwirA0+4Z1oYVbOP6OVeW1Cw17mSScXSzOQgGW8/wy22 yWF4EeK+hhLfE75c1ttsCcYFks7uWJf6JtXccRj4h2J8SgLYgkfDPpTz3mHx09xkcxN9 DcTedJkrcbunaSbO4idj/ibfCRXkSiemWoJEgkRGmWbbuZVLAKpBoWFsMm4gRDpL2KYv uIjrvMs5tZl968tx9znF45UhS2ouGByB0QhCwrCVGrO0pfRFs+eTFVaOFqepCZB/AlwC ESvSDdZ7IR5aWEOMfEXiqZbxxVcM1jmwKVfmpp6OiYBCi7WNTvQp8m+QCW2MlXcOQLJb cunw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694771099; x=1695375899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JFzZ8I84cwmSh5chN+rYIopKyMDgjnG6h49lrdInWmY=; b=lJZJnugRKFchb5zNbksDO4TkIz7yhb/ay5avyRKYm35W4svDGr8zI3u4UYExV7gY4i MA28TVYVJkePqOKKcVSzSjHhnIgYWtLRJt8MLA/2n5XLDp6RgEjBNgS+PX3gomOcF5ao fZlB1/V4qcVKyyTmEQOH1kEnOnttRwBUgDx0j5fqoqqOboSvXBIcekYGhTTg8K6eSe5l L1ajc1tuAX/czJFcTr2/S2CH3R6gOHfjzaI5U2MlhnbYs9rR9XPEOZ05LIlBgntwi2Eu xxzXchSFQKwyvzsVd9J/9nbgYsPHX7Hn9u8LZ1dYuZiKbPGEE0qt75fxB5Fp7hdp3kbn AvkQ== X-Gm-Message-State: AOJu0YxLvKGc5VBy2nkXvvoGV+YlvBp6+DqORGKyoYj1h7MYU3dEcWKp IdJmM9Rf5cFZxXHj/MLpaIHRa9/wvx0= X-Received: by 2002:a17:90a:6407:b0:273:ec96:b6f9 with SMTP id g7-20020a17090a640700b00273ec96b6f9mr922308pjj.25.1694771099520; Fri, 15 Sep 2023 02:44:59 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e2a6-6d77-d32f-f490-6688-3d32.emome-ip6.hinet.net. [2001:b400:e2a6:6d77:d32f:f490:6688:3d32]) by smtp.gmail.com with ESMTPSA id x4-20020a17090a530400b0025023726fc4sm4432794pjh.26.2023.09.15.02.44.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 02:44:59 -0700 (PDT) From: Victor Shih To: ulf.hansson@linaro.org, adrian.hunter@intel.com Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, benchuanggli@gmail.com, HL.Liu@genesyslogic.com.tw, Greg.tu@genesyslogic.com.tw, takahiro.akashi@linaro.org, dlunev@chromium.org, Victor Shih , Ben Chuang , Victor Shih Subject: [PATCH V12 22/23] mmc: sdhci-pci: add UHS-II support framework Date: Fri, 15 Sep 2023 17:43:50 +0800 Message-Id: <20230915094351.11120-23-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230915094351.11120-1-victorshihgli@gmail.com> References: <20230915094351.11120-1-victorshihgli@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 15 Sep 2023 02:48:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777101088235117857 X-GMAIL-MSGID: 1777101088235117857 From: Victor Shih This patch prepares for adding UHS-II support at a specific UHS-II capable sdhci-pci controller, GL9755 for now. Signed-off-by: Ben Chuang Signed-off-by: AKASHI Takahiro Signed-off-by: Victor Shih Acked-by: Adrian Hunter --- Updates in V8: - Add config select MMC_SDHCI_UHS2 in Kconfig. --- drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-pci-core.c | 16 +++++++++++++++- drivers/mmc/host/sdhci-pci.h | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 1aeded48ec99..f6a7bfaa67e4 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -111,6 +111,7 @@ config MMC_SDHCI_PCI tristate "SDHCI support on PCI bus" depends on MMC_SDHCI && PCI select MMC_CQHCI + select MMC_SDHCI_UHS2 select IOSF_MBI if X86 select MMC_SDHCI_IO_ACCESSORS help diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index 7c14feb5db77..22698119ecf2 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -40,6 +40,7 @@ #include "sdhci.h" #include "sdhci-cqhci.h" #include "sdhci-pci.h" +#include "sdhci-uhs2.h" static void sdhci_pci_hw_reset(struct sdhci_host *host); @@ -2160,7 +2161,10 @@ static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) if (scratch == (u32)-1) dead = 1; - sdhci_remove_host(slot->host, dead); + if (slot->chip->fixes && slot->chip->fixes->remove_host) + slot->chip->fixes->remove_host(slot, dead); + else + sdhci_remove_host(slot->host, dead); if (slot->chip->fixes && slot->chip->fixes->remove_slot) slot->chip->fixes->remove_slot(slot, dead); @@ -2168,6 +2172,16 @@ static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) sdhci_free_host(slot->host); } +int sdhci_pci_uhs2_add_host(struct sdhci_pci_slot *slot) +{ + return sdhci_uhs2_add_host(slot->host); +} + +void sdhci_pci_uhs2_remove_host(struct sdhci_pci_slot *slot, int dead) +{ + sdhci_uhs2_remove_host(slot->host, dead); +} + static void sdhci_pci_runtime_pm_allow(struct device *dev) { pm_suspend_ignore_children(dev, 1); diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h index 153704f812ed..e807c039a8b1 100644 --- a/drivers/mmc/host/sdhci-pci.h +++ b/drivers/mmc/host/sdhci-pci.h @@ -145,6 +145,7 @@ struct sdhci_pci_fixes { int (*probe_slot) (struct sdhci_pci_slot *); int (*add_host) (struct sdhci_pci_slot *); void (*remove_slot) (struct sdhci_pci_slot *, int); + void (*remove_host) (struct sdhci_pci_slot *, int); #ifdef CONFIG_PM_SLEEP int (*suspend) (struct sdhci_pci_chip *); @@ -189,6 +190,8 @@ static inline void *sdhci_pci_priv(struct sdhci_pci_slot *slot) return (void *)slot->private; } +int sdhci_pci_uhs2_add_host(struct sdhci_pci_slot *slot); +void sdhci_pci_uhs2_remove_host(struct sdhci_pci_slot *slot, int dead); #ifdef CONFIG_PM_SLEEP int sdhci_pci_resume_host(struct sdhci_pci_chip *chip); #endif