From patchwork Fri Sep 22 06:28:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Qiu X-Patchwork-Id: 143212 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5361990vqi; Thu, 21 Sep 2023 23:35:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDo8r+9cj+YAaPefLPd0Vi+O+JFfDPT1a/ejxRgMuXxF2+F7bPhW3v28hVEAGhPqtqamo8 X-Received: by 2002:a05:6a20:3944:b0:12e:73bb:cbb6 with SMTP id r4-20020a056a20394400b0012e73bbcbb6mr8385099pzg.14.1695364512303; Thu, 21 Sep 2023 23:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695364512; cv=none; d=google.com; s=arc-20160816; b=Ze3g5+8HRwrdIpIg0oDHzBeEOSA5oeo+vvEBn8cPSvU0v3kLmEspoNIkEuFZAqTZGF gJCFtaH5gpEZxbV+kbzspkp9L1E8bneXWxqOWSI15NIUHDPBAgbNjMqzu9MfSuiH4JX2 5/R5uY3ZxVaCt103HZoOOza8YZvsC5Ymc1hge687CI71yDZtS1j1SdRBLk+tZMHTamrQ 88GQ6iI1FZdl4qVB78QV4m9h77rkJ70iKunFZ0dYwOjE5YXGaMXTl4mZnUYEtG69BcuC lC1ppAGeLzPMPGbeX5gwQsekXAXldWXqHEOqfnmJzYGOn2YAM0hZ9pN/1s9drY8Fplec FNoA== 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; bh=IKULgKIx7a6UfMQoNUSQA4ofSHqhtZOtjiU1zSkXALw=; fh=kxe0WRziv7CVSpkNH/bNiH26639+950jD1JJwWX77uk=; b=AnC4IVY0VG4QzOkKnqAZTr/lsKnjBQbgOQsNw1VwaHLnDCNsNmEXYln5jOTmN54iOI 88EeUfNhMFJC2O2maRjXevhjIuHgCyT+6OIxuzFZPIacBK1SYc5FKhiiFtccKRtCLAJR dv0PwWrEl6k4roYjUdJFX0AlvgCyNdVIcgbxpArWjpo0F2QbQijEA+fKojXTlEfV0msG YH19VxKXQbbkb4sMskb+jYqNmMia0rulZMU0IrlPDFwExsVkF3sli0nqK1ivsesz/aWO dtszQHN2saVi79xK5a1geTV+QUSiALechdkifK47UfnNMrfTnBWlATMgKiWnm8+eCzWf N52A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id g8-20020a17090ace8800b0026b698fdda6si5177139pju.98.2023.09.21.23.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 23:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8AAF08025DC2; Thu, 21 Sep 2023 23:29:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbjIVG25 convert rfc822-to-8bit (ORCPT + 30 others); Fri, 22 Sep 2023 02:28:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbjIVG2t (ORCPT ); Fri, 22 Sep 2023 02:28:49 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBD6C102; Thu, 21 Sep 2023 23:28:43 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 26FF324E2B9; Fri, 22 Sep 2023 14:28:37 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 22 Sep 2023 14:28:37 +0800 Received: from williamqiu-virtual-machine.starfivetech.com (171.223.208.138) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 22 Sep 2023 14:28:36 +0800 From: William Qiu To: , , , CC: Emil Renner Berthing , Rob Herring , Jaehoon Chung , Ulf Hansson , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , "Palmer Dabbelt" , Albert Ou , William Qiu Subject: [PATCH v3 1/3] dt-bindings: mmc: Remove properties from required Date: Fri, 22 Sep 2023 14:28:32 +0800 Message-ID: <20230922062834.39212-2-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922062834.39212-1-william.qiu@starfivetech.com> References: <20230922062834.39212-1-william.qiu@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 21 Sep 2023 23:29:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777718538919751948 X-GMAIL-MSGID: 1777718538919751948 Due to the change of tuning implementation, it's no longer necessary to use the "starfive,sysreg" property in dts, so remove it from required. Signed-off-by: William Qiu Acked-by: Conor Dooley Reviewed-by: Emil Renner Berthing --- Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml b/Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml index 51e1b04e799f..553a75195c2e 100644 --- a/Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml +++ b/Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml @@ -55,7 +55,6 @@ required: - clocks - clock-names - interrupts - - starfive,sysreg unevaluatedProperties: false @@ -73,5 +72,4 @@ examples: fifo-depth = <32>; fifo-watermark-aligned; data-addr = <0>; - starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; }; From patchwork Fri Sep 22 06:28:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Qiu X-Patchwork-Id: 143207 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5359665vqi; Thu, 21 Sep 2023 23:29:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF71FIZ5C3/mhbJASMVYFjQy/V9ShAl6PxBoZECx+o6kjDiOLfe3Dp9CvZla1TumJwSjkSc X-Received: by 2002:a17:902:bb83:b0:1c5:9db0:a1c3 with SMTP id m3-20020a170902bb8300b001c59db0a1c3mr5731851pls.35.1695364156749; Thu, 21 Sep 2023 23:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695364156; cv=none; d=google.com; s=arc-20160816; b=s+dURqOQ2j8eQsAbLpb0tcT3MuDa4ZVEd1d1VqnMcZuPeLjfccMbAAWd5mkyYypQGg +BMDBRYGPZYm9vPfmjANewclAXUYXSj57N4FiJtKvAsrJ/W86Z2w/8A274h6L2FCtHb6 kduNJBYs1Df+Liyt+yer2sqXeHB65tGEVTMAu0mYnv1d4LibC6P0KLiOyiZwyXL3LbpV ZvJVzurLjSOh/2IYoJRZv4iot217YpS25mR2KpMT1HcvMT6kItfGGGpTSkEEARUcxv7x 2si8v/HQasfg/mOj7zYwvLZVdXXFzC5s/+PD06SQJssxOvDkyybBXeDA+i7+FYTErkqB Zw2Q== 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; bh=4G58TVDSXYkfsBIVWS19YUiiDr5UQDzcFilZUecHrI4=; fh=kxe0WRziv7CVSpkNH/bNiH26639+950jD1JJwWX77uk=; b=bRTn1SnODyJn/bvUqVVmrJv7TEFMugdanWPQljAF53KhhNsJjo4W+x4We5EtQfBm6N lS3tRMaRXV4xbxsjm1kxlsgccQ+YolQrjybzQXatNTzC5Cw41bB15HDjsocZabXrb2SF RbUcSVLTrVrky8Db1qZXBzb4KNHZEh9AmSUCeTt9V46cPmSVJcwX8oAnyf4vBDL+QiYV 9j33i/cZPxY2V6ZkXP3TMVYNAc3YfGDWobvd7cFwEbHq+rK/ekpLpDbbZiMmuTxRvnIS uIL0iXytZE/dPu4VM/KGWeGXdOoTqAtN41sMciEzwELP6xW1t1Y+ftsp2HiENAQGHvxB /dpg== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id u15-20020a170902e80f00b001bd949bcd75si3451479plg.575.2023.09.21.23.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 23:29:16 -0700 (PDT) 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; 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 Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3496583BFC70; Thu, 21 Sep 2023 23:29:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230402AbjIVG3K convert rfc822-to-8bit (ORCPT + 30 others); Fri, 22 Sep 2023 02:29:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230480AbjIVG3D (ORCPT ); Fri, 22 Sep 2023 02:29:03 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6732CCC1; Thu, 21 Sep 2023 23:28:53 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 1A69524E28E; Fri, 22 Sep 2023 14:28:38 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 22 Sep 2023 14:28:38 +0800 Received: from williamqiu-virtual-machine.starfivetech.com (171.223.208.138) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 22 Sep 2023 14:28:36 +0800 From: William Qiu To: , , , CC: Emil Renner Berthing , Rob Herring , Jaehoon Chung , Ulf Hansson , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , "Palmer Dabbelt" , Albert Ou , William Qiu Subject: [PATCH v3 2/3] mmc: starfive: Change tuning implementation Date: Fri, 22 Sep 2023 14:28:33 +0800 Message-ID: <20230922062834.39212-3-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922062834.39212-1-william.qiu@starfivetech.com> References: <20230922062834.39212-1-william.qiu@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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]); Thu, 21 Sep 2023 23:29:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777718166051260515 X-GMAIL-MSGID: 1777718166051260515 Before, we used syscon to achieve tuning, but the actual measurement showed little effect, so the tuning implementation was modified here, and it was realized by reading and writing the UHS_REG_EXT register. Signed-off-by: William Qiu Reviewed-by: Emil Renner Berthing --- drivers/mmc/host/dw_mmc-starfive.c | 137 +++++++++-------------------- 1 file changed, 40 insertions(+), 97 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-starfive.c b/drivers/mmc/host/dw_mmc-starfive.c index fd05a648a8bb..b4d81ef0f3af 100644 --- a/drivers/mmc/host/dw_mmc-starfive.c +++ b/drivers/mmc/host/dw_mmc-starfive.c @@ -5,6 +5,7 @@ * Copyright (c) 2022 StarFive Technology Co., Ltd. */ +#include #include #include #include @@ -20,13 +21,7 @@ #define ALL_INT_CLR 0x1ffff #define MAX_DELAY_CHAIN 32 -struct starfive_priv { - struct device *dev; - struct regmap *reg_syscon; - u32 syscon_offset; - u32 syscon_shift; - u32 syscon_mask; -}; +#define STARFIVE_SMPL_PHASE GENMASK(20, 16) static void dw_mci_starfive_set_ios(struct dw_mci *host, struct mmc_ios *ios) { @@ -44,117 +39,65 @@ static void dw_mci_starfive_set_ios(struct dw_mci *host, struct mmc_ios *ios) } } +static void dw_mci_starfive_set_sample_phase(struct dw_mci *host, u32 smpl_phase) +{ + /* change driver phase and sample phase */ + u32 reg_value = mci_readl(host, UHS_REG_EXT); + + /* In UHS_REG_EXT, only 5 bits valid in DRV_PHASE and SMPL_PHASE */ + reg_value &= ~STARFIVE_SMPL_PHASE; + reg_value |= FIELD_PREP(STARFIVE_SMPL_PHASE, smpl_phase); + mci_writel(host, UHS_REG_EXT, reg_value); + + /* We should delay 1ms wait for timing setting finished. */ + mdelay(1); +} + static int dw_mci_starfive_execute_tuning(struct dw_mci_slot *slot, u32 opcode) { static const int grade = MAX_DELAY_CHAIN; struct dw_mci *host = slot->host; - struct starfive_priv *priv = host->priv; - int rise_point = -1, fall_point = -1; - int err, prev_err = 0; - int i; - bool found = 0; - u32 regval; - - /* - * Use grade as the max delay chain, and use the rise_point and - * fall_point to ensure the best sampling point of a data input - * signals. - */ - for (i = 0; i < grade; i++) { - regval = i << priv->syscon_shift; - err = regmap_update_bits(priv->reg_syscon, priv->syscon_offset, - priv->syscon_mask, regval); - if (err) - return err; + int smpl_phase, smpl_raise = -1, smpl_fall = -1; + int ret; + + for (smpl_phase = 0; smpl_phase < grade; smpl_phase++) { + dw_mci_starfive_set_sample_phase(host, smpl_phase); mci_writel(host, RINTSTS, ALL_INT_CLR); - err = mmc_send_tuning(slot->mmc, opcode, NULL); - if (!err) - found = 1; + ret = mmc_send_tuning(slot->mmc, opcode, NULL); - if (i > 0) { - if (err && !prev_err) - fall_point = i - 1; - if (!err && prev_err) - rise_point = i; + if (!ret && smpl_raise < 0) { + smpl_raise = smpl_phase; + } else if (ret && smpl_raise >= 0) { + smpl_fall = smpl_phase - 1; + break; } - - if (rise_point != -1 && fall_point != -1) - goto tuning_out; - - prev_err = err; - err = 0; } -tuning_out: - if (found) { - if (rise_point == -1) - rise_point = 0; - if (fall_point == -1) - fall_point = grade - 1; - if (fall_point < rise_point) { - if ((rise_point + fall_point) > - (grade - 1)) - i = fall_point / 2; - else - i = (rise_point + grade - 1) / 2; - } else { - i = (rise_point + fall_point) / 2; - } - - regval = i << priv->syscon_shift; - err = regmap_update_bits(priv->reg_syscon, priv->syscon_offset, - priv->syscon_mask, regval); - if (err) - return err; - mci_writel(host, RINTSTS, ALL_INT_CLR); + if (smpl_phase >= grade) + smpl_fall = grade - 1; - dev_info(host->dev, "Found valid delay chain! use it [delay=%d]\n", i); - } else { + if (smpl_raise < 0) { + smpl_phase = 0; dev_err(host->dev, "No valid delay chain! use default\n"); - err = -EINVAL; + ret = -EINVAL; + goto out; } - mci_writel(host, RINTSTS, ALL_INT_CLR); - return err; -} - -static int dw_mci_starfive_parse_dt(struct dw_mci *host) -{ - struct of_phandle_args args; - struct starfive_priv *priv; - int ret; - - priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; + smpl_phase = (smpl_raise + smpl_fall) / 2; + dev_dbg(host->dev, "Found valid delay chain! use it [delay=%d]\n", smpl_phase); + ret = 0; - ret = of_parse_phandle_with_fixed_args(host->dev->of_node, - "starfive,sysreg", 3, 0, &args); - if (ret) { - dev_err(host->dev, "Failed to parse starfive,sysreg\n"); - return -EINVAL; - } - - priv->reg_syscon = syscon_node_to_regmap(args.np); - of_node_put(args.np); - if (IS_ERR(priv->reg_syscon)) - return PTR_ERR(priv->reg_syscon); - - priv->syscon_offset = args.args[0]; - priv->syscon_shift = args.args[1]; - priv->syscon_mask = args.args[2]; - - host->priv = priv; - - return 0; +out: + dw_mci_starfive_set_sample_phase(host, smpl_phase); + mci_writel(host, RINTSTS, ALL_INT_CLR); + return ret; } static const struct dw_mci_drv_data starfive_data = { .common_caps = MMC_CAP_CMD23, .set_ios = dw_mci_starfive_set_ios, - .parse_dt = dw_mci_starfive_parse_dt, .execute_tuning = dw_mci_starfive_execute_tuning, }; From patchwork Fri Sep 22 06:28:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Qiu X-Patchwork-Id: 143211 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5361970vqi; Thu, 21 Sep 2023 23:35:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZ1QlXJY8/tz0jMiDHg9KzJpNaMu9XPufwsVXeE89Adh9XUNoToks8yoil3SsbLsRWRrNk X-Received: by 2002:a25:c54c:0:b0:d06:f0ab:e17b with SMTP id v73-20020a25c54c000000b00d06f0abe17bmr7724013ybe.55.1695364509077; Thu, 21 Sep 2023 23:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695364509; cv=none; d=google.com; s=arc-20160816; b=DkeexltVilmgRFMgEXC4jdkMNcyD3zvhXV2nmXCw/mLE5hnnLBNyaZ6S5gjxyJdNJr 8Rw90iODFYXUKnVBCDG3M9U+WD1MOWQ5XMKXtETTrUZogFrMa25L6rJd7bq0Le5CuTPF tC8xSLyJUp2ac3asg84dGFOjn40LjrT/LRoWOAVMYPDsu3PbnYneduhxUi3fS4q0gar5 7xxKGuAxTCCqndqIOHqMOoL4H1+DCMfIjsse6WlmZk4YFfUDKw581pi3OG87OtEBYVrw t6O3nchOVfeCKqXjs+oxgsqvkcWzUMfqt60pc86w62hKJ0Po0jOL7khYY7UMC+7OxDWb JwEQ== 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; bh=UukG4SMPbjITMegeMip7fF+lWcPWTzqmoSwmqx7DLoE=; fh=kxe0WRziv7CVSpkNH/bNiH26639+950jD1JJwWX77uk=; b=cJ3qbMhXdGInC9E/ohwz5Z/bcPMGQB9y2lEfI0o3BrcEGLTJngXXM+Yzjonzu5KkOh ytJGwrlYGzLBSDbxo9DKQU0Kce8bvwFM7NPdnl3QJja4yt/GHfAf5LzSnMtMUeUT8J9/ EqH+3pkbVZ0xTX042X3BYEccpEOW0M+vjy8pV5/bxdJwAHtNsZbPw0OC8QIIauqhjIFu uChalDFWnjerldC1lhOLWbqtdrv6pZICnxFKKa3HGR5Krtzenzih9IWmyFMLiQjYnd9P ybiZZvDNzBLmfbyH/z02B8GgNJ1M7g7lzgqDhIxTwYKhFz7uXZAlyXN5FfRc9ImgHtIe QlZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id z11-20020a6552cb000000b00578b8016c40si3045467pgp.93.2023.09.21.23.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 23:35:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 1E259802B172; Thu, 21 Sep 2023 23:28:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbjIVG2w convert rfc822-to-8bit (ORCPT + 30 others); Fri, 22 Sep 2023 02:28:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229605AbjIVG2r (ORCPT ); Fri, 22 Sep 2023 02:28:47 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49761CE; Thu, 21 Sep 2023 23:28:41 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id BDC8324E289; Fri, 22 Sep 2023 14:28:38 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 22 Sep 2023 14:28:39 +0800 Received: from williamqiu-virtual-machine.starfivetech.com (171.223.208.138) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 22 Sep 2023 14:28:37 +0800 From: William Qiu To: , , , CC: Emil Renner Berthing , Rob Herring , Jaehoon Chung , Ulf Hansson , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , "Palmer Dabbelt" , Albert Ou , William Qiu Subject: [PATCH v3 3/3] riscv: dts: starfive: add assigned-clock* to limit frquency Date: Fri, 22 Sep 2023 14:28:34 +0800 Message-ID: <20230922062834.39212-4-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922062834.39212-1-william.qiu@starfivetech.com> References: <20230922062834.39212-1-william.qiu@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 21 Sep 2023 23:28:54 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777718535152748544 X-GMAIL-MSGID: 1777718535152748544 In JH7110 SoC, we need to go by-pass mode, so we need add the assigned-clock* properties to limit clock frquency. Signed-off-by: William Qiu Reviewed-by: Emil Renner Berthing --- .../riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi index d79f94432b27..d1f2ec308bca 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi @@ -205,6 +205,8 @@ &i2c6 { &mmc0 { max-frequency = <100000000>; + assigned-clocks = <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>; + assigned-clock-rates = <50000000>; bus-width = <8>; cap-mmc-highspeed; mmc-ddr-1_8v; @@ -221,6 +223,8 @@ &mmc0 { &mmc1 { max-frequency = <100000000>; + assigned-clocks = <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>; + assigned-clock-rates = <50000000>; bus-width = <4>; no-sdio; no-mmc;