Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp267640lqp; Wed, 22 May 2024 04:14:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWK71uXE77MhuGgjTS83XgAScNsNTNy+SVcHaDmsk5mHayZ+yYhsp1lFl4MSWdDkh5c7WYqgs2TxqmrE4QdTlKfhfoAWwI4Drvbg2ynfw== X-Google-Smtp-Source: AGHT+IFYkVQQRoC/b0mIB0xgSjkUuHifrSsq8kv9/jXae7KJUKcEbcQqcrqlo4PPJISDnJaxb8bF X-Received: by 2002:a05:6214:440d:b0:6a0:c934:56c3 with SMTP id 6a1803df08f44-6ab7f3335aamr14025146d6.2.1716376453288; Wed, 22 May 2024 04:14:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716376453; cv=pass; d=google.com; s=arc-20160816; b=I+TKDDRvIKOWCby5JQzsOsE0Wa1E+87jJH6mJ7e/8RkGUCVkbOYlF31ckCodZJjkZ/ FHxC5N3oUFZCrhuBZEF+f8uZr+PfijKYx0l5RCKqQkXb28P9cfChp/a3S5uS1+uc8zAn lkaJB9UBuha9evzqkzizjeIqC1JiCbx8b/ZkGTjc4AIQIsXJ1ChT4c3ItDgcjypwlQ4K gG+uy5Gqkwnx53IZOfhPVszVuVs5vzVQrxUTh4FwDgoT+EFdUULwnm/EXGSk86Gqwl8V tdi4+lgkolOaaInydSp8rB3MoBwYYdVpd4U/GDQNRdlN6Z/vozXY0FU2Uj0K+JCD3IWg pAcg== 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=q0cmjeO4AWJjXgxtd/DzrwOW0GDT9l0zaX03UCUQBXo=; fh=Sq1cD3RSLaqIlk++zVZ0At2ZtcotpKrUoa52Ae1QMsE=; b=eCT/B+I2aF9dHSCRuLsQw4HKwI07c4UbTnyDVGEegPJzycNWqMxITpZlu72EYcw4xi rCdDrqYlVPSa4xQs92gdER9KrjR2N6GQ7LhnKxJnP7s3ETf4D4AYB3KCcadBBOZqyXEx rXeuiGDtsKp4F7RKcaoa0Gd4b0g/lz6zxr5txotCS7vfUeWaiLJLb8kx3Un9gkRoDXtb ZDGoFVqeU19ES/nA/uKabPHB4A8VrhSDkuAUkLPnxMmnCMhfjfRTM+0fheu3xWc8FjPy BDfGi2PdIEURiIMiHzTI+vAz85TgVousz3KKfX36YVvOMxJP9iFRm7kXjqLDa8DHtv3v F23Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aOc9rZIp; 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-186116-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186116-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792ff449747si1602048085a.632.2024.05.22.04.14.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 04:14:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186116-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aOc9rZIp; 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-186116-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186116-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F0EF51C21C0E for ; Wed, 22 May 2024 11:14:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 567A985C68; Wed, 22 May 2024 11:10:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aOc9rZIp" Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 1BA8E85959; Wed, 22 May 2024 11:10:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716376238; cv=none; b=coKlOOZb4F8exGUquCen/kayFv9I1aoPYWMi7yAYRjJU7qmEGgFAPPsANbLQzBwUQHdjf2NFUBOF1GKp1lm5dSKWPZci4Sz64yDXNVaeaQ5C/6DDYyimK0mm/ikUMLPsjcVV4QA4zfztvqSVNCDMujq6AoOTbVZIfHhszfOVTgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716376238; c=relaxed/simple; bh=cvlHF+xMs1qsEOuNf3mwOC8mdfVM7AymMc1BF9fSZhU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kK9RaVCyrroTIDDJd5NFHGwRWuB9IpMH3ORY1WIN+phEQvtiuLuZHrje+EgqjuYcDbTO4dxyCAh/nA2rNcdauY6Ji2Nm5tWIcP3MNCMem+8PvcUAXW5qjS3EcN1a0gpomla0fVbbhudEPrDaOUdv6OGFmvz7AqyGVqe4gPFEqnk= 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=aOc9rZIp; arc=none smtp.client-ip=209.85.210.182 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-pf1-f182.google.com with SMTP id d2e1a72fcca58-6f43ee95078so2452245b3a.1; Wed, 22 May 2024 04:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716376236; x=1716981036; 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=q0cmjeO4AWJjXgxtd/DzrwOW0GDT9l0zaX03UCUQBXo=; b=aOc9rZIpwHX9KFtMuoKiKOget4SfEBLeZ/qxHUrBGbLFa7VriV5Rdlxrlbtw2vmkIP 2mFKoIYh1o84pyndQVhnJov2K+azvOZailmASt3xhve2+OiMbnYzETAoiIvky2eVhByS dYtrtNKV5FeL+Cc94S4Cp6RYUG3Ua5b7qC4vWbGlfSQxG0OcfxOQpjsB2NinoacoH23+ 1cEOIOIa8QUL2grr5lEYf6ZSTxsoIfudYpmLGxzEQOUqSsvU8e+yTWIngKANbiD5x+QR 3pJz6zn9pXahK4/dIeY7O7yhxBxkYt95D7iP4Uu4LC0irjFm8xGn0zWXrTB8oagAkHgv 26Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716376236; x=1716981036; 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=q0cmjeO4AWJjXgxtd/DzrwOW0GDT9l0zaX03UCUQBXo=; b=Cc6pA9VE5979bHbM/K8bdrUW/KWSeB+rwZLMfcZiMNv7b357RbklSGAmzo9VZ3eqt7 woHNXduLdLiTmur5+l5pUYzBgxY+nHwqoraMaWTOiUNm5nI+yyQNfPH65/dxUSpys3wD pOd1J977ekuZGJzZiJZptGGmY4EN6QX97DO/ioGkVTeqRyjsdeVggKTEw5ru4MFp0S2C PggBqxVVOOi/FVnmHXvQQ6t1+fBKCfRgr11CwgcwnzwAsNgK56YcPyIgw30MLDV+1Fjl i5Yh0bLfT4mACmrdjfIgr2HgxyR4CIKDJ3m9tBDXMj4UBDNNsvfperrStqwML1AbSNZj 1qgg== X-Forwarded-Encrypted: i=1; AJvYcCVR263MZ06gXebvhnvjjEKbjW0/wou4tgJDdc6orvg5NtC8CLHbTOLrpjjLbt85PhFSiPKsKRvxPD543JLmmuzcRoO+Ha+TzfKq7mAU X-Gm-Message-State: AOJu0YyUmK1bZRoSh+sfxHbj10avlaGv+udqLu/7rCKc2MOxXPZIvO0y D7WBPrx6LPaBflLoAn5AFq/wybRVdTYjWp3Svq2zshjhnglLymqB X-Received: by 2002:a05:6a00:a92:b0:6ed:21b2:cb17 with SMTP id d2e1a72fcca58-6f6d6089dccmr1690796b3a.4.1716376236322; Wed, 22 May 2024 04:10:36 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e283-0474-753d-295c-237e-167b.emome-ip6.hinet.net. [2001:b400:e283:474:753d:295c:237e:167b]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2af2a98sm22223760b3a.169.2024.05.22.04.10.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 04:10:36 -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 V16 21/23] mmc: sdhci-pci: add UHS-II support framework Date: Wed, 22 May 2024 19:09:07 +0800 Message-Id: <20240522110909.10060-22-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240522110909.10060-1-victorshihgli@gmail.com> References: <20240522110909.10060-1-victorshihgli@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 342bbc3ef577..7bd2f3c94e48 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 -- 2.25.1