Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2642579rdb; Mon, 4 Dec 2023 03:37:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWk9VXeyjKhiKt47s3pM5TOYOicqAw9MPU1cYwLt/gMFXE1cnTJ6Y4ygItxGd29Aajfan6 X-Received: by 2002:a05:6a20:430e:b0:18f:97c:976c with SMTP id h14-20020a056a20430e00b0018f097c976cmr4571993pzk.84.1701689859863; Mon, 04 Dec 2023 03:37:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701689859; cv=none; d=google.com; s=arc-20160816; b=0ZXKDO1PtTpvMidFdMmRYoyh2ZOg3KMHMCNxQ0C53Cw+yxg2SPRYl8LCtGVEcZ9+VT Xsyj7qkw/5PcmUX3hqiUo3YMyRYXwK5Eu0zwxDVp8IRLhRf9b3NKrLBSrEScFx5YrwDC dVBNDgJ2XyYrOdYbBtV7ISv6BAUcL0ssMSBcSHtcjlRGMzgvnZ0lgCETwicm3JMxAsTM WeRAHTtOuTJATJHT+RudIUBc2LTASgYdKuNRGTaKAjAdlHny88PnZZyIRhHBNIASC08v NAiXuNX6pZAD9DDD181Qc+x0dtx4t+xpjoesKZWpsNuanYmJORptDwrzLX4BNJhuvp39 aEUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Z0heqXJTaOBa0RSc0jtpCP7Jd1w5IVXoMirtNd1x4AQ=; fh=74Ni89K9ZKWIrHv4cRaqo1HEea1RhcnXSI6mv33ik7c=; b=IkkEbhNd/6ACjD27pNEkk834ktTsD8oXK6gtla8OJ2J+Z/ymfvHsWJbGXafXCmIEDF WBw3lkO36WHI737vGdT2aYmy8Z12kqWrRpmVWyBhyvDMBBRFX4b7FJA0CyqblPvOQois AdExxePjFsO8n+WeiVdzEHLLgCeMKzmRpvJDTNbmVNOPjMXo06QpRZ2Q/3NjFh3Xg6Ll Va/TSFZD0TNJp5FiABx8Ef02hGE17yPt8NB+AtlWZfVC8c3uO4ndqbAtnK6mFMkH52bH QdMwfCFumoB4EFU2xi/IdlHR7c85P4VX2jU2oiC2hDvj8mtrNwxQR9ArFKm8+dVILUAM ipOw== 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 Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id d8-20020a63ed08000000b005c61d17e6aasi7749014pgi.122.2023.12.04.03.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 03:37:39 -0800 (PST) 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 04C26805000E; Mon, 4 Dec 2023 03:37:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231160AbjLDLhO (ORCPT + 99 others); Mon, 4 Dec 2023 06:37:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbjLDLhN (ORCPT ); Mon, 4 Dec 2023 06:37:13 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A27CAB0; Mon, 4 Dec 2023 03:37:15 -0800 (PST) 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 fd01.gateway.ufhost.com (Postfix) with ESMTP id 7798517F57; Mon, 4 Dec 2023 19:37:07 +0800 (CST) Received: from EXMBX061.cuchost.com (172.16.6.61) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 4 Dec 2023 19:37:07 +0800 Received: from [192.168.125.131] (183.27.97.199) by EXMBX061.cuchost.com (172.16.6.61) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 4 Dec 2023 19:37:06 +0800 Message-ID: Date: Mon, 4 Dec 2023 19:29:35 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] riscv: dts: starfive: move timebase-frequency to .dtsi Content-Language: en-US To: Conor Dooley , Emil Renner Berthing , CC: Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , , , Walker Chen , JeeHeng Sia , Leyfoon Tan References: <20231130-bobbing-valid-b97f26fe8edc@spud> From: Xingyu Wu In-Reply-To: <20231130-bobbing-valid-b97f26fe8edc@spud> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [183.27.97.199] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX061.cuchost.com (172.16.6.61) 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,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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 04 Dec 2023 03:37:37 -0800 (PST) On 2023/12/1 0:11, Conor Dooley wrote: > From: Conor Dooley > > 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 > --- > 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 > CC: Conor Dooley > CC: Rob Herring > CC: Krzysztof Kozlowski > CC: Paul Walmsley > CC: Palmer Dabbelt > CC: linux-riscv@lists.infradead.org > CC: devicetree@vger.kernel.org > CC: linux-kernel@vger.kernel.org > CC: Walker Chen > CC: JeeHeng Sia > CC: Leyfoon Tan > --- > 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