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: 724091 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B86A2EE644B for ; Fri, 15 Sep 2023 09:48:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233371AbjIOJsK (ORCPT ); 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-Google-Smtp-Source: AGHT+IF6hPFjjfx5ahZTuEB4jQbYQnhUXrIM8nSP/NYSyBq08vZ/Ym/2mizs99rcWLwgKOS57BgSyg== 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 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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