Message ID | 20231130-bobbing-valid-b97f26fe8edc@spud |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp500870vqy; Thu, 30 Nov 2023 08:12:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLHU7HOjzionJxT4u9VmEUhuYXhmzhGe76v6iRjAg+m75Ab+/1Dp5QK19Po4cH08qOevxd X-Received: by 2002:a17:902:b709:b0:1d0:48cf:bbe1 with SMTP id d9-20020a170902b70900b001d048cfbbe1mr511300pls.56.1701360734372; Thu, 30 Nov 2023 08:12:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701360734; cv=none; d=google.com; s=arc-20160816; b=z012r3ERLOzVdi1lBfzUZTwKm2OpCfp6U6uf9t3W6TLsPPqNpY6hwAD6jeKAahpX5E otHEN4x4YQd77oLD8x8LO8DVP9v2h+qGGoVVPpfGMEiLUnx8PQ+GI1kGbcfcEEsQDN2R NEen1svBr8fEcpf+cgBjTNII5vDV98pkEDQ5xWOCDFp7ZN78J3iEJM5+fOHXRrNL6V7+ X5KlCA4k9BtXRM05IiOpogVyPzbSXHRmMbt9gaFH+A8gAh8fUVGf1bt7hob5/U0irX4d EF0lOcpHBOET3pQQQXEDXo2kUaHdSF0iBTCcxBFBHkuAk0+iExTauEmyD3NNQLvyIeO2 57yQ== 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:dkim-signature; bh=iia1AAo/VQamUp8Piu+VUARI/0NbyDfCywV4Ja+cIKA=; fh=UOvp5DSrzPmG4OgfR/dFTfRMPUfh2LXITpsaEPHgg/s=; b=EqcXU1FbSeWYlI3Rn/YQxSCwUnyhrvEXViNeQrEC7hJv8HhFVmI4UmLMefA77DBxow h7JcmP4TPVIEp4bRyWtC9yoehsVqwZd3kEUJDEb547mzH3HAlCyx+drZSPIa+G2Bksc1 0LebhDg0Z0Z8YfwY9ZT/FcPRtDE5UgDUoHYs1eyZD8uuH859EFokog//r60A5ycTrdDb Dbby5yhomfjl3JZST+/ZHL84FPy9IIi8bIKAHkE+9mqzT/HFWg+ubTNLEvXyatlo0aFr D2g3doOM5X9+7EtLyTzR4A253sGgKv1s4OJInkyamZ+S24ye/OGdmXlOiQsY6XARLwmC 04Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qpFBB3Yy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id e4-20020a170902b78400b001b3d6c68bd1si1387677pls.643.2023.11.30.08.12.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 08:12:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qpFBB3Yy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 95B4480C843C; Thu, 30 Nov 2023 08:12:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231995AbjK3QLw (ORCPT <rfc822;ruipengqi7@gmail.com> + 99 others); Thu, 30 Nov 2023 11:11:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231837AbjK3QLv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 30 Nov 2023 11:11:51 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D61B9197 for <linux-kernel@vger.kernel.org>; Thu, 30 Nov 2023 08:11:57 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6BF3C433C9; Thu, 30 Nov 2023 16:11:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701360717; bh=vgls5aAlR31WZeeFitudv2gLn3KRn15unDZWj9i/v9g=; h=From:To:Cc:Subject:Date:From; b=qpFBB3YyXinuwQ+7fxRfXLLxKE0ptbNJCoa58UsrfVolYTGrIN1Pq9t4kjnmzbAHV bWQPN7icrc7LX8RweUK5aEZ8opCL1tGDyvFbhxkAGA8ZSpb8SzCCkGb4HBuk6znZmO 2adWWVogvmoQGNt2U0+c8jk98xkl87kJ8b44LsD0o8aAPdFeNkFUqB555ynQ+jWdhG cy5dVleeSgOvGWrVqSgZDEP/ueHS7LEWExLonaqssLT8PTbm5GMMG6zRIzFKN2hIrW DAmLMyyC+/qA1VrgqwObv6RHEa3mRsYY8PpvpeysPkQcRzyDBrNUZjICwA7onqEwQh WPofq+wUXfGwA== From: Conor Dooley <conor@kernel.org> To: linux-riscv@lists.infradead.org Cc: conor@kernel.org, Conor Dooley <conor.dooley@microchip.com>, Emil Renner Berthing <kernel@esmil.dk>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Walker Chen <walker.chen@starfivetech.com>, JeeHeng Sia <jeeheng.sia@starfivetech.com>, Leyfoon Tan <leyfoon.tan@starfivetech.com> Subject: [PATCH v1] riscv: dts: starfive: move timebase-frequency to .dtsi Date: Thu, 30 Nov 2023 16:11:28 +0000 Message-Id: <20231130-bobbing-valid-b97f26fe8edc@spud> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3135; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=UAAVjF121WPRFea5qRuZ2irQEO1X8uw6HeaKklYIqBU=; b=owGbwMvMwCFWscWwfUFT0iXG02pJDKkZW3TOhG9ZnWv8re2Ju/KbiwqCtQG/lmyyaJXdO/3bn xOCvjP9OkpZGMQ4GGTFFFkSb/e1SK3/47LDuectzBxWJpAhDFycAjCRjAcMf/iuWffPjtxU3cd9 N3zyZtWHfUpdCbK2Fs/frk9RPli32Zfhf4r2nG9fpHmOTkrxrO1xYTKdyat5KOTL291Oja2JahF 1PAA= X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> 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, 30 Nov 2023 08:12:11 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784006033606361345 X-GMAIL-MSGID: 1784006033606361345 |
Series |
[v1] riscv: dts: starfive: move timebase-frequency to .dtsi
|
|
Commit Message
Conor Dooley
Nov. 30, 2023, 4:11 p.m. UTC
From: Conor Dooley <conor.dooley@microchip.com> Properties fixed by the SoC should be defined in the $soc.dtsi, and the timebase-frequency is not sourced directly from an off-chip oscillator. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> --- I actually have no idea whether this is true or not, I asked on the jh8100 series but only got an answer for that SoC and not the existing ones. I'm hoping that a patch envokes more of a reaction! CC: Emil Renner Berthing <kernel@esmil.dk> CC: Conor Dooley <conor@kernel.org> CC: Rob Herring <robh+dt@kernel.org> CC: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> CC: Paul Walmsley <paul.walmsley@sifive.com> CC: Palmer Dabbelt <palmer@dabbelt.com> CC: linux-riscv@lists.infradead.org CC: devicetree@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: Walker Chen <walker.chen@starfivetech.com> CC: JeeHeng Sia <jeeheng.sia@starfivetech.com> CC: Leyfoon Tan <leyfoon.tan@starfivetech.com> --- arch/riscv/boot/dts/starfive/jh7100-common.dtsi | 4 ---- arch/riscv/boot/dts/starfive/jh7100.dtsi | 1 + .../riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi | 4 ---- arch/riscv/boot/dts/starfive/jh7110.dtsi | 1 + 4 files changed, 2 insertions(+), 8 deletions(-)
Comments
> -----Original Message----- > From: Conor Dooley <conor@kernel.org> > Sent: Friday, December 1, 2023 12:11 AM > To: linux-riscv@lists.infradead.org > Cc: conor@kernel.org; Conor Dooley <conor.dooley@microchip.com>; Emil Renner Berthing <kernel@esmil.dk>; Rob Herring > <robh+dt@kernel.org>; Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Paul Walmsley <paul.walmsley@sifive.com>; > Palmer Dabbelt <palmer@dabbelt.com>; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Walker Chen > <walker.chen@starfivetech.com>; JeeHeng Sia <jeeheng.sia@starfivetech.com>; Leyfoon Tan <leyfoon.tan@starfivetech.com> > Subject: [PATCH v1] riscv: dts: starfive: move timebase-frequency to .dtsi > > From: Conor Dooley <conor.dooley@microchip.com> > > Properties fixed by the SoC should be defined in the $soc.dtsi, and the > timebase-frequency is not sourced directly from an off-chip oscillator. > > Signed-off-by: Conor Dooley <conor.dooley@microchip.com> > --- > I actually have no idea whether this is true or not, I asked on the > jh8100 series but only got an answer for that SoC and not the existing > ones. I'm hoping that a patch envokes more of a reaction! I believe it is controlled by the internal clock, but I will let Walker have the final say. > > CC: Emil Renner Berthing <kernel@esmil.dk> > CC: Conor Dooley <conor@kernel.org> > CC: Rob Herring <robh+dt@kernel.org> > CC: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> > CC: Paul Walmsley <paul.walmsley@sifive.com> > CC: Palmer Dabbelt <palmer@dabbelt.com> > CC: linux-riscv@lists.infradead.org > CC: devicetree@vger.kernel.org > CC: linux-kernel@vger.kernel.org > CC: Walker Chen <walker.chen@starfivetech.com> > CC: JeeHeng Sia <jeeheng.sia@starfivetech.com> > CC: Leyfoon Tan <leyfoon.tan@starfivetech.com> > --- > arch/riscv/boot/dts/starfive/jh7100-common.dtsi | 4 ---- > arch/riscv/boot/dts/starfive/jh7100.dtsi | 1 + > .../riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi | 4 ---- > arch/riscv/boot/dts/starfive/jh7110.dtsi | 1 + > 4 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi > index b93ce351a90f..214f27083d7b 100644 > --- a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi > @@ -19,10 +19,6 @@ chosen { > stdout-path = "serial0:115200n8"; > }; > > - cpus { > - timebase-frequency = <6250000>; > - }; > - > memory@80000000 { > device_type = "memory"; > reg = <0x0 0x80000000 0x2 0x0>; > diff --git a/arch/riscv/boot/dts/starfive/jh7100.dtsi b/arch/riscv/boot/dts/starfive/jh7100.dtsi > index e68cafe7545f..c50b32424721 100644 > --- a/arch/riscv/boot/dts/starfive/jh7100.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7100.dtsi > @@ -16,6 +16,7 @@ / { > cpus { > #address-cells = <1>; > #size-cells = <0>; > + timebase-frequency = <6250000>; > > U74_0: cpu@0 { > compatible = "sifive,u74-mc", "riscv"; > 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 b89e9791efa7..7873c7ffde4d 100644 > --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi > @@ -26,10 +26,6 @@ chosen { > stdout-path = "serial0:115200n8"; > }; > > - cpus { > - timebase-frequency = <4000000>; > - }; > - > memory@40000000 { > device_type = "memory"; > reg = <0x0 0x40000000 0x1 0x0>; > diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi > index 45213cdf50dc..ee7d4bb1f537 100644 > --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi > @@ -18,6 +18,7 @@ / { > cpus { > #address-cells = <1>; > #size-cells = <0>; > + timebase-frequency = <4000000>; > > S7_0: cpu@0 { > compatible = "sifive,s7", "riscv"; > -- > 2.39.2
Conor Dooley wrote: > From: Conor Dooley <conor.dooley@microchip.com> > > Properties fixed by the SoC should be defined in the $soc.dtsi, and the > timebase-frequency is not sourced directly from an off-chip oscillator. Yes, according to the JH7100 docs[1] the mtime register is sourced from the osc_sys external oscillator through u74rtc_toggle. However I haven't yet found a place in the docs that describe where that clock is divided by 4 to get 6.25MHz from the 25MHz. I expect the JH7110 mtime is set up in a similar way, but haven't yet dug into the available documentation. [1]: https://github.com/starfive-tech/JH7100_Docs/blob/main/vic_u7_manual_with_creativecommons.pdf /Emil > > Signed-off-by: Conor Dooley <conor.dooley@microchip.com> > --- > I actually have no idea whether this is true or not, I asked on the > jh8100 series but only got an answer for that SoC and not the existing > ones. I'm hoping that a patch envokes more of a reaction! > > CC: Emil Renner Berthing <kernel@esmil.dk> > CC: Conor Dooley <conor@kernel.org> > CC: Rob Herring <robh+dt@kernel.org> > CC: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> > CC: Paul Walmsley <paul.walmsley@sifive.com> > CC: Palmer Dabbelt <palmer@dabbelt.com> > CC: linux-riscv@lists.infradead.org > CC: devicetree@vger.kernel.org > CC: linux-kernel@vger.kernel.org > CC: Walker Chen <walker.chen@starfivetech.com> > CC: JeeHeng Sia <jeeheng.sia@starfivetech.com> > CC: Leyfoon Tan <leyfoon.tan@starfivetech.com> > --- > arch/riscv/boot/dts/starfive/jh7100-common.dtsi | 4 ---- > arch/riscv/boot/dts/starfive/jh7100.dtsi | 1 + > .../riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi | 4 ---- > arch/riscv/boot/dts/starfive/jh7110.dtsi | 1 + > 4 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi > index b93ce351a90f..214f27083d7b 100644 > --- a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi > @@ -19,10 +19,6 @@ chosen { > stdout-path = "serial0:115200n8"; > }; > > - cpus { > - timebase-frequency = <6250000>; > - }; > - > memory@80000000 { > device_type = "memory"; > reg = <0x0 0x80000000 0x2 0x0>; > diff --git a/arch/riscv/boot/dts/starfive/jh7100.dtsi b/arch/riscv/boot/dts/starfive/jh7100.dtsi > index e68cafe7545f..c50b32424721 100644 > --- a/arch/riscv/boot/dts/starfive/jh7100.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7100.dtsi > @@ -16,6 +16,7 @@ / { > cpus { > #address-cells = <1>; > #size-cells = <0>; > + timebase-frequency = <6250000>; > > U74_0: cpu@0 { > compatible = "sifive,u74-mc", "riscv"; > 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 b89e9791efa7..7873c7ffde4d 100644 > --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi > @@ -26,10 +26,6 @@ chosen { > stdout-path = "serial0:115200n8"; > }; > > - cpus { > - timebase-frequency = <4000000>; > - }; > - > memory@40000000 { > device_type = "memory"; > reg = <0x0 0x40000000 0x1 0x0>; > diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi > index 45213cdf50dc..ee7d4bb1f537 100644 > --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi > @@ -18,6 +18,7 @@ / { > cpus { > #address-cells = <1>; > #size-cells = <0>; > + timebase-frequency = <4000000>; > > S7_0: cpu@0 { > compatible = "sifive,s7", "riscv"; > -- > 2.39.2 >
On Fri, Dec 01, 2023 at 02:44:58PM +0100, Emil Renner Berthing wrote: > Conor Dooley wrote: > > From: Conor Dooley <conor.dooley@microchip.com> > > > > Properties fixed by the SoC should be defined in the $soc.dtsi, and the > > timebase-frequency is not sourced directly from an off-chip oscillator. > > Yes, according to the JH7100 docs[1] the mtime register is sourced from the > osc_sys external oscillator through u74rtc_toggle. However I haven't yet found > a place in the docs that describe where that clock is divided by 4 to get > 6.25MHz from the 25MHz. > > I expect the JH7110 mtime is set up in a similar way, but haven't yet dug into > the available documentation. Your other reply suggests that this is a fixed division for the jh7110, in which case it makes sense to leave it as-is. mpfs is different in that it is fixed to 1 MHz regardless of which of the permitted external oscillator frequencies you use.
Conor Dooley wrote: > On Fri, Dec 01, 2023 at 02:44:58PM +0100, Emil Renner Berthing wrote: > > Conor Dooley wrote: > > > From: Conor Dooley <conor.dooley@microchip.com> > > > > > > Properties fixed by the SoC should be defined in the $soc.dtsi, and the > > > timebase-frequency is not sourced directly from an off-chip oscillator. > > > > Yes, according to the JH7100 docs[1] the mtime register is sourced from the > > osc_sys external oscillator through u74rtc_toggle. However I haven't yet found > > a place in the docs that describe where that clock is divided by 4 to get > > 6.25MHz from the 25MHz. > > > > I expect the JH7110 mtime is set up in a similar way, but haven't yet dug into > > the available documentation. > > Your other reply suggests that this is a fixed division for the jh7110, > in which case it makes sense to leave it as-is. mpfs is different in > that it is fixed to 1 MHz regardless of which of the permitted external > oscillator frequencies you use. This is what I've found for the JH7100: osc_sys (25MHz) -> u74rtc_toggle (gate) -> ? (div 4) -> mtime The divide by 4 is not in the regular clock tree, so if it is configurable it must be some bits hidden in the syscon area or something. The only restriction I've found in the docs is that it must be strictly less than half the rate of the core clock. For the JH7110 it goes: osc (24MHz) -> rtc_toggle (div N) -> mtime ..where N defaults to 6 and this is also the maximum N. /Emil
On 2023/12/1 0:11, Conor Dooley wrote: > From: Conor Dooley <conor.dooley@microchip.com> > > Properties fixed by the SoC should be defined in the $soc.dtsi, and the > timebase-frequency is not sourced directly from an off-chip oscillator. > > Signed-off-by: Conor Dooley <conor.dooley@microchip.com> > --- > I actually have no idea whether this is true or not, I asked on the > jh8100 series but only got an answer for that SoC and not the existing > ones. I'm hoping that a patch envokes more of a reaction! > > CC: Emil Renner Berthing <kernel@esmil.dk> > CC: Conor Dooley <conor@kernel.org> > CC: Rob Herring <robh+dt@kernel.org> > CC: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> > CC: Paul Walmsley <paul.walmsley@sifive.com> > CC: Palmer Dabbelt <palmer@dabbelt.com> > CC: linux-riscv@lists.infradead.org > CC: devicetree@vger.kernel.org > CC: linux-kernel@vger.kernel.org > CC: Walker Chen <walker.chen@starfivetech.com> > CC: JeeHeng Sia <jeeheng.sia@starfivetech.com> > CC: Leyfoon Tan <leyfoon.tan@starfivetech.com> > --- > arch/riscv/boot/dts/starfive/jh7100-common.dtsi | 4 ---- > arch/riscv/boot/dts/starfive/jh7100.dtsi | 1 + > .../riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi | 4 ---- > arch/riscv/boot/dts/starfive/jh7110.dtsi | 1 + > 4 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi > index b93ce351a90f..214f27083d7b 100644 > --- a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi > @@ -19,10 +19,6 @@ chosen { > stdout-path = "serial0:115200n8"; > }; > > - cpus { > - timebase-frequency = <6250000>; > - }; > - > memory@80000000 { > device_type = "memory"; > reg = <0x0 0x80000000 0x2 0x0>; > diff --git a/arch/riscv/boot/dts/starfive/jh7100.dtsi b/arch/riscv/boot/dts/starfive/jh7100.dtsi > index e68cafe7545f..c50b32424721 100644 > --- a/arch/riscv/boot/dts/starfive/jh7100.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7100.dtsi > @@ -16,6 +16,7 @@ / { > cpus { > #address-cells = <1>; > #size-cells = <0>; > + timebase-frequency = <6250000>; > > U74_0: cpu@0 { > compatible = "sifive,u74-mc", "riscv"; > 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 b89e9791efa7..7873c7ffde4d 100644 > --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi > @@ -26,10 +26,6 @@ chosen { > stdout-path = "serial0:115200n8"; > }; > > - cpus { > - timebase-frequency = <4000000>; > - }; > - > memory@40000000 { > device_type = "memory"; > reg = <0x0 0x40000000 0x1 0x0>; > diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi > index 45213cdf50dc..ee7d4bb1f537 100644 > --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi > @@ -18,6 +18,7 @@ / { > cpus { > #address-cells = <1>; > #size-cells = <0>; > + timebase-frequency = <4000000>; > > S7_0: cpu@0 { > compatible = "sifive,s7", "riscv"; Hi Conor and Emil, I found some information that I hope will be useful to you. What Emil said is right: osc (24MHz) -> rtc_toggle (div N) -> mtime I found the N is depend on this clock register in drivers/clk/starfive/clk-starfive-jh7110-sys.c: 83 JH71X0__DIV(JH7110_SYSCLK_RTC_TOGGLE, "rtc_toggle", 6, JH7110_SYSCLK_OSC), and the description of the register is that the divider defaults to and is fixed to 6. So the timebase-frequency is 4MHz on the JH7110. Best regards, Xingyu Wu
diff --git a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi index b93ce351a90f..214f27083d7b 100644 --- a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi @@ -19,10 +19,6 @@ chosen { stdout-path = "serial0:115200n8"; }; - cpus { - timebase-frequency = <6250000>; - }; - memory@80000000 { device_type = "memory"; reg = <0x0 0x80000000 0x2 0x0>; diff --git a/arch/riscv/boot/dts/starfive/jh7100.dtsi b/arch/riscv/boot/dts/starfive/jh7100.dtsi index e68cafe7545f..c50b32424721 100644 --- a/arch/riscv/boot/dts/starfive/jh7100.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7100.dtsi @@ -16,6 +16,7 @@ / { cpus { #address-cells = <1>; #size-cells = <0>; + timebase-frequency = <6250000>; U74_0: cpu@0 { compatible = "sifive,u74-mc", "riscv"; 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 b89e9791efa7..7873c7ffde4d 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi @@ -26,10 +26,6 @@ chosen { stdout-path = "serial0:115200n8"; }; - cpus { - timebase-frequency = <4000000>; - }; - memory@40000000 { device_type = "memory"; reg = <0x0 0x40000000 0x1 0x0>; diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi index 45213cdf50dc..ee7d4bb1f537 100644 --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi @@ -18,6 +18,7 @@ / { cpus { #address-cells = <1>; #size-cells = <0>; + timebase-frequency = <4000000>; S7_0: cpu@0 { compatible = "sifive,s7", "riscv";