From patchwork Wed Feb 21 12:45:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 204199 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1010901dyc; Wed, 21 Feb 2024 04:46:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXU1pAT1DWwVrcv/hZs2w8G0ItbzcS+VPQsjKMdWW62hEZSNvA8QycxNdAFhq8pVLWMXQ4TtexpVdRFRp87ylVZHy0s4g== X-Google-Smtp-Source: AGHT+IFjCZogIdiFLrgHtck2+QLsMfw5qPHHO1qImUCCHiVVa6grCa01fPvZ65b+vFQM20+tQyh3 X-Received: by 2002:a05:6a20:9592:b0:19e:5e0c:3bb8 with SMTP id iu18-20020a056a20959200b0019e5e0c3bb8mr26730906pzb.7.1708519618293; Wed, 21 Feb 2024 04:46:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708519618; cv=pass; d=google.com; s=arc-20160816; b=byk6PBzOAS06cHvw+YtvPKdRYkG287cCMAhNlRnogPvM0i6JEwGZnDhcFjKg9WLbwB cDbkguiMYyyr4RaDVdwuUBb89F5/WCVM6XnFqQBtpGrB7mWyhSd+ubgS0s961/Aq6kFS PFO/Jf3/+bjLb/ZWDKzigbHN1rB2+IvEs8mKwMTj4N9lBnZIoziI5CkiIe8hg0q/ZfrI bB3Sj53NtGjvGL/CJ+U+1E/DLgXpHwfZ0mYMugSV1L/zafXbTkU6OMJ5WeHlCwR3/Ze3 5iqeDtRfXun6HFGuW9AX7Ug4Vwm5Afaw6qLGMx9bEjsZ6+HFG1Q5/XWrURTsT7gG2nVZ g1EA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=vZalForvHei8jpe6YNnnfmD+IMTFeygGcVOhhwDaDy8=; fh=ScmKGkB+o6eWxKvOBe0xvbxfQnJ1f7X2wms+WF2DLho=; b=QyDUfnk/I3jg0gV8NbmptI5tApwIz6hYFlMQZgW57xfi8+OoSKWi3P8JsWawFLzBi8 20XaYFLjZ9LbPNE3yj4eswJJ5WF9euG8ZD414v6yY6mexC6JWyNHmCARD90tGl0XgGgu l5f/SOLhhzBVdzCcVN3NEkihBUKzfmbCNH6loxdSX4BPP3xCcJ+pm5sdu4ye+pvdmQOS T+B1/Yr7m8LIXvc2oPxgfEAJBa2GxkGu2hLj/ptnJ5UZvXoMdOYsXdeTz85mzEZXBpS6 gkHuR6VfxdMOEf7s/aUu6+H0Z3UO4mue0e4pd1waDUAmzcZFJp0MWGjkTuWA09+GqJnQ 4rcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FrHNRFpE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74714-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74714-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 81-20020a630254000000b005dbf03af371si8025547pgc.84.2024.02.21.04.46.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 04:46:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74714-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FrHNRFpE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74714-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74714-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 20746282C9C for ; Wed, 21 Feb 2024 12:46:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF3B9763F0; Wed, 21 Feb 2024 12:45:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FrHNRFpE" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0C0055E5E; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708519547; cv=none; b=SmLpuRhxjt0+/R0GcmmH9w5+4zH9cYLNKgMVTXEty6vKEynVOR8VQ32rPITack763M0GQg1ASec2F9+e+YJ59JWK/BjyfvqIVpWvvTP6woGitnW7xB+fp5YRe426+dG2EF1JpFMidXR394YrlE4uwTUO1K6u73bAtybvZSHZDLQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708519547; c=relaxed/simple; bh=heYg83dxzIz5cujo+bOCWW+22F7pnM8vLF2xYH8yigk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j7nvO8MFNbKNpyOf9wDQ5VKwRcOYT268yt2243AMCj7+BQJzPHZcLXRysUc4kxEfWrROawNgrKaQ/ErNcXdpi/UOi8Jld0M7/waO2m4lECb3H/rkWtNYkmEbE7+TP+HhwCpDETpvYlK13fOO6uyOdxO3tTxibqYxuspTqy+ZaMk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FrHNRFpE; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 9B128C43390; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708519546; bh=heYg83dxzIz5cujo+bOCWW+22F7pnM8vLF2xYH8yigk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=FrHNRFpErUixwSTv1op26ZQBpnMLFQ3fP3nig0ibjLRpIEDogQnSN7hECIozbXSWZ T5aZQpJ/Culk89pTNwqKjZALPhX0liwcbzhEnGnTWSWNOrcqP5jDoZrdPuBIEuMUG7 TQT/Bz/X4HLAze5iqNUxyvS/tFv8GWKtoYgkNNBwtClkHtkfQyO1HW9zana5iovB6P eXbhktZ2cpnXtbnym2bCcwZsSJ/xzxMhodohOZfjUWcsFwsWd9UY/5W30eQPwXn+GN f5nTTL8QPsQxd1bL3sEQRFG1MDwVgn2y8tpvrhNxOm+u7OC39zgcmByRhRReN8/nRt yXF6GiW8cEsYw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DC5CC54787; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Wed, 21 Feb 2024 20:45:03 +0800 Subject: [PATCH v6 1/5] mmc: host: mmc_of_parse_clk_phase(): Pass struct device * instead of mmc_host * Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-b4-mmc-hi3798mv200-v6-1-bc41bf6a9769@outlook.com> References: <20240221-b4-mmc-hi3798mv200-v6-0-bc41bf6a9769@outlook.com> In-Reply-To: <20240221-b4-mmc-hi3798mv200-v6-0-bc41bf6a9769@outlook.com> To: Ulf Hansson , Jaehoon Chung , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Andrew Jeffery , Joel Stanley Cc: Igor Opaniuk , tianshuliang , David Yang , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Yang Xiwen , Paul Menzel X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708519512; l=2509; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=JGOc4wQUSQd78IPQsA2tfrngj58AF1LgtdpM/cwsBoQ=; b=c4GmQZZ3Slqtar2uJ1DMwVC7+FRQXQaD2Zw5JwLUYyAjLFGVbDWeNinqCrhzsB2uMK801vC0j /Q6fsXVsB2xCmGcV+GUV/rrg5GBFyPVGfx2E2Ym9eNMkdJ44u9iAVkX X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791512667537045294 X-GMAIL-MSGID: 1791512667537045294 From: Yang Xiwen Parsing dt usually happens very early, sometimes even before struct mmc_host is allocated (e.g. dw_mci_probe() and dw_mci_parse_dt() in dw_mmc.c). Looking at the source of mmc_of_parse_clk_phase(), it's actually not mandatory to have an initialized mmc_host first, instead we can pass struct device * to it directly. Also fix the only current user (sdhci-of-aspeed.c). Reviewed-by: Paul Menzel Acked-by: Andrew Jeffery Signed-off-by: Yang Xiwen --- drivers/mmc/core/host.c | 4 +--- drivers/mmc/host/sdhci-of-aspeed.c | 2 +- include/linux/mmc/host.h | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index cf396e8f34e9..8b2844ac5dc5 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -234,10 +234,8 @@ static void mmc_of_parse_timing_phase(struct device *dev, const char *prop, } void -mmc_of_parse_clk_phase(struct mmc_host *host, struct mmc_clk_phase_map *map) +mmc_of_parse_clk_phase(struct device *dev, struct mmc_clk_phase_map *map) { - struct device *dev = host->parent; - mmc_of_parse_timing_phase(dev, "clk-phase-legacy", &map->phase[MMC_TIMING_LEGACY]); mmc_of_parse_timing_phase(dev, "clk-phase-mmc-hs", diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c index 42d54532cabe..430c1f90037b 100644 --- a/drivers/mmc/host/sdhci-of-aspeed.c +++ b/drivers/mmc/host/sdhci-of-aspeed.c @@ -435,7 +435,7 @@ static int aspeed_sdhci_probe(struct platform_device *pdev) goto err_sdhci_add; if (dev->phase_desc) - mmc_of_parse_clk_phase(host->mmc, &dev->phase_map); + mmc_of_parse_clk_phase(&pdev->dev, &dev->phase_map); ret = sdhci_add_host(host); if (ret) diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 2f445c651742..5894bf912f7b 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -539,7 +539,7 @@ struct mmc_host *devm_mmc_alloc_host(struct device *dev, int extra); int mmc_add_host(struct mmc_host *); void mmc_remove_host(struct mmc_host *); void mmc_free_host(struct mmc_host *); -void mmc_of_parse_clk_phase(struct mmc_host *host, +void mmc_of_parse_clk_phase(struct device *dev, struct mmc_clk_phase_map *map); int mmc_of_parse(struct mmc_host *host); int mmc_of_parse_voltage(struct mmc_host *host, u32 *mask); From patchwork Wed Feb 21 12:45:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 204198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1010880dyc; Wed, 21 Feb 2024 04:46:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU8KY5wc6mNm6pYoa2xsqIa1XyRkMH2TQeSAlbA1MJoi/robe13yLsfKYLfSU507i0ZZv0yLMk/7CKj7eNd+UtS9JkpZA== X-Google-Smtp-Source: AGHT+IF9kzRMA21G8I/Hi7RCjbtZFy1kpKSIf4ybbSxJrraahImgmZZxK6InA8458+wU5wpXLjWx X-Received: by 2002:a05:6870:1697:b0:21e:65ff:ad82 with SMTP id j23-20020a056870169700b0021e65ffad82mr17469521oae.35.1708519614090; Wed, 21 Feb 2024 04:46:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708519614; cv=pass; d=google.com; s=arc-20160816; b=J8UpeIyZjXfvR7XFa5iu0ZtnoomhUmOyaQa+HjZzaiMKz3fmYkNfV63ZS7QCXwTiY9 fTznTAGsU4fQXYFHyEFyjDKWnIobSUwF/H3qgBJTDsstogQ0I50q8bp0JqcSjxg2PXlC 788gk/R79TLONWtYmqEH1vwQs5+20CWr5Q5kgGubu7TOU5nU02fNpRWyhOB5kJ8ZQArx rPU3jygGKwspaSgj1JQgSHsACq6Onm2tuDgc0KlLS7n2ObKjD+JRDbGgQw6y5v8vJApJ /5W89lF/EIjOrbn5zTknmS2/Ezimq4XgYvSbWFjBwpkQXqELrpxQEG6jB5mkdvHdBeDj 0cXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=r5LAeDafp6SlV51FL4IFDbVVSVdllmf4Yk3bxC0Buqc=; fh=LRQm+9myFkSXQ8D5tIdaKodUsw3dcE5JVwiW6yUZYPA=; b=DPu6W6Oq/kSykr+XD9dIvSTmt7aFRcGSEKCsY9i/mzy3hPCBWOw8BSYq0M8/Qubznd fBmgGoBROe1VTeFn9PU/ULf6Ge59rU9yjUw99dn7rG987N2vRdD3K3PGF0Mm4bIA9stL 89r87Big5yltpXEQYkON0szZWDL6+zykS7ZXsaDK5G6SEF94LVKvKWdfXDUUSooiadi4 yRzRtXVzsEri7nx+fXddN4tsByIQwvQBDBr/+PF9kFEimkPIsZjF3BMzJVZkx8Mf9jst PntSzijbAA1rBNqfubYYgISAgCCNjz/mXEbESZgfpoa6AIgRoEY8iNx+eKvujRjrwCUQ 2XMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Mfbdt/tz"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74713-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74713-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bn16-20020a056a02031000b005dcc8a4590esi8423495pgb.680.2024.02.21.04.46.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 04:46:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74713-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Mfbdt/tz"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74713-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74713-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D546328275A for ; Wed, 21 Feb 2024 12:46:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 98FB3762C1; Wed, 21 Feb 2024 12:45:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Mfbdt/tz" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0BC952F8E; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708519547; cv=none; b=DxTDbK4estL5ItCYFBOwx9gbfDSz/zp8w4DMBRhI3HEm37aUOmXsQfIxpoVJbmdo1/yc21UiZLYqzwAUYvNKvXKRym3WYAQFyLpxKcb+W2h+2PNzwDaQ+QbEwub1iPA1t/Q+dmsJmFGGl2ScfG5oPZdngY8LBQDmRRDBLyBjLFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708519547; c=relaxed/simple; bh=uiy23fzx9AJKJeZCc+CpWKPnHutJKS8U/tiBSjzkWs4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u77i3HdBlHjhRMYMT0BDDy93CCIdOj3AjsYF4BXe2GoKrfMRwQDN4HRFOaK7SK6WBlQQUUooX5/ZvROpjn/o4KbhM7QnDOIPUAWl0ExwiOi+Sni8w2g1OXhvLjlLoLw69juVFF9PF6Mem8Kf5ViXYCX08Fujb5+YYabwwBrufuQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Mfbdt/tz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id A688DC43394; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708519546; bh=uiy23fzx9AJKJeZCc+CpWKPnHutJKS8U/tiBSjzkWs4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Mfbdt/tzKycr73ZDAk7GADyV0VOth8+8m2uJuA/FWjrY8NWMxeL+k935y8/94xl/L UzOFwT2yPLro34Zht05MDR34hSmnhXRbgpcWAKYiR3d7xqOCXCvQpgq2VQepHj5T6f Zld4xNyhZ9qvWR4IP79yKwx6nTcgAOHW0zg5piIVVPprwgdHFPSsl85eP5VGufMxrH Prm9nDLYqEsFNfUkUP295KwIiWxXTruPpEXNsdw6cjw0zaqU+PdkfCtz7/l/K7eIJA RwvwaWOgEB0E1TqQiqqmJBbYGLHw9sMjv6gP/8Y6PIyY92H1tRcasdZtxurivifSID GilK9MR2xPS9g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D3B6C48BC3; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Wed, 21 Feb 2024 20:45:04 +0800 Subject: [PATCH v6 2/5] mmc: dw_mmc-hi3798cv200: remove MODULE_ALIAS() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-b4-mmc-hi3798mv200-v6-2-bc41bf6a9769@outlook.com> References: <20240221-b4-mmc-hi3798mv200-v6-0-bc41bf6a9769@outlook.com> In-Reply-To: <20240221-b4-mmc-hi3798mv200-v6-0-bc41bf6a9769@outlook.com> To: Ulf Hansson , Jaehoon Chung , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Andrew Jeffery , Joel Stanley Cc: Igor Opaniuk , tianshuliang , David Yang , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Yang Xiwen , Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708519512; l=722; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=MzqKbWX8E5l9h/hzBiWtMINHXtoCtQN0jkOqsqOv7OM=; b=2Hrl+eLmAWmN7TCgsrVHwExtTo6VrvpDNenLFev/0tw/H338tnvC1eUX+jbpCNdr+nprr8WXq HlUAHWGYwrMD9OxFqjIbDP3scqJvug/u9CuEfP39mxQlJbkj+p4Kers X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791512662992299893 X-GMAIL-MSGID: 1791512662992299893 From: Yang Xiwen The alias is not used and should be removed. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Yang Xiwen --- drivers/mmc/host/dw_mmc-hi3798cv200.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc-hi3798cv200.c b/drivers/mmc/host/dw_mmc-hi3798cv200.c index e9470c50a348..61923a518369 100644 --- a/drivers/mmc/host/dw_mmc-hi3798cv200.c +++ b/drivers/mmc/host/dw_mmc-hi3798cv200.c @@ -201,4 +201,3 @@ module_platform_driver(dw_mci_hi3798cv200_driver); MODULE_DESCRIPTION("HiSilicon Hi3798CV200 Specific DW-MSHC Driver Extension"); MODULE_LICENSE("GPL v2"); -MODULE_ALIAS("platform:dwmmc_hi3798cv200"); From patchwork Wed Feb 21 12:45:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 204200 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1011056dyc; Wed, 21 Feb 2024 04:47:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVbHZb9Ik5VeWEu2IQQZyOM38tsYDQssBvRAGQ2i4Y8cEpItiI+Qpr69xk05ZtuL0rPdO0sldsvijIzA+k/1ceVOvHQDA== X-Google-Smtp-Source: AGHT+IGVpMZNotOQ7GgBTugA2gFLFGPEmmBHr4HsM+hmxFKz8cOqk8RJhVJrWc4vuU+E1JtB438d X-Received: by 2002:ac2:4c3c:0:b0:512:ba43:ef1b with SMTP id u28-20020ac24c3c000000b00512ba43ef1bmr5040096lfq.49.1708519641908; Wed, 21 Feb 2024 04:47:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708519641; cv=pass; d=google.com; s=arc-20160816; b=KtTJBJZ9iRPq2W8RcGFOd+QnaSC21Xelw8d9rMLF8k9cdR+1m4vHK/44s0eQ+UoWrV HY78wotxtRODGB4aJzO67bGB0vKjAMCntZaHnZAZwEwnqvI/gYa4ogrw6nGdREwpo4cG ggJOZAUowmNMY7C7A3hZCojsKOp1VNqEH4SR9y0veuEW0HxvCyr84a4uIcb21zw7t66Q MHgKs3eHK1LjYsZWuJcvhH8IFq8H4cf2ZIXmwfylwHn6IqNdS6NKZhc6CX3U4hFTiAKl q2ifqKK5Vd/VHG/IQcEtjZrDoJlRLS/fKnhm80MbgUw2dvyhxCa1NMkTsl05nm8nP/UF klEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=Kk0pM4z4c//xSdjz4U/zVx9EPvb/S1xQy5inntB7UsU=; fh=Xfnug+R8z45R+wEtlUxD/AUF32aH6IsyrU8Qk5W9nOk=; b=CJDQU53AeASE3Df/bggY7ll5A7u7fBiGt1YlPSBzfuFExHaQUczrO/soWCtWJ1CAxA 28kyaWV/nc/V7Z1hZRGZ52vgjKkMbvot617l4ICPPNm4Kr4qQ56JSxLI3h07Dw3FBytK yypEAeSwugXWy9K2QIrZpPHvj1bYwkCk03kGhwoGJSTTS/yIxbJeYGTj/OfKNwgeR+oA wqUYtcgbVoAQ56W1kv+FVXcCg104Knmu2mJ6W4iwwoYiY19IPF4SU1zG8XwUs+CADrJv D3w8EIs3BnyBOTgxyr2L3XQ8nt0jY9U8w5UgyFjBU2hxjLdhFSBc1+Jcr5q09kHuPEZr SPIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KKzdxqBn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74716-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74716-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c7-20020a05640227c700b005649f07d1easi2435448ede.687.2024.02.21.04.47.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 04:47:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74716-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KKzdxqBn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74716-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74716-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 47B761F22AF2 for ; Wed, 21 Feb 2024 12:47:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 274CC77F35; Wed, 21 Feb 2024 12:45:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KKzdxqBn" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1019469319; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708519547; cv=none; b=mUqvWfNzopMonhU/7RMMWIC8vLUjSMbfB1+Vv/aRIXNlnMpg903iCEAt8YfLshb3jyJso2KjooDxTHY0l734UW4lxIUhvYhIKqFAZY1FpNzu7RUE4sI+ELeafjELuofvtxdeTdP/7oTt47/XUrOMYE3KZaNexSF2EG9Bv/dnD/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708519547; c=relaxed/simple; bh=u4vpXIR6YpFDOXxvm1QRh4p+LNt6YmfgCM1kdJlQxAo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hiqfDOP+P4t6bSgACUnDdhzPufaQTxvH469R8jWtsfXUXFqerVvwExRVfdButt2kzfQmKhRKh5x79FfRDUZh9s7fZZoitCA8+n3Hf5t9SnKu0NUJYy6Eo2E3lqECKyU/WrFBhYKMloFL9Um0qLse5SjuaCtCmVrxkT5ptJZ/I30= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KKzdxqBn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id B5BC6C433B2; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708519546; bh=u4vpXIR6YpFDOXxvm1QRh4p+LNt6YmfgCM1kdJlQxAo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=KKzdxqBnGtbniHN4670+G+tsomcpye0kFKBTdrDEcocqmAOhYBrpilqk21mQ7//So Tf2zUBLvEgRBL7/XIUhUJC3B6Bf5AfqXAbG8QxXDgw0io1zdT0dse9TEwBZnd3IrGa kvgVKVTsdpGjn3I1VRAau0yU/OckCGw1hCZ7DSrEIMDgrke+/8wNY9blPULWrfauek 8fg78qZQBb8hkYg2T9s1inE2ex8GNrFcRuC97gT/5XwXiPndHVCyRa5tyFVhmoK3v3 zzEWRYDobeZkh/NssyWo9BvpWqDdstpjtC86qLCUfz3jfK7M7mASyD74WXGhSCpJZK PJIj4Zpf5zo4w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D6FDC5478A; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Wed, 21 Feb 2024 20:45:05 +0800 Subject: [PATCH v6 3/5] mmc: dw_mmc: add support for hi3798mv200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-b4-mmc-hi3798mv200-v6-3-bc41bf6a9769@outlook.com> References: <20240221-b4-mmc-hi3798mv200-v6-0-bc41bf6a9769@outlook.com> In-Reply-To: <20240221-b4-mmc-hi3798mv200-v6-0-bc41bf6a9769@outlook.com> To: Ulf Hansson , Jaehoon Chung , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Andrew Jeffery , Joel Stanley Cc: Igor Opaniuk , tianshuliang , David Yang , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Yang Xiwen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708519512; l=9080; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=VWClb6vzYk02WnyIr07Zo0x0wPmet1IIxC7XxdXuqqw=; b=npLWqA6ijjFBXG9IQiTQlbpfqa/5k6A0F7gkTEyahZEaaPqQLcSZBis1jAMGGeo2Y6TdNluPs Vl+rs2ugndZDaZEVlCSlpbnBvm6Rjvg+lnqy1mEerWyY4crYPUythV7 X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791512691879117920 X-GMAIL-MSGID: 1791512691879117920 From: Yang Xiwen Add support for Hi3798MV200 specific extension. Signed-off-by: Yang Xiwen --- drivers/mmc/host/Kconfig | 9 ++ drivers/mmc/host/Makefile | 1 + drivers/mmc/host/dw_mmc-hi3798mv200.c | 239 ++++++++++++++++++++++++++++++++++ 3 files changed, 249 insertions(+) diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 81f2c4e05287..aebc587f77a7 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -798,6 +798,15 @@ config MMC_DW_HI3798CV200 Synopsys DesignWare Memory Card Interface driver. Select this option for platforms based on HiSilicon Hi3798CV200 SoC. +config MMC_DW_HI3798MV200 + tristate "Hi3798MV200 specific extensions for Synopsys DW Memory Card Interface" + depends on MMC_DW + select MMC_DW_PLTFM + help + This selects support for HiSilicon Hi3798MV200 SoC specific extensions to the + Synopsys DesignWare Memory Card Interface driver. Select this option + for platforms based on HiSilicon Hi3798MV200 SoC. + config MMC_DW_K3 tristate "K3 specific extensions for Synopsys DW Memory Card Interface" depends on MMC_DW diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile index d0be4465f3ec..f53f86d200ac 100644 --- a/drivers/mmc/host/Makefile +++ b/drivers/mmc/host/Makefile @@ -51,6 +51,7 @@ obj-$(CONFIG_MMC_DW_PLTFM) += dw_mmc-pltfm.o obj-$(CONFIG_MMC_DW_BLUEFIELD) += dw_mmc-bluefield.o obj-$(CONFIG_MMC_DW_EXYNOS) += dw_mmc-exynos.o obj-$(CONFIG_MMC_DW_HI3798CV200) += dw_mmc-hi3798cv200.o +obj-$(CONFIG_MMC_DW_HI3798MV200) += dw_mmc-hi3798mv200.o obj-$(CONFIG_MMC_DW_K3) += dw_mmc-k3.o obj-$(CONFIG_MMC_DW_PCI) += dw_mmc-pci.o obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o diff --git a/drivers/mmc/host/dw_mmc-hi3798mv200.c b/drivers/mmc/host/dw_mmc-hi3798mv200.c new file mode 100644 index 000000000000..73aaa21040ea --- /dev/null +++ b/drivers/mmc/host/dw_mmc-hi3798mv200.c @@ -0,0 +1,239 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Modified from dw_mmc-hi3798cv200.c + * + * Copyright (c) 2024 Yang Xiwen + * Copyright (c) 2018 HiSilicon Technologies Co., Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "dw_mmc.h" +#include "dw_mmc-pltfm.h" + +#define SDMMC_TUNING_CTRL 0x118 +#define SDMMC_TUNING_FIND_EDGE BIT(5) + +#define ALL_INT_CLR 0x1ffff + +/* DLL ctrl reg */ +#define SAP_DLL_CTRL_DLLMODE BIT(16) + +struct dw_mci_hi3798mv200_priv { + struct clk *sample_clk; + struct clk *drive_clk; + struct regmap *crg_reg; + u32 sap_dll_offset; + struct mmc_clk_phase_map phase_map; +}; + +static void dw_mci_hi3798mv200_set_ios(struct dw_mci *host, struct mmc_ios *ios) +{ + struct dw_mci_hi3798mv200_priv *priv = host->priv; + struct mmc_clk_phase phase = priv->phase_map.phase[ios->timing]; + u32 val; + + val = mci_readl(host, ENABLE_SHIFT); + if (ios->timing == MMC_TIMING_MMC_DDR52 + || ios->timing == MMC_TIMING_UHS_DDR50) + val |= SDMMC_ENABLE_PHASE; + else + val &= ~SDMMC_ENABLE_PHASE; + mci_writel(host, ENABLE_SHIFT, val); + + val = mci_readl(host, DDR_REG); + if (ios->timing == MMC_TIMING_MMC_HS400) + val |= SDMMC_DDR_HS400; + else + val &= ~SDMMC_DDR_HS400; + mci_writel(host, DDR_REG, val); + + if (clk_set_rate(host->ciu_clk, ios->clock)) + dev_warn(host->dev, "Failed to set rate to %u\n", ios->clock); + else + // CLK_MUX_ROUND_NEAREST is enabled for this clock + // The actual clock rate is not what we setted, but a rounded value + // so we should get the rate once again + host->bus_hz = clk_get_rate(host->ciu_clk); + + if (phase.valid) { + clk_set_phase(priv->drive_clk, phase.out_deg); + clk_set_phase(priv->sample_clk, phase.in_deg); + } else { + dev_warn(host->dev, + "The phase entry for timing mode %d is missing in device tree.\n", + ios->timing); + } +} + +static inline int dw_mci_hi3798mv200_enable_tuning(struct dw_mci_slot *slot) +{ + struct dw_mci_hi3798mv200_priv *priv = slot->host->priv; + + return regmap_clear_bits(priv->crg_reg, priv->sap_dll_offset, SAP_DLL_CTRL_DLLMODE); +} + +static inline int dw_mci_hi3798mv200_disable_tuning(struct dw_mci_slot *slot) +{ + struct dw_mci_hi3798mv200_priv *priv = slot->host->priv; + + return regmap_set_bits(priv->crg_reg, priv->sap_dll_offset, SAP_DLL_CTRL_DLLMODE); +} + +static int dw_mci_hi3798mv200_execute_tuning_mix_mode(struct dw_mci_slot *slot, + u32 opcode) +{ + static const int degrees[] = { 0, 45, 90, 135, 180, 225, 270, 315 }; + struct dw_mci *host = slot->host; + struct dw_mci_hi3798mv200_priv *priv = host->priv; + int raise_point = -1, fall_point = -1; + int err, prev_err = -1; + int found = 0; + int regval; + int i; + int ret; + + // enable tuning + ret = dw_mci_hi3798mv200_enable_tuning(slot); + if (ret < 0) + return ret; + for (i = 0; i < ARRAY_SIZE(degrees); i++) { + clk_set_phase(priv->sample_clk, degrees[i]); + mci_writel(host, RINTSTS, ALL_INT_CLR); + + err = mmc_send_tuning(slot->mmc, opcode, NULL); + if (!err) { + regval = mci_readl(host, TUNING_CTRL); + if (regval & SDMMC_TUNING_FIND_EDGE) + err = 1; + else + found = 1; + }; + + if (i > 0) { + if (err && !prev_err) + fall_point = i - 1; + if (!err && prev_err) + raise_point = i; + } + + if (raise_point != -1 && fall_point != -1) + goto tuning_out; + + prev_err = err; + err = 0; + } + +tuning_out: + ret = dw_mci_hi3798mv200_disable_tuning(slot); + if (ret < 0) + return ret; + if (found) { + if (raise_point == -1) + raise_point = 0; + if (fall_point == -1) + fall_point = ARRAY_SIZE(degrees) - 1; + if (fall_point < raise_point) { + if ((raise_point + fall_point) > + (ARRAY_SIZE(degrees) - 1)) + i = fall_point / 2; + else + i = (raise_point + ARRAY_SIZE(degrees) - 1) / 2; + } else { + i = (raise_point + fall_point) / 2; + } + + // use the same phase table for both HS200 and HS400 + priv->phase_map.phase[MMC_TIMING_MMC_HS200].in_deg = degrees[i]; + priv->phase_map.phase[MMC_TIMING_MMC_HS400].in_deg = degrees[i]; + + clk_set_phase(priv->sample_clk, degrees[i]); + dev_dbg(host->dev, "Tuning clk_sample[%d, %d], set[%d]\n", + raise_point, fall_point, degrees[i]); + err = 0; + } else { + dev_err(host->dev, "No valid clk_sample shift! use default\n"); + err = -EINVAL; + } + + mci_writel(host, RINTSTS, ALL_INT_CLR); + return err; +} + +static int dw_mci_hi3798mv200_init(struct dw_mci *host) +{ + struct dw_mci_hi3798mv200_priv *priv; + struct device_node *np = host->dev->of_node; + int ret; + + priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + mmc_of_parse_clk_phase(host->dev, &priv->phase_map); + + priv->sample_clk = devm_clk_get_enabled(host->dev, "ciu-sample"); + if (IS_ERR(priv->sample_clk)) + return dev_err_probe(host->dev, PTR_ERR(priv->sample_clk), + "failed to get enabled ciu-sample clock\n"); + + priv->drive_clk = devm_clk_get_enabled(host->dev, "ciu-drive"); + if (IS_ERR(priv->drive_clk)) + return dev_err_probe(host->dev, PTR_ERR(priv->drive_clk), + "failed to get enabled ciu-drive clock\n"); + + priv->crg_reg = syscon_regmap_lookup_by_phandle(np, "hisilicon,sap-dll-reg"); + if (IS_ERR(priv->crg_reg)) + return dev_err_probe(host->dev, PTR_ERR(priv->crg_reg), + "failed to get CRG reg\n"); + + ret = of_property_read_u32_index(np, "hisilicon,sap-dll-reg", 1, &priv->sap_dll_offset); + if (ret) + return dev_err_probe(host->dev, ret, "failed to get sample DLL register offset\n"); + + host->priv = priv; + return 0; +} + +static const struct dw_mci_drv_data hi3798mv200_data = { + .common_caps = MMC_CAP_CMD23, + .init = dw_mci_hi3798mv200_init, + .set_ios = dw_mci_hi3798mv200_set_ios, + .execute_tuning = dw_mci_hi3798mv200_execute_tuning_mix_mode, +}; + +static const struct of_device_id dw_mci_hi3798mv200_match[] = { + { .compatible = "hisilicon,hi3798mv200-dw-mshc" }, + {}, +}; + +static int dw_mci_hi3798mv200_probe(struct platform_device *pdev) +{ + return dw_mci_pltfm_register(pdev, &hi3798mv200_data); +} + +static void dw_mci_hi3798mv200_remove(struct platform_device *pdev) +{ + dw_mci_pltfm_remove(pdev); +} + +MODULE_DEVICE_TABLE(of, dw_mci_hi3798mv200_match); +static struct platform_driver dw_mci_hi3798mv200_driver = { + .probe = dw_mci_hi3798mv200_probe, + .remove_new = dw_mci_hi3798mv200_remove, + .driver = { + .name = "dwmmc_hi3798mv200", + .probe_type = PROBE_PREFER_ASYNCHRONOUS, + .of_match_table = dw_mci_hi3798mv200_match, + }, +}; +module_platform_driver(dw_mci_hi3798mv200_driver); + +MODULE_DESCRIPTION("HiSilicon Hi3798MV200 Specific DW-MSHC Driver Extension"); +MODULE_LICENSE("GPL"); From patchwork Wed Feb 21 12:45:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 204202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1011182dyc; Wed, 21 Feb 2024 04:47:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXTYy96+pk5wHFg0igl4uk2LPCZMjORzKueriy6+VmTk36+gOoYQGozQsieJLaFnJ0aBMZbrwtv7jlFnqXgswyrBQKsmg== X-Google-Smtp-Source: AGHT+IHZbO9qUCb0TMTF6TzQmRwgJpzYoSlE5bTbZEGQCCsrZnW03BPfBrR7nIQ5H+3Q86yf+BnD X-Received: by 2002:a05:6a20:b726:b0:19e:a23f:2979 with SMTP id fg38-20020a056a20b72600b0019ea23f2979mr12925292pzb.28.1708519660759; Wed, 21 Feb 2024 04:47:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708519660; cv=pass; d=google.com; s=arc-20160816; b=DVMM/pzPIelWtp4CgEtwRnyNgWePN0HdkIfkX3pxu0p5vGcAgEw8KihPrRTmC6cuBs E6ZBxc1WKLMK1CZLQkIp+kkiROE7TA7wJ1VLjnEaITV/YVzj+CfWnUlg14tRiW/zq3AU 54LxzgL6p4UgpWcWTwaDoFtndgVnDq/gtB8LQ3heMMDH9hsQ+twIhEWsSccCXnNxwgVT AgiOSPZtT8IQZ2GttZmgCPKgF3rUK6Q/inDZuwJOcLzJSacI2tcpmokTmWomhxiOzmOF uktAZ42CASnsywWul0mzZO6jncM6b9eKKdOsh6EbWhCNrBsvIf71Q3I+jf5gkOcMpglJ cOlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=BySu18w2SrTawG8qSKpMTUbAyEW4uOqaAkv4O2h8w0o=; fh=LRQm+9myFkSXQ8D5tIdaKodUsw3dcE5JVwiW6yUZYPA=; b=sPFBpREoYAo6ssnBtksrEMX4s/zFEzzykFaEmCs+NkuDCt6guQjLVdzCEMLh92oFES ClEWegkVmxsJH0tSH74LhCCjfWv5nGBYmyRHVULIjzky1mE5izMQg6KrWUBe6zlQKPMZ 6KB4yZjBKpzIgy9zP4LE/9rLFIFeE+8sZCPhiYMSeVM9dWAZw3BBFyVONgkpQtfz3ds8 cFPh8WCtfpLP9tpl5dyaz/yDN9lI+kdSAyOMV/P2QMAN2P6lb7XAtrxiJncVDR6ZdEHR Saah0umkUkuEhGyKxhLCKhxY6CM/W96FMdaUq4gBTA4rsDdC11XvvssmqYjs4pkv4cG2 fr4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GjybfMns; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74717-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74717-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id z7-20020a170902d54700b001dbccd0eb1bsi7582076plf.413.2024.02.21.04.47.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 04:47:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74717-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GjybfMns; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74717-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74717-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 9B4A4B22E61 for ; Wed, 21 Feb 2024 12:47:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9679F7764A; Wed, 21 Feb 2024 12:45:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GjybfMns" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5453369967; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708519547; cv=none; b=OylMIaayvgLjUnQ4YI/oymXrC7y9s32znZSuNE6whgmagbMAtUM46Z5eZzsDzpvXUUE3eapvLGGvw0SYdw8o3E0xcJKxDNJCEuILQiNKQQfuQSiwlYh7a20sz193QmksfCvoCAN0nt5el1O8sWJeetWs7SzSv6OcF7fUCLq6JSc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708519547; c=relaxed/simple; bh=ZAX9Em2I3TtnHcZcltf0TchJ6NPlrQE8PyBaCkDKCT0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rCvaGVTbKsjtnakombkrKOOHzoGJArLUqWc/5ecDRanxBkMejdGjGqyXM7uD1AbNkThfgvXkDNBdxNaMQ9X53vIq0woQuryQdw4A04f6bqdSzRJ2CUzVvCLv8MKxjSqINyBTD3/qyq1S1C5qbInZePjxi7RLhWW5p1mk3YoAGwY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GjybfMns; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id C8CD6C43609; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708519546; bh=ZAX9Em2I3TtnHcZcltf0TchJ6NPlrQE8PyBaCkDKCT0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=GjybfMns0qKcPnpKFl7+LqRZetZEby7308ydnDlSWauaHtMxCYPnro0W3n3CTrHQW EaCT0fHVBRuhSbAqLhbkP79Q1pQ5SVofU03w1OyXM3BW9s11Yi70/nuZzwX2jwdLse vkQN1OzzqrweMn/QRPXVPfFZTuLYR2iWJu05ZFPzykLc5dSqhPosF6oLp7cBfwvcff QXho22geIDl/2d9iv79uMdTqBMDu2UeTgBjUd8S6J1yv7WPgD+4h4Z1aXtg6y1onor fg7Sq7haCbXLXUJlfC9/d+XTStjZ8kvvF1+PtMNp6MPUC/yTvSOHmmekgJkjJMg/yk +lhEiwWk5ezVQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF5A6C48BF6; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Wed, 21 Feb 2024 20:45:06 +0800 Subject: [PATCH v6 4/5] dt-bindings: mmc: dw-mshc-hi3798cv200: convert to YAML Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-b4-mmc-hi3798mv200-v6-4-bc41bf6a9769@outlook.com> References: <20240221-b4-mmc-hi3798mv200-v6-0-bc41bf6a9769@outlook.com> In-Reply-To: <20240221-b4-mmc-hi3798mv200-v6-0-bc41bf6a9769@outlook.com> To: Ulf Hansson , Jaehoon Chung , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Andrew Jeffery , Joel Stanley Cc: Igor Opaniuk , tianshuliang , David Yang , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Yang Xiwen , Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708519512; l=4709; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=z5/cBD8zJzGgT2WFAWSZ2rRYPe9PGIgRVLWNL1lYtXo=; b=y71RqcMOdk10Mi9as8LatovtXX7bUEryDDYHBnltYV3KYj6Z0IfxFnQNUWi5wraRHL10PEjv8 7ZlDZyyYjN8ALpi7pJl/5qt+CI+7P1GGU79pSDcWmY6HASW5MZBcPYy X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791512711763755708 X-GMAIL-MSGID: 1791512711763755708 From: Yang Xiwen convert the legacy txt binding to modern YAML and rename to hisilicon,hi3798cv200-dw-mshc.yaml. No semantic change. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Yang Xiwen --- .../bindings/mmc/hi3798cv200-dw-mshc.txt | 40 ------------ .../mmc/hisilicon,hi3798cv200-dw-mshc.yaml | 75 ++++++++++++++++++++++ 2 files changed, 75 insertions(+), 40 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/hi3798cv200-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/hi3798cv200-dw-mshc.txt deleted file mode 100644 index a0693b7145f2..000000000000 --- a/Documentation/devicetree/bindings/mmc/hi3798cv200-dw-mshc.txt +++ /dev/null @@ -1,40 +0,0 @@ -* Hisilicon Hi3798CV200 specific extensions to the Synopsys Designware Mobile - Storage Host Controller - -Read synopsys-dw-mshc.txt for more details - -The Synopsys designware mobile storage host controller is used to interface -a SoC with storage medium such as eMMC or SD/MMC cards. This file documents -differences between the core Synopsys dw mshc controller properties described -by synopsys-dw-mshc.txt and the properties used by the Hisilicon Hi3798CV200 -specific extensions to the Synopsys Designware Mobile Storage Host Controller. - -Required Properties: -- compatible: Should contain "hisilicon,hi3798cv200-dw-mshc". -- clocks: A list of phandle + clock-specifier pairs for the clocks listed - in clock-names. -- clock-names: Should contain the following: - "ciu" - The ciu clock described in synopsys-dw-mshc.txt. - "biu" - The biu clock described in synopsys-dw-mshc.txt. - "ciu-sample" - Hi3798CV200 extended phase clock for ciu sampling. - "ciu-drive" - Hi3798CV200 extended phase clock for ciu driving. - -Example: - - emmc: mmc@9830000 { - compatible = "hisilicon,hi3798cv200-dw-mshc"; - reg = <0x9830000 0x10000>; - interrupts = ; - clocks = <&crg HISTB_MMC_CIU_CLK>, - <&crg HISTB_MMC_BIU_CLK>, - <&crg HISTB_MMC_SAMPLE_CLK>, - <&crg HISTB_MMC_DRV_CLK>; - clock-names = "ciu", "biu", "ciu-sample", "ciu-drive"; - fifo-depth = <256>; - clock-frequency = <200000000>; - cap-mmc-highspeed; - mmc-ddr-1_8v; - mmc-hs200-1_8v; - non-removable; - bus-width = <8>; - }; diff --git a/Documentation/devicetree/bindings/mmc/hisilicon,hi3798cv200-dw-mshc.yaml b/Documentation/devicetree/bindings/mmc/hisilicon,hi3798cv200-dw-mshc.yaml new file mode 100644 index 000000000000..f3dc973cb490 --- /dev/null +++ b/Documentation/devicetree/bindings/mmc/hisilicon,hi3798cv200-dw-mshc.yaml @@ -0,0 +1,75 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/hisilicon,hi3798cv200-dw-mshc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hisilicon Hi3798CV200 SoC specific extensions to the Synopsys DWMMC controller + +maintainers: + - Yang Xiwen + +properties: + compatible: + enum: + - hisilicon,hi3798cv200-dw-mshc + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: bus interface unit clock + - description: card interface unit clock + - description: card input sample phase clock + - description: controller output drive phase clock + + clock-names: + items: + - const: ciu + - const: biu + - const: ciu-sample + - const: ciu-drive + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + +allOf: + - $ref: synopsys-dw-mshc-common.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + #include + + mmc@9830000 { + compatible = "hisilicon,hi3798cv200-dw-mshc"; + reg = <0x9830000 0x10000>; + interrupts = ; + clocks = <&crg HISTB_MMC_CIU_CLK>, + <&crg HISTB_MMC_BIU_CLK>, + <&crg HISTB_MMC_SAMPLE_CLK>, + <&crg HISTB_MMC_DRV_CLK>; + clock-names = "ciu", "biu", "ciu-sample", "ciu-drive"; + resets = <&crg 0xa0 4>; + reset-names = "reset"; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_pins_1 &emmc_pins_2 + &emmc_pins_3 &emmc_pins_4>; + fifo-depth = <256>; + clock-frequency = <200000000>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + non-removable; + bus-width = <8>; + }; From patchwork Wed Feb 21 12:45:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xiwen via B4 Relay X-Patchwork-Id: 204201 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1011125dyc; Wed, 21 Feb 2024 04:47:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVy1k2jpktN0QXDmvo+MlnfWnQX8iHjAdgTptDiHQ8UtRbx9S6nJHNMzi0j39Xtv/WBg9jq9CeEVYJ4mUKiykxBFChdyg== X-Google-Smtp-Source: AGHT+IEYw2e6eiX4LttN9Iw5e1xWzHMlFMbzO9DK2tAluJh+1XWgo0LuK4Rt2KRr+JHtRxKaYekw X-Received: by 2002:a05:6871:1cc:b0:21a:43e6:9479 with SMTP id q12-20020a05687101cc00b0021a43e69479mr19504940oad.25.1708519652017; Wed, 21 Feb 2024 04:47:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708519651; cv=pass; d=google.com; s=arc-20160816; b=vjlBixXV2WJLwbK63dx2F00HRicb02AVrHXzriwqjLRqd6NJJjNTysLZqxArJ1zqav sZTY9otoNy+79T8GBL5FGIoUwQcw8jAPf5o6MLA76lU2e5b9OxeBDudLKWVqic+51vVJ ywMD6yFjUMCILkpAZNAOAsfvwdBqkiT1nniLOZB+tk0NyzRN9mTp62nO0DXS+1qIRcFm vsiOYMOl2ODCbFlHv+d94sTs5Mijpwk1/Sl5noqVBl8grkklrl7q2chb0MVVXupUX+HW AmY8NpN1Bb+EOxdlPMBjuw1z7ZKzjp6n/vKq/9dN+P6/g561Y9CqFYtYndQig6HOrBfn 5LwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=/x8ZN7ALE2ykgkcuAuT2cTGFwg8AQwdMGPlx7LfjS3w=; fh=LRQm+9myFkSXQ8D5tIdaKodUsw3dcE5JVwiW6yUZYPA=; b=OO1w1vaZ1SM5KGRe+uWItGs3Yrc56z+Hv5wDyFTjc18khYRb94hL0PZr7cgO9iRCe6 MAoB/s4B5sOZ47dkVEDWOF7fwhIHz1A4aEDaCP7u3yBLpog4ih/0Wu25rEdJOLG4HHkk ijFyfguOp7Ft3w7LykKQtdZZOyqYc6oBYu3zP9D7V/MZl/uk8RiHBQ4/EUhs/T/ny6nr HaSPXbI9/2puEbCAv4ySqTa5TkJp5jZ/vzdaPolOIujpuWUg7zKZL8X1wmTdUW+m5UpB +G0jDaBOQPj7dm0WxnrQxhRTnKNs2icJcIY3KTTsRik2wuDzNcMfC5LdOhsj/2YbtMEQ KV/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J060MfgN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74718-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74718-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k62-20020a632441000000b005dc42a836a3si8062540pgk.625.2024.02.21.04.47.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 04:47:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74718-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J060MfgN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74718-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74718-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CD31B28301D for ; Wed, 21 Feb 2024 12:47:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF78669944; Wed, 21 Feb 2024 12:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J060MfgN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6654C69972; Wed, 21 Feb 2024 12:45:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708519547; cv=none; b=u6HbRW187W2YTKbnOMT/eou1JajGunm2BFhPljFD6W/RpGFoMb2ZITM7F33Mb7iwA5sGOKT9dek4iRB18LH0pz1uXAbHocqLmaelJ5uu6BMKncW0aVWjd0pMG7+QMSUF75zIq3d3szRewHbnv2BjCLvuPvmy0mee5Jk/RmYacf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708519547; c=relaxed/simple; bh=slgj3guZ6Z9tOfsaZHVxvfSZgSTNkEptvrY2Lok1/e8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uYvk+i4JxBQWpUcAF26Qsq0wpijyAFlSGUE7463WRpFTh6qkouHT4IjcrQwzRUkEg5opmsXhGvXzBFLQBK8yWH5Z1Wcp8pJap510MD9T0ms8ouDuNnrne95KuCLKNCFetqkH76eeY2xMZElSAxZqRqlQ129YCYpNabrdvivjzSM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J060MfgN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id CE33BC43142; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708519546; bh=slgj3guZ6Z9tOfsaZHVxvfSZgSTNkEptvrY2Lok1/e8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=J060MfgNWnyH6t7fMrDe63PNcB+jYf+SlsfWghOUKuj5o3bpDBfjiQzxh43k2a9sN BUZKrs3VuHHv41PHOt94sUsjeOWy3uPJipNkGIlyghR9fEyFBgrj3k0Wq1pF0P36rO oZ+YJwXKJSNVQgzXdOa413V2sQtO5p6F0f25yfylHpJuV6UN1Kq+eMzGkxpjSXumL3 VMuBzHVqpDyo6Prhuuc8FlaiAgYcknIjPGkhwlsQb51lyp3/007wjL5TYBM0pRha5p vcmhZbJ2JbGaK72oQIPNHFAjczoCMCklkJ/NY68AWXiqP4LPjQp5d0jx8iJT8cY5rA XHiw594+f+0aw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBC85C54788; Wed, 21 Feb 2024 12:45:46 +0000 (UTC) From: Yang Xiwen via B4 Relay Date: Wed, 21 Feb 2024 20:45:07 +0800 Subject: [PATCH v6 5/5] dt-bindings: mmc: hisilicon,hi3798cv200-dw-mshc: add Hi3798MV200 binding Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240221-b4-mmc-hi3798mv200-v6-5-bc41bf6a9769@outlook.com> References: <20240221-b4-mmc-hi3798mv200-v6-0-bc41bf6a9769@outlook.com> In-Reply-To: <20240221-b4-mmc-hi3798mv200-v6-0-bc41bf6a9769@outlook.com> To: Ulf Hansson , Jaehoon Chung , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Andrew Jeffery , Joel Stanley Cc: Igor Opaniuk , tianshuliang , David Yang , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Yang Xiwen , Krzysztof Kozlowski X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708519512; l=2243; i=forbidden405@outlook.com; s=20230724; h=from:subject:message-id; bh=MbI2PnDc478+pXDtiAiOl4Pgtl4uv4VM2qKM2Aj02Fo=; b=GHMbA+ui0CZj/9PA7UQN3DitGiodD7rPMA/G2T+/6k889MCtJfDNBOILA23c67nIXdiMtFMi1 ZGxs43UDR1XBsZqvNwDSQhf3xL/qcNTIDouoxGrfuDym3cYcwLcCepn X-Developer-Key: i=forbidden405@outlook.com; a=ed25519; pk=qOD5jhp891/Xzc+H/PZ8LWVSWE3O/XCQnAg+5vdU2IU= X-Endpoint-Received: by B4 Relay for forbidden405@outlook.com/20230724 with auth_id=67 X-Original-From: Yang Xiwen Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791512702706794201 X-GMAIL-MSGID: 1791512702706794201 From: Yang Xiwen Add binding and an extra property for Hi3798MV200 DWMMC specific extension. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Yang Xiwen --- .../mmc/hisilicon,hi3798cv200-dw-mshc.yaml | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mmc/hisilicon,hi3798cv200-dw-mshc.yaml b/Documentation/devicetree/bindings/mmc/hisilicon,hi3798cv200-dw-mshc.yaml index f3dc973cb490..41c9b22523e7 100644 --- a/Documentation/devicetree/bindings/mmc/hisilicon,hi3798cv200-dw-mshc.yaml +++ b/Documentation/devicetree/bindings/mmc/hisilicon,hi3798cv200-dw-mshc.yaml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/mmc/hisilicon,hi3798cv200-dw-mshc.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Hisilicon Hi3798CV200 SoC specific extensions to the Synopsys DWMMC controller +title: Hisilicon HiSTB SoCs specific extensions to the Synopsys DWMMC controller maintainers: - Yang Xiwen @@ -13,6 +13,7 @@ properties: compatible: enum: - hisilicon,hi3798cv200-dw-mshc + - hisilicon,hi3798mv200-dw-mshc reg: maxItems: 1 @@ -34,6 +35,15 @@ properties: - const: ciu-sample - const: ciu-drive + hisilicon,sap-dll-reg: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: | + DWMMC core on Hi3798MV2x SoCs has a delay-locked-loop(DLL) attached to card data input path. + It is integrated into CRG core on the SoC and has to be controlled during tuning. + items: + - description: A phandle pointed to the CRG syscon node + - description: Sample DLL register offset in CRG address space + required: - compatible - reg @@ -44,6 +54,18 @@ required: allOf: - $ref: synopsys-dw-mshc-common.yaml# + - if: + properties: + compatible: + contains: + const: hisilicon,hi3798mv200-dw-mshc + then: + required: + - hisilicon,sap-dll-reg + else: + properties: + hisilicon,sap-dll-reg: false + unevaluatedProperties: false examples: