From patchwork Fri Sep 8 09:53:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 137829 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1042182vqo; Sat, 9 Sep 2023 02:47:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBFU0RnSo3Dy/1qZd2d+Kqw0U2rV8LED9J9FVwgjOTDU46FfOrXQuqU3mDVNoEE0X4tyPv X-Received: by 2002:a17:906:5187:b0:9a2:292d:ea63 with SMTP id y7-20020a170906518700b009a2292dea63mr3240461ejk.37.1694252877330; Sat, 09 Sep 2023 02:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694252877; cv=none; d=google.com; s=arc-20160816; b=JDp0pcOkRJOPCZ1+N2vrjX9fFTpSUzGxYumZjVEdiB7VWABwyHYc9RvsJz3VBf/SSO PJndK66hc9+XIMFw5IBzOJvcw1c41wBD1scTVpLxO1LAi8mgVHP8zXD4onzzd5GM8vyB JQFkkD5eoRDQM2EwV1/N9kBQyIGUgu83JhfDEqkyKwQ8UadkuXJtM8+BdO2n1hVBz1Fn kisDTvYTlp6uz00uHZjrLFiX6qrp2EgghuvHVwK07nV0o7E6PkAs6ciYIwxr8enR4sOY PuZCrOBa6M6OjkE1viQxrQ7EOqwh1Pu5uTsnP/y0yUK862amOOQAHhEYHWo17Mak4JAw vm5g== 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=kgbgwKrKjJpNlxXNT9qT4rfZ8mQ8laO3LorzcVf8E/s=; fh=y5fk6vguAkbcel7KoRWpitGO8B8BpGYTQpzSdaI/dY4=; b=IcZarNZEBori8FppRAO1qmyHts3db5tItW9pRIAF86oD3Uq1Sfo/wSYysn2Dy5n68Q FBWPEye786rogzVVQofleU1XWLhYdagULPVO5fIW+XRS7l9EIFyCBrkcGpuiVq13HC47 qkkSUp4SYiV4H9Bkkdjt3SqDX4CiLIa36iuOjQXappwTEADO18j3RSKenQqb0gdaqQls TjpLaC96OabAKO9l5sbCqjgTnoaPEjO+YP23pmQtBWCQBflIJbKEGwZDC7aK348N397t lAKLgwzvFwDkb4FRH9FNqEPmPLa11tblQsKrtyt/pQLiW2rAN7eCrI9tQwDw6K0odcqd Yi1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=HcfmGrXe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lt14-20020a170906fa8e00b009931472bdb8si2953831ejb.965.2023.09.09.02.47.30; Sat, 09 Sep 2023 02:47:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=HcfmGrXe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242802AbjIHJ4e (ORCPT + 99 others); Fri, 8 Sep 2023 05:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242813AbjIHJzy (ORCPT ); Fri, 8 Sep 2023 05:55:54 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E3501FEE; Fri, 8 Sep 2023 02:55:05 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1bee82fad0fso16000025ad.2; Fri, 08 Sep 2023 02:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694166881; x=1694771681; 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=kgbgwKrKjJpNlxXNT9qT4rfZ8mQ8laO3LorzcVf8E/s=; b=HcfmGrXe5sm5JD+EDFkl1/Vw0K+YUk3b1oSkHt9IFNkYYGNZIJu0ykAMuH6Y+ysMUj 8SAngU++xbTeWzpnavz5aYtVKOeM33HaVzW9RW2dfNLXoGn+HFOb9KOU5f/ac/ERPQgf bBvPmOvsLNlsFHeQDz95WXIkEE1WU976MwcjPKDpRbJnhEXJQC1WKBnVcLGLqKgrHDCm 5XSh47uM5dKbONUD8Dpv3nqM/zumHc31zdzRaMVqb9C+aIvBYZIMVndmbPhC9tSqUsv/ A3XOJz5/cGu9zKfLasAq3okXRExHq5Nc2e4nUR3q/FN9cquiyHPtA9mmC31dm69MQS+r pYEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694166881; x=1694771681; 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=kgbgwKrKjJpNlxXNT9qT4rfZ8mQ8laO3LorzcVf8E/s=; b=lvN5SyjDZILwzsj4B+1rZVt2WCPIHdoEMQFOKqSRbx+lAqlDmkXk/aRPcVtGEgl6zJ E6SqujSvwk1fCY6xXosDMX0n51J46eVT39ilu528fMjQKPNzfCgg1ZfSmt4CcfbzbJ58 s2tCMnDYK2i3BO3XaFf+BV0NoyvEA+UhCeViS+XqyIIAdbHIR6JTY0FKHJradxsklIUk JRdAN1VwI+JYi22kfHY07cCGU2dB5dijTf44ukbUSL23/9izVxoiwPdLJRvyTEgYvfbN NuIZjxNNteYSmWEZcJIbvTjyorHP2sUkj24peFBjQKvPEBrtjB6T3Cc2197aWQzdVFGX 4JkA== X-Gm-Message-State: AOJu0Yw9tgmCpSYiQeMV1Mj3iHizTg1Yvb3oYaruNIgokhaWruOzOxj7 rS0GhAakRWYawVyKwiGUNYos5eZpryM= X-Received: by 2002:a17:903:11c9:b0:1b9:e972:134d with SMTP id q9-20020a17090311c900b001b9e972134dmr1962721plh.3.1694166880842; Fri, 08 Sep 2023 02:54:40 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e3a1-00a4-a20b-46bc-ccec-3e79.emome-ip6.hinet.net. [2001:b400:e3a1:a4:a20b:46bc:ccec:3e79]) by smtp.gmail.com with ESMTPSA id c9-20020a170902d48900b001b892aac5c9sm1172178plg.298.2023.09.08.02.54.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 02:54:40 -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 V11 22/23] mmc: sdhci-pci: add UHS-II support framework Date: Fri, 8 Sep 2023 17:53:29 +0800 Message-Id: <20230908095330.12075-23-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230908095330.12075-1-victorshihgli@gmail.com> References: <20230908095330.12075-1-victorshihgli@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776552904802034002 X-GMAIL-MSGID: 1776552904802034002 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 215f1ab011dd..aa178384de16 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