From patchwork Tue Jan 23 06:28:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 190747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp153917dyi; Mon, 22 Jan 2024 22:38:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEm6F4cw/bIauvBOokpeEFWP9T4Mbxb7dBnB2EKNwAxP5ThukhRgyg2tgTYhFyNKLxwdpbe X-Received: by 2002:a05:6a20:8baf:b0:19a:f27b:a7f7 with SMTP id m47-20020a056a208baf00b0019af27ba7f7mr5254434pzh.119.1705991884145; Mon, 22 Jan 2024 22:38:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705991884; cv=pass; d=google.com; s=arc-20160816; b=gc65vShaagzi9wynhlDgWQLJF3xROHWQc3Kl/RRwFSJ43w0XL20nPsOnrMrT6ZbMcr 7uMQLmOmdXX58D/BsmZ2fCFQvGguh5mwg7D13xEn37JomqIp1Vhity7RctmHW34t3IAK OqMFnd0nXbB6+a6cxdnQYvs/O4ejRnYAn/IfAoh2kut3koTirG6qQYeUJI5BsaqD0RIW DacqTGHVHFjVttMELpkKQaenzSGJfUffTrH6oO3ELBriy7rjEJbp9U0EJaS3RbvTRPOd fSPJj8ffaCsLer7EAUOy1suUN24xtYfMrprSWgejA6k+NsXwEQdE8ulmXeuwHpmNAEr1 D3Zw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LAsRT3UHnSw/gnSNp2Q3xHJfdBqwbXKi0Pb7j8g0LCc=; fh=y5fk6vguAkbcel7KoRWpitGO8B8BpGYTQpzSdaI/dY4=; b=DPDPyjruNKfyQRYz52HBbumyiiIvqd3ati2Ps1qtoqcObjITWwk6LkZ4N4YGfFDkRw K1i0yyu7eTai8YkIppNBmvTW+Q4qmqdQMB6T/2tQHL5wrpyB1pevf3IyNXqDFnID0VOe xezy1nXWFz3Zv7kPzIOuZbK4V+zykDIrnGrkmx7wcxzZv9aoncZhphkAJsy+Zv3ebUIz lRHgM0uKZpZZL29t1eDsymL8uHqMPegkStVG+Dlz5Vui7QkBh5feAA9ijurqDAKAzuNL VPr3iM6iBRCTj+OmrAMxcszD4kBEc0hKAsVPwxCAC6uJ5c8Hhc9Stezbruy5bXYQlYd6 qjhQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VbdVPkz0; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-34790-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34790-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ga8-20020a17090b038800b0028c5375ed45si9495771pjb.35.2024.01.22.22.38.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 22:38:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34790-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VbdVPkz0; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-34790-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34790-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AE179B2249E for ; Tue, 23 Jan 2024 06:34:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65F8A5A102; Tue, 23 Jan 2024 06:29:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VbdVPkz0" Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31F5459B6F; Tue, 23 Jan 2024 06:29:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705991389; cv=none; b=iCuqSzWvWPleSCk02G/g5LNf5cEoQq4fxXDJ+Ln3ojZEQG2zZ5pBwNh3e/qz8TbcaAYqraM3KThOICK3yg9jZrWqUaw/F10g2OZRlhf/Lnrb6oxlsPPOrz77KNTJrnbbQ+DHtE12KO75Hw1DL2OjH38vgeQ61IYaDqhiI6LPKz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705991389; c=relaxed/simple; bh=IUqprA2TF0JnjmPM0nXsYSs+9jyX8T3LPFUNW+ZA+gM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bfQbUb14Moy/nMBUrhtfEeMfy3LrxIqDbRtn4gCmEiiLj96gMvKjMtlvlegeDI+C4g9UFjlO6fmCp3UVMg/zsFOFMRB9f65pIDa4NLOcQ8V48oDXeOuJFth2aE+fz04UcYb+EAbJ7+dTFHK4jqCykFo6ypTZaAI8i0G5B0agEHU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VbdVPkz0; arc=none smtp.client-ip=209.85.167.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3bd7c5b243dso2860956b6e.1; Mon, 22 Jan 2024 22:29:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705991387; x=1706596187; 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=LAsRT3UHnSw/gnSNp2Q3xHJfdBqwbXKi0Pb7j8g0LCc=; b=VbdVPkz0nXRFsnXt3aLNXC9iSiinHvfEs/Ph8aB32LCBi9swHpErlA7N8+dXol0l0e QiusWCzfIScfHHUr0fHzoE2nqgIkR8aIloOgncXBsfY3uaQluhYzTeyYRku/flQjTjAA dfMjAR/jCu93b4M2nApWhiilGN4x2KjFGJg3bq2bU9SYquh0GQ1oadVHwUlf0TCZe3Vp kqPycCquXiQkSJqi29cw547sgkWy6NLZyCcrFPSaDp+i05CASOHv7pIXsA+S0QUIZ0OB cj8uokmBZmyolxi5YF7vhM2x7yi/pJRTzuEK1HcLuPmWRQmoukDwHrg5AyFFnKlPvFF9 kMTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705991387; x=1706596187; 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=LAsRT3UHnSw/gnSNp2Q3xHJfdBqwbXKi0Pb7j8g0LCc=; b=JrwwwKueFqNmkEDztoGkjUQ1/Rp+AheXmfvrKn9nLwbKjV/EibHjmzZZVxs+yE2+XK qDGI6/SL4t30XaiS82B2MFx8Z+BDNLr2/lkFODOlWx5kq9lt3Rtmvx5p3+bgJP2s+rFp Cs6+fEkmVMiXhmhO4fkq4NiHDcnjPeY6/Zr5AQFF/H3QuEq/YhQAzarh1SuZ9O+yBVhW e7e1Y+PAC8slD3DWRLrFLGr0JWYBpAAGQsCPkIIncqebE8//QfC06augupc+RtfPLjkh DEZTPvgc7B6wenPJG6gafX/MTJnU0SGAtrbM8Yk06BVmjIqoBRFj+3XzrJ2A9if7/xCm g0bQ== X-Gm-Message-State: AOJu0YwhcTiA/lK2yYmBUQ2w2krLTmY2gZj0Y6BcdA8rzkNm3ezqfy/0 64vY5Zgkg2v2VW+OdVqkCITmbPcih3tQyxbmgWbAozKgSSe2ei3j X-Received: by 2002:a05:6808:3192:b0:3bd:729a:774 with SMTP id cd18-20020a056808319200b003bd729a0774mr7617803oib.50.1705991387314; Mon, 22 Jan 2024 22:29:47 -0800 (PST) Received: from localhost.localdomain (2001-b400-e2ac-a4c6-7d2b-d8b3-ed27-1f50.emome-ip6.hinet.net. [2001:b400:e2ac:a4c6:7d2b:d8b3:ed27:1f50]) by smtp.gmail.com with ESMTPSA id l10-20020a056a00140a00b006d9b2694b0csm10595188pfu.200.2024.01.22.22.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 22:29:47 -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 V14 20/21] mmc: sdhci-pci: add UHS-II support framework Date: Tue, 23 Jan 2024 14:28:26 +0800 Message-Id: <20240123062827.8525-21-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240123062827.8525-1-victorshihgli@gmail.com> References: <20240123062827.8525-1-victorshihgli@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788862145535482929 X-GMAIL-MSGID: 1788862145535482929 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 e1f47d252b06..f4c0102f9a33 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