From patchwork Fri Nov 17 11:31:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 166121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp460075vqn; Fri, 17 Nov 2023 03:33:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdiyH4sojrvoVjVjGhKAp1tkF1hfyfdYxdLSaCjyP8Kmh5eeSV3+FHDZOydoNSp+fZaKbs X-Received: by 2002:a9d:7dc9:0:b0:6d6:5577:4928 with SMTP id k9-20020a9d7dc9000000b006d655774928mr11171662otn.35.1700220790411; Fri, 17 Nov 2023 03:33:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700220790; cv=none; d=google.com; s=arc-20160816; b=CpFsRZ1FLJ4j0vqfTQVDm6r1YbP94gD8eR2fDPxqPQAObUOb6JyLfow9jima5Yqtcy PVzhcYQvMiz4Oza+X4YFF331NPOvYFF0bsMVhF+pJ8y1Qp3Fr0bbHz8jf4xnwATjggd8 AH90EyHAyPClKLn9HWiG4zaYQd9vmBjbqVB/WoDzSP+2VmJv7yVXE6dwOhZVd4mcq1m0 0kq8jDmpkTn+tRE85IuGh+2U1tfpqcygS3iri91CeJYX6a11WLCIT3/aRWhUESO5iE+r MJKMAZPEtH1L6CztL33BS/YWdYYNlsE0kePU8579yi22HGJaRMlcBgWG+YIRPihIeGlz 9R5Q== 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=yOtRLRGkXxx0VmodeVlJit5RooY/9FqLm/ivq6a+Pf4=; fh=y5fk6vguAkbcel7KoRWpitGO8B8BpGYTQpzSdaI/dY4=; b=Id2CW9nE7Fbo4VZhG7VXvy0B8nl6ZrBiiVOjULF8awcWBwQiA4v4gW2RynnK5OJYv1 JlAVrwPQq//+SmmySMnjbsQXqUDLgnciya4XoFVa7fovfvDTwYojXxvWSc07BuZbabYm XXLIJs309erLCKE2Q/821c0itU6KeeefY3DLs0o29T37l5yP1bpuCgxkvJ0gzlCKnTfp W9LDhZYXzcvbXEDGd9iHwY/kaRV8ZjD4+NRWOoglmaRhIjqrOD4O7Ao3tvdvxUpjRHC3 uHqU1/jT4ZNq8Lfd0iSRN3GTX08C9H9647XP4AI7zNTKSIoJxEFlGYyQuKokExfCMAmo wQZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nJ6LwaYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h37-20020a635765000000b005be1ee5be76si1668149pgm.373.2023.11.17.03.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 03:33:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nJ6LwaYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 0A0AD8294B4B; Fri, 17 Nov 2023 03:33:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346032AbjKQLcu (ORCPT + 30 others); Fri, 17 Nov 2023 06:32:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345989AbjKQLcn (ORCPT ); Fri, 17 Nov 2023 06:32:43 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B6BB19AA; Fri, 17 Nov 2023 03:32:26 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6b87c1edfd5so1670433b3a.1; Fri, 17 Nov 2023 03:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700220745; x=1700825545; 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=yOtRLRGkXxx0VmodeVlJit5RooY/9FqLm/ivq6a+Pf4=; b=nJ6LwaYIiQTVFrh9nxMyvOmMv6jg6/yAl6+3zDJC5QIfR7FC4w2PJ8NymYTVfGZCgf FvqaT0P1JcrG7B5lvxwg/HVYoYDyjiXN2VVB744NZZFW7zHM3fORYeXnbWUFToLrc/82 Y6XlrUBPoI2r1vFAkCKkRkbWqhvigqZz68TvHjAmD9SnYFYSyffngOqxUTtB+w2CTT1J 7YjKXgreI+CIz7r/J/hcsyniNA7ldotXZ6AKgEYLJPkb0SXiV7x31KqMOk/HdsWaaJrV SUr8Gip1LZ1m5Exmmy0ASDNlH799aaPm7ezUUn0TxY+WV9SFf9+WYq49Y6vQcjYX11u+ ggpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700220745; x=1700825545; 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=yOtRLRGkXxx0VmodeVlJit5RooY/9FqLm/ivq6a+Pf4=; b=BJDSKlIlzD0i+UgJlSy3FWm8nQtOmh7RgvXtupoVl9RsLbwj45GRo+JyAzqB39I/ow wFWPlb+B+kC7fkcNeMMcnO6j2KDaU2W87yTRWm010z+lSuX6qfOaPGh35xEZeSfT+cfo MedHzF9HBBb960ChtCOuk0e7cuqGQZ3lBCpfHxvhGIT/xmQnU95zitUnjfg64LOave66 nU2rTWhbD5Y0+HFAGlbMJnDZYx7nnTnP7MYtB2fr7Oi8JiyGtKYywE9DpPSDpwlOFsVa hGFQN2R1zb/JrVVzvQw3j/b6q06Y4I+nby1h3a3qM0mqAfcqlFRtA36UBIdaiFhMo70+ H+8g== X-Gm-Message-State: AOJu0YyVYdGjD3aBZp3vCrmvmsRWmqV/+ev+N61qD/G1HDc1pTD/bLjQ 7lQJ7N7n6AI/ZD6A16lN914= X-Received: by 2002:a05:6a21:1f05:b0:180:d33d:9256 with SMTP id ry5-20020a056a211f0500b00180d33d9256mr14551583pzb.58.1700220745442; Fri, 17 Nov 2023 03:32:25 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 03:32:25 -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 09/21] mmc: sdhci: add UHS-II module and add a kernel configuration Date: Fri, 17 Nov 2023 19:31:37 +0800 Message-Id: <20231117113149.9069-10-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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 03:33:09 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782810715892976817 X-GMAIL-MSGID: 1782810715892976817 From: Victor Shih This patch adds sdhci-uhs2.c as a module for UHS-II support. This is a skeleton for further development in this patch series. This kernel configuration, CONFIG_MMC_SDHCI_UHS2, will be used in the following commits to indicate UHS-II specific code in sdhci controllers. Signed-off-by: Ben Chuang Signed-off-by: AKASHI Takahiro Signed-off-by: Victor Shih Acked-by: Adrian Hunter --- Updates in V9: - Modify the commit message. Updates in V8: - Modify MODULE_LICENSE from "GPL v2" to "GPL". Updates in V6: - Merage V5 of patch[7] and patch[9] in to V6 of patch[8]. --- drivers/mmc/host/Kconfig | 9 +++++++ drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-uhs2.c | 46 +++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 drivers/mmc/host/sdhci-uhs2.c diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 58bd5fe4cd25..46a722270ad0 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -98,6 +98,15 @@ config MMC_SDHCI_BIG_ENDIAN_32BIT_BYTE_SWAPPER This is the case for the Nintendo Wii SDHCI. +config MMC_SDHCI_UHS2 + tristate "UHS2 support on SDHCI controller" + depends on MMC_SDHCI + help + This option is selected by SDHCI controller drivers that want to + support UHS2-capable devices. + + If you have a controller with this feature, say Y or M here. + config MMC_SDHCI_PCI tristate "SDHCI support on PCI bus" depends on MMC_SDHCI && PCI diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile index d0be4465f3ec..1a7c8abc7891 100644 --- a/drivers/mmc/host/Makefile +++ b/drivers/mmc/host/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_MMC_PXA) += pxamci.o obj-$(CONFIG_MMC_MXC) += mxcmmc.o obj-$(CONFIG_MMC_MXS) += mxs-mmc.o obj-$(CONFIG_MMC_SDHCI) += sdhci.o +obj-$(CONFIG_MMC_SDHCI_UHS2) += sdhci-uhs2.o obj-$(CONFIG_MMC_SDHCI_PCI) += sdhci-pci.o sdhci-pci-y += sdhci-pci-core.o sdhci-pci-o2micro.o sdhci-pci-arasan.o \ sdhci-pci-dwc-mshc.o sdhci-pci-gli.o diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c new file mode 100644 index 000000000000..608f8ad5aaed --- /dev/null +++ b/drivers/mmc/host/sdhci-uhs2.c @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * linux/drivers/mmc/host/sdhci_uhs2.c - Secure Digital Host Controller + * Interface driver + * + * Copyright (C) 2014 Intel Corp, All Rights Reserved. + * Copyright (C) 2020 Genesys Logic, Inc. + * Authors: Ben Chuang + * Copyright (C) 2020 Linaro Limited + * Author: AKASHI Takahiro + */ + +#include + +#include "sdhci.h" +#include "sdhci-uhs2.h" + +#define DRIVER_NAME "sdhci_uhs2" +#define DBG(f, x...) \ + pr_debug(DRIVER_NAME " [%s()]: " f, __func__, ## x) + +/*****************************************************************************\ + * * + * Driver init/exit * + * * +\*****************************************************************************/ + +static int sdhci_uhs2_host_ops_init(struct sdhci_host *host) +{ + return 0; +} + +static int __init sdhci_uhs2_mod_init(void) +{ + return 0; +} +module_init(sdhci_uhs2_mod_init); + +static void __exit sdhci_uhs2_mod_exit(void) +{ +} +module_exit(sdhci_uhs2_mod_exit); + +MODULE_AUTHOR("Intel, Genesys Logic, Linaro"); +MODULE_DESCRIPTION("MMC UHS-II Support"); +MODULE_LICENSE("GPL");