From patchwork Tue Sep 12 08:13:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Qiu X-Patchwork-Id: 138017 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp253149vqx; Tue, 12 Sep 2023 01:16:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9xE/v/1V96DT0suwYucYMXJiBYtW6/Uiow5BpZW80gUO246hcnW4Q01RQXPYcucLgR/q4 X-Received: by 2002:a05:6a00:1703:b0:68e:36b1:3d85 with SMTP id h3-20020a056a00170300b0068e36b13d85mr15139052pfc.33.1694506608396; Tue, 12 Sep 2023 01:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694506608; cv=none; d=google.com; s=arc-20160816; b=H0DErLkSCVfn9S0vDITquFPyd+CdM0dHBPsmcHXzpjusANswo5i/cfBfQ+ZDmRLYvD K7t6Zl+zSvS+rlCwC5VMx9fq+d+dsVQt8sgRSi0MWCgdRSAl0ufvKqg524JmobhcNqIi QLagezZoJJBsQCbBZX6kfH18wjcBUH3Z1Yf5m4VljkMivhHZsje2+EewzlUIRZ+p5o5S GyvWJnOxhu7du1mg62Dw5v42stzf+13L/XNsUqGWL9AdFtmSzq5PWDF4e3MijpHWsqms qzo3w02Lpc8iMGzHrYvLgwjB8coHQtNxD0IwfjMLvZZlV6Hs41jmHjScKtC8ewcbLzS8 mHqg== 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 :message-id:date:subject:cc:to:from; bh=TOtHU22B5eoPlBUGBiDXXjz9mg1u8beCfgCMXWiJqhU=; fh=kxe0WRziv7CVSpkNH/bNiH26639+950jD1JJwWX77uk=; b=c8s8iajQyHKIGTwi8ka86hWopHVWcfUI8PaMNOJRam4+4nHgToMk9T3ZIspu2HWtjr 39uOEiWIsl+pHmO4ieMc73nRy3gjoznC1nH8VqJS0l5HFR4iClWF7GkoVqcYMUeymeqJ rvWJVW+GoklxBXswWb+MTYf98RuK8kUmGLoXzSfhOOkEC++9zOyU9CIg8Xz1G7pfncF8 vL5Y/1zZAVOhJyj58R6MDo9g7m4PjgVXlA7G4WJM5ScwPOSgVXS5cy3w6eHR9FxUqDag Z4KfvwN6EMk9uUhKCUrxocnMBd4OfXfOb1hUmI0ZAVK07H001SVWCfBunR1y708+Uvnz h3Og== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id a21-20020a056a000c9500b0068e39cd7acdsi7768092pfv.83.2023.09.12.01.16.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 5607581653A5; Tue, 12 Sep 2023 01:14:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232385AbjILIOQ convert rfc822-to-8bit (ORCPT + 38 others); Tue, 12 Sep 2023 04:14:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232228AbjILIOO (ORCPT ); Tue, 12 Sep 2023 04:14:14 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6033DE7F; Tue, 12 Sep 2023 01:14:10 -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 A64DA24E2FE; Tue, 12 Sep 2023 16:14:03 +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; Tue, 12 Sep 2023 16:14:03 +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; Tue, 12 Sep 2023 16:14:02 +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 1/3] dt-bindings: mmc: Remove properties from required Date: Tue, 12 Sep 2023 16:13:56 +0800 Message-ID: <20230912081402.51477-1-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag 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 (pete.vger.email [0.0.0.0]); Tue, 12 Sep 2023 01:14:35 -0700 (PDT) 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 pete.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776818961618664480 X-GMAIL-MSGID: 1776818961618664480 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 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 Tue Sep 12 08:13:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Qiu X-Patchwork-Id: 138020 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp255040vqx; Tue, 12 Sep 2023 01:21:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHLmQM4K6NqU5QUMy+W5+jZ6IMfi5NoEI/Q6so2Mm0s7I/V27C/MttaXiesM1AQzjfga+yW X-Received: by 2002:a05:6a20:321b:b0:14c:a2e1:65ec with SMTP id hl27-20020a056a20321b00b0014ca2e165ecmr11922513pzc.38.1694506901432; Tue, 12 Sep 2023 01:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694506901; cv=none; d=google.com; s=arc-20160816; b=dyazq4DvDe0N1ja2v+sRs8lfHbQQpFZL+Tf7Chz+D9mPZsw0BSE8zY7qpk++ycJaBK X4w0rF8Mc1PB4yRxlW9HYXqmh6Gqt5OmBguPWS2KHmg04QjCu9XwabuNI2mIS8QV/Ly5 WOu4ROSzgvn0rph/77Df+b2Aw+VQoWtA1npmAh0kmAXaXDb3jins9wCAAWMF+iQJkped G7RuXnhhdfp6bzvlid6uEZBnPSKfQ9nEMhTXSSic4C9c6Wof0+rJYcQ0VyhXQiDlzLdg xpuvXgm2goa/EX68x5m3NhjmOZKedJQ37yKXDuchdszN6chCPBT+Wc60iZ0fx0iHDPCZ SCeQ== 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=6hiTQsZpD+/fTcznOpwgCOr+fy14M15YPVeYLxQnZEI=; fh=kxe0WRziv7CVSpkNH/bNiH26639+950jD1JJwWX77uk=; b=Pa8PVvhst2L4o6kIHJC/WWofQFM1GKTYbrMjhtRK4Bcd/NWrBnhhbxasapoFqhW9GM ntr+7KvJlk16LPxMFNCBc+QUL5aIQUPZrx7tJmu4wg7LdN7GrnOAwQ1rw0E/OdnWiaz1 je2k+TOksW69s3JH75cWF161d2+Q9p5TBfBjql6xWc+tITv3IXxBGH45MQzpZFrL8phd apDnfJHAt5e0rnLw1eytcAfo/HN//dWao53gI0o8PABckpwgwaFEQceMWAGiUtsqMN0X 4h9ugpY8ZyUv7wxR5AJRtxGm1OoCsEA/XWWiRh+ijnmlFnsyjnQQcW49Qw0te3Fe6UC/ FBaA== 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:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id c12-20020a17090a8d0c00b00273fa934cc1si4785424pjo.167.2023.09.12.01.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:21:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id B9B4F83AB347; Tue, 12 Sep 2023 01:14:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232496AbjILIOZ convert rfc822-to-8bit (ORCPT + 38 others); Tue, 12 Sep 2023 04:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232317AbjILIOP (ORCPT ); Tue, 12 Sep 2023 04:14:15 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96F99E73; Tue, 12 Sep 2023 01:14:11 -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 7CC9824E308; Tue, 12 Sep 2023 16:14:04 +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; Tue, 12 Sep 2023 16:14:04 +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; Tue, 12 Sep 2023 16:14:03 +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 2/3] mmc: starfive: Change tuning implementation Date: Tue, 12 Sep 2023 16:13:57 +0800 Message-ID: <20230912081402.51477-2-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230912081402.51477-1-william.qiu@starfivetech.com> References: <20230912081402.51477-1-william.qiu@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag 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]); Tue, 12 Sep 2023 01:14:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776819268372030279 X-GMAIL-MSGID: 1776819268372030279 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 --- 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..2ee66a94ccaa 100644 --- a/drivers/mmc/host/dw_mmc-starfive.c +++ b/drivers/mmc/host/dw_mmc-starfive.c @@ -20,13 +20,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 +38,66 @@ 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 mask = 0x1f; + 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_raise >= 0) + 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 Tue Sep 12 08:13:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Qiu X-Patchwork-Id: 138021 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp255691vqx; Tue, 12 Sep 2023 01:23:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwi5Dpx82e+jfHfwHfBZqW5exEPS/0KxXntb5bgKOS1nbjS3yDDbIs7SKPZCGSPi9YtOKb X-Received: by 2002:a17:902:d505:b0:1bd:f71c:3af3 with SMTP id b5-20020a170902d50500b001bdf71c3af3mr11464921plg.32.1694507004957; Tue, 12 Sep 2023 01:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694507004; cv=none; d=google.com; s=arc-20160816; b=RMt/aMHayOxkUEMLA4n6Dz0jXSR6rQ2fyZK1BCxujpJB5Psr9CuP/B1MtK06D0BDm9 70oBKCx7i6fgTcNsAsIfijZb1wKAteUX/G+yoKCBN6uXkBEEzgbnf1/0BnAUjkGJMllW 5PSbp74+S8Li2VLx38TK9hY/z3PcMTQNDf6DgDzt53Lg0+InKDH/oZlTCJvR3zS9ugqv M76GJbEa5NGrqsBUbEP2GET0PL74i9xO9G0xgxXSrf2HPdP/4BFZFB6B0NDTQv64O5ev yGw14xabn+7JpL3I0g7SbdC5oL4xjgkiv4kHf50t+aLWYWwttBpEyHCxPJNEoZoqH3l5 GG0Q== 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=YbEygBF0EWlIQSf4BXhD5yU13T7Y0DcySJ7Cd7Ww6hg=; fh=kxe0WRziv7CVSpkNH/bNiH26639+950jD1JJwWX77uk=; b=gy2/hOlBxUPIppYFBOD/7oblS3i5kgWgrVLfxPHejrUgPZVDI20XfAiL/CUr6okR3+ 5iM/RAJsdacJjIN4BjFg7RFkGOL+YlOjunApoOOZiHeJunUNnQcN+7tzMkgEtSeQgX4w yKBGelB02eNq/9NUYIawa9Zr1l/3Gz2nMgomkrp4QVNAsSRCIjWR/1EKvqUy4yN6fQPx r+VozhbemIgMhfMEymXGyLqSQpEWJN7HCyuTwg1tt7/COKPc7ggKz3NjPkYf+kgb/odk khpBOt9CVy+rQKkXeFSOqGgDBNu46VNywmTlKUPVFQ+nd834mZ7YpU0tXaq8Q3+jjF2M EaNg== 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:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id c13-20020a170902d48d00b001c38abae9b6si727956plg.258.2023.09.12.01.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:23:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 4B5D6869EAF5; Tue, 12 Sep 2023 01:14:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232228AbjILIO2 convert rfc822-to-8bit (ORCPT + 38 others); Tue, 12 Sep 2023 04:14:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232347AbjILIOP (ORCPT ); Tue, 12 Sep 2023 04:14:15 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD55010C4; Tue, 12 Sep 2023 01:14:11 -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 26AE4807D; Tue, 12 Sep 2023 16:14:05 +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; Tue, 12 Sep 2023 16:14:05 +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; Tue, 12 Sep 2023 16:14:04 +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 3/3] riscv: dts: starfive: Drop unused properties and limit frquency Date: Tue, 12 Sep 2023 16:13:58 +0800 Message-ID: <20230912081402.51477-3-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230912081402.51477-1-william.qiu@starfivetech.com> References: <20230912081402.51477-1-william.qiu@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag 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 (howler.vger.email [0.0.0.0]); Tue, 12 Sep 2023 01:14:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776819377237261289 X-GMAIL-MSGID: 1776819377237261289 Drop unused properties and limit cclk_in to 50M, thus cancelling the internal frequency and adopting the by-pass mode. Signed-off-by: William Qiu --- .../riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi | 4 ++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) 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; diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi index e85464c328d0..7b8e841aeef8 100644 --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi @@ -870,7 +870,6 @@ mmc0: mmc@16010000 { fifo-depth = <32>; fifo-watermark-aligned; data-addr = <0>; - starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>; status = "disabled"; }; @@ -886,7 +885,6 @@ mmc1: mmc@16020000 { fifo-depth = <32>; fifo-watermark-aligned; data-addr = <0>; - starfive,sysreg = <&sys_syscon 0x9c 0x1 0x3e>; status = "disabled"; };