From patchwork Fri Nov 17 11:31:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 166138 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp461857vqn; Fri, 17 Nov 2023 03:37:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAicim795Q8l6bNFJQHeWMeJ8mrDMG3/aMOEnX8LWgNV5che0lSexGJ71O8TiitjBKYECS X-Received: by 2002:a05:6808:148f:b0:3ab:38b0:8b84 with SMTP id e15-20020a056808148f00b003ab38b08b84mr24884895oiw.17.1700221029619; Fri, 17 Nov 2023 03:37:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700221029; cv=none; d=google.com; s=arc-20160816; b=a4QmAR+yufYhmnks6joVgyJ1FnwByXwNO1aE0eOVGXESWljS2Tk6UUBUh72lFb2QYB FlRC2iN98dAqm/gl9qgMGCZ8ZCFiZ4epY1LcKVsEbU3GgcjPYCfggpW8HGi/ij34CYoe U5x79DQ/Qk9Z9DTUTk+8uLDRrznWqHFbYnvRrcf2qcJYPazVQHzwD532bMRiOOq+BtfD FtsE+mLCDXYD/OyR7p3rqet5yD9KK4LT6Fc0lfM8OO4oxLXkSDQDg8Emjb+IS350yBg+ 2jA6MwmiL+MjBiAYUuG9jlT8t9GHNyRhrWpvi7goFeQoVnDCZdfiVrVcTc+aipuH5qMR Jz/w== 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=7FvsqpLwWh7MDXgE9IHWZkG84LQsLuj05cGMS/N+jnc=; fh=y5fk6vguAkbcel7KoRWpitGO8B8BpGYTQpzSdaI/dY4=; b=oWQW02+CwCCjL5+NkCAGV4Es049nMYFk3d48tjHBXrPMGj+XvT2tFPpXyKU6ocTL8B hpMHZt5GpvcPIdYVDT59GAZ3+gijE+vWNfG03sTl+0aXc+DW3GNEzwELrFK48lpOA+kp P4qENA9kb5uqSuOwsYHwtQsJVl6PqDMjWS0z2pbHVy5JrBO0SsUzKMNCgveSf/SU2pAS Md7vJqPhL//mlyGtqx+bmhqBG/GOr2fX4rKrsdtSaSHEpweMDcRr5wJ9pC0URfKNzmBe V9mIKhFWNzWByhsQTSkf0PfqM0aE5tn6AXe0h2GeTztPItNEPaYCT0eHkelSKOsuHMpd LYAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SBmacuej; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id m15-20020a656a0f000000b005b106cd44d1si1797182pgu.486.2023.11.17.03.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 03:37:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SBmacuej; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 6A48B808BD8D; Fri, 17 Nov 2023 03:37:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346086AbjKQLeX (ORCPT + 30 others); Fri, 17 Nov 2023 06:34:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346048AbjKQLdl (ORCPT ); Fri, 17 Nov 2023 06:33:41 -0500 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B33173C; Fri, 17 Nov 2023 03:33:02 -0800 (PST) Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3b56b618217so1125972b6e.0; Fri, 17 Nov 2023 03:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700220782; x=1700825582; 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=7FvsqpLwWh7MDXgE9IHWZkG84LQsLuj05cGMS/N+jnc=; b=SBmacuejkigevKjGx8T7LZWemBOqe4zeXqZCIe6kjpsKS9pzrv+80BYQ2roVDjXBvq GtNNo2AVHW2Cl28GPOnRA8zJsZS4A9wUeyqKIspJB237cmhAw7Oy2uzJsskG9mc0AVX7 FCxDrLFcFz/eQUvZsRwq7kMkQ2w0Y6aSgkEfM/2VVEQIxIr+BapqGT7cYBaiD1fUUSzv uj/yeXcaRE1ghu6NcIA1k2aAprOyIA6TGYg5wAk9QBKxdbHIODLT6C28+nDtMyGtY72Y IAGlypT9OcJzJqtQTWzCGy2ZaDKrrJzACioVliOZDg3abT9FUb1mhHqHOvrfjyf+2Qev Ha7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700220782; x=1700825582; 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=7FvsqpLwWh7MDXgE9IHWZkG84LQsLuj05cGMS/N+jnc=; b=WRmzcq8ylB/tSHIl2HoS0Qb0IQaOJZyGCEqTaxG4FPPappm7zVpaZDM9GoVydCtyUm hoSDkcGY7uqSJD6xsJMUOsYngvb+EQX4RzAk6o4pR8vAiLQPqX/CpkOBqzWkdWN90Egw NwAtLgv9ddcYT/H4Apf48EPBfMzxK3ecpj5Xn4U0frhGAsHXgALTilgqcwI1nMKDkuUx 6ihUioroS0+/IPe+thpTS83qIE9/gv5licCE+S/Yvvv2gV5tZrT7zhnJnO33+pwkSRoe pn6rqRJtwqluskM8RgGbMh9NA3+asCHpQMxKffVo113/W3TnGE40FnwaxBxPLVaxe5My Xe3A== X-Gm-Message-State: AOJu0YzNAkjLLMzcwbmKcUPm8vxNMCS4dUD++ngn7IfRlp59fukLvfYw r++nviJoVKxNlyQcFUrJxX4= X-Received: by 2002:a05:6808:6546:b0:3ae:1298:257a with SMTP id fn6-20020a056808654600b003ae1298257amr24299377oib.1.1700220781958; Fri, 17 Nov 2023 03:33:01 -0800 (PST) Received: from localhost.localdomain (2001-b400-e286-d458-bc89-d4cd-bd42-ffb5.emome-ip6.hinet.net. [2001:b400:e286:d458:bc89:d4cd:bd42:ffb5]) by smtp.gmail.com with ESMTPSA id u2-20020a631402000000b005b4b70738e5sm1229224pgl.8.2023.11.17.03.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 03:33:01 -0800 (PST) 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 V13 20/21] mmc: sdhci-pci: add UHS-II support framework Date: Fri, 17 Nov 2023 19:31:48 +0800 Message-Id: <20231117113149.9069-21-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231117113149.9069-1-victorshihgli@gmail.com> References: <20231117113149.9069-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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Fri, 17 Nov 2023 03:37:03 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782810966289518305 X-GMAIL-MSGID: 1782810966289518305 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 46a722270ad0..f06886bd98df 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 025b31aa712c..9c87898a1b03 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); @@ -2161,7 +2162,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); @@ -2169,6 +2173,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