From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2073BC636D7 for ; Tue, 21 Feb 2023 06:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+mwr7woem1Si5zGsTgH+VjOl/HqY4QXtMIcOeLJaa1g=; b=RQCPL+SkIyYV47 Yj4YCBna4NcfbXA47D965zicVYMnG1vHuHJAtxKx62OWB47I87kUnOgePmPphIRZOZwmJs5TXAAG4 qBf+/Xm9ZwTbKKdT46qFazSQ3LqC25AfUwLhjvVEBjLshrlzdAKVuvFCOYJMVyG7m31E85/wpc3mE zQHMfiKItINvesphsxMCm8DIsHaVrAwu4aIX+lp+GwHGyXrN5eq0m5W7k9cvvq71gSCI1zjDMtALs BQvbM4Hp4kGHJbRerHXHJD/wX71ooVgp6d9is+c6NeAKGuyx4pALJRsXTpje1W71WNm+Gd5p5sjzx f/5o1ISevn6xV8CExr2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUMOP-006mEN-1o; Tue, 21 Feb 2023 06:44:49 +0000 Received: from fd01.gateway.ufhost.com ([61.152.239.71]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUMOK-006mC9-Fo for linux-riscv@lists.infradead.org; Tue, 21 Feb 2023 06:44:47 +0000 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 4757F24E31E; Tue, 21 Feb 2023 14:44:12 +0800 (CST) Received: from EXMBX172.cuchost.com (172.16.6.92) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 21 Feb 2023 14:44:12 +0800 Received: from [192.168.125.82] (183.27.98.67) by EXMBX172.cuchost.com (172.16.6.92) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 21 Feb 2023 14:44:11 +0800 Message-ID: Date: Tue, 21 Feb 2023 14:44:10 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH v3 09/11] clk: starfive: Add StarFive JH7110 system clock driver Content-Language: en-US To: Emil Renner Berthing CC: , , , Conor Dooley , Palmer Dabbelt , Rob Herring , Krzysztof Kozlowski , Stephen Boyd , "Michael Turquette" , Philipp Zabel , References: <20221220005054.34518-1-hal.feng@starfivetech.com> <20221220005054.34518-10-hal.feng@starfivetech.com> From: Hal Feng In-Reply-To: X-Originating-IP: [183.27.98.67] X-ClientProxiedBy: EXCAS061.cuchost.com (172.16.6.21) To EXMBX172.cuchost.com (172.16.6.92) X-YovoleRuleAgent: yovoleflag X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230220_224444_835373_245C28E4 X-CRM114-Status: GOOD ( 18.60 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Sun, 19 Feb 2023 22:23:39 +0100, Emil Renner Berthing wrote: > On Tue, 20 Dec 2022 at 01:51, Hal Feng wrote: >> diff --git a/drivers/clk/starfive/clk-starfive-jh7110-sys.c b/drivers/clk/starfive/clk-starfive-jh7110-sys.c >> new file mode 100644 >> index 000000000000..abc1c280bbe3 >> --- /dev/null >> +++ b/drivers/clk/starfive/clk-starfive-jh7110-sys.c >> @@ -0,0 +1,448 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> +/* >> + * StarFive JH7110 System Clock Driver [...] >> +static int __init jh7110_syscrg_probe(struct platform_device *pdev) >> +{ >> + struct jh71x0_clk_priv *priv; >> + unsigned int idx; >> + int ret; >> + >> + priv = devm_kzalloc(&pdev->dev, >> + struct_size(priv, reg, JH7110_SYSCLK_PLL0_OUT), >> + GFP_KERNEL); >> + if (!priv) >> + return -ENOMEM; >> + >> + spin_lock_init(&priv->rmw_lock); >> + priv->dev = &pdev->dev; >> + priv->base = devm_platform_ioremap_resource(pdev, 0); >> + if (IS_ERR(priv->base)) >> + return PTR_ERR(priv->base); >> + >> + dev_set_drvdata(priv->dev, priv->base); >> + >> + /* 24MHz -> 1250.0MHz */ >> + priv->pll[0] = devm_clk_hw_register_fixed_factor(priv->dev, "pll0_out", >> + "osc", 0, 625, 12); >> + if (IS_ERR(priv->pll[0])) >> + return PTR_ERR(priv->pll[0]); > > Hi Hal, > > Are you sure this should be 1.25GHz and not 1GHz? I can't seem to make > the ethernet driver work unless I set it to 1GHz. This also makes > other derived clocks that should be 125MHz show up as such in the > clock tree. Eg. "usb_125m". > > Perhaps it's because I updated my board to the latest u-boot > release[1]. I know these PLLs are just placeholders until you add > proper code to control them, but until then it's important that these > values match the defaults or whatever the latest u-boot sets them to. > Please check the PLLs below with the latest u-boot too. > > /Emil > > [1]: https://github.com/starfive-tech/VisionFive2/releases After this series sent out, we found a bug in the u-boot when cpu running at 1.25 GHz, so now the cpu runs at 1GHz in the latest u-boot. I have updated it in v4. Thanks for reminding. What's more, we will support adjusting the cpu frequency in the future, so the cpu can run at a higher frequency. Best regards, Hal > >> + /* 24MHz -> 1066.0MHz */ >> + priv->pll[1] = devm_clk_hw_register_fixed_factor(priv->dev, "pll1_out", >> + "osc", 0, 533, 12); >> + if (IS_ERR(priv->pll[1])) >> + return PTR_ERR(priv->pll[1]); >> + >> + /* 24MHz -> 1188.0MHz */ >> + priv->pll[2] = devm_clk_hw_register_fixed_factor(priv->dev, "pll2_out", >> + "osc", 0, 99, 2); >> + if (IS_ERR(priv->pll[2])) >> + return PTR_ERR(priv->pll[2]); _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv