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 236D5CD3431 for ; Wed, 4 Sep 2024 12:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type: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=+Dou6mOpsNIsQhbLYqI2p6f69XLT/g8gRU79/Y8W7xI=; b=UY3MUtQ7y/I1zKjVjBDBbLFKCC EraSUW6KTgln7ExbY24zmqXZ8rvO1e5XIoGgwKvdGqsIFABsouSLau66N0GcTOy5P+jkmoLygbz9n 7C6DY9JpH4zgxTFlSMS6SjbYjw28bLmPlEGpEBVetHaNKCUZz5D3uA7igB5p94ChN/mJg2ajsIoj6 ATmcRx49SNbrvoRcQpckCupeV7a6A4BES9g5017ySprkTrxTECOoaJ6sc9P6N32GwRrH441pUnA8/ jaWVQqry0jABhbIdP9ANFBsbnHQ5ZTdWJLYbCTA18IyNZwZz+5Me7S/mbvPFyKbi/4pqCb7HtKeE3 IkqvwNJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sloyO-00000004Kyc-0j1B; Wed, 04 Sep 2024 12:18:56 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slox4-00000004KdO-37Gd for linux-arm-kernel@lists.infradead.org; Wed, 04 Sep 2024 12:17:56 +0000 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2f502086419so18034091fa.3 for ; Wed, 04 Sep 2024 05:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1725452253; x=1726057053; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+Dou6mOpsNIsQhbLYqI2p6f69XLT/g8gRU79/Y8W7xI=; b=Z9aUAD2lmxD2d/w8bhRvJodzHHCdKgZdyppKOJqGzFyVlOk5Ujmn4zyARQL28KROxx 270Szcbm9QgDi8uy8VTW5GlSFK5r0VMjoUbD/DIFLlqrtqCtMszEEEuq3Moin9yPSmmW 1nGZaBHMXtvw3PFxpTWSGHZ24Pk8OnWkJT4jIUpctw/JsakYEqftPp1UsGf9sLXPS7Vo Doj5mkMxNUYzvmqNhsKRoPTyUdPfPX0I72vJgWZQb57KNwO43Gp67+PKuhVup6mOWsf3 DPE/PV6BnfCe9g0QoZLN5R9fjv1ygP+x3NQC/eb8U7N/Bqi6+YTlih0Rh6AzadOV1CYi TMzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725452253; x=1726057053; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+Dou6mOpsNIsQhbLYqI2p6f69XLT/g8gRU79/Y8W7xI=; b=sZ44VDl5hbHKn9pDDVMaoMiCR/+b7DkaxqHmalDLFQ6PXUgK1qqVyoDjd2dYyz67K2 fR+sBn8ln2Npt/cskbawzBxkbVni8LFQ1lk0YQjaRQAHn3QzYcIZfXXLCwg8Bb6Yocf0 X2lNAedFHbJlUmtqAkk3VjnN7Cv/kIeK6ya9MW6cS0C9NwCO7+8NxB57cW3o1MfnNH4h c3b3Wez9nZKtmhDyiwzLBUNWuo1Y1g2wvP1TkcwNfEBkx+Jd3Zjtde6Iit2+F18/DKSl TfBi06xgzGZrFlZ1svUvdAh9so7pt747DwU19PqMpBnKnpEW2vfNLuQbsAXKwHIDGWdZ fHvA== X-Forwarded-Encrypted: i=1; AJvYcCXtBp5TT7Ph/7kBF+BUjHCm1Cx3oufp+JKEb6PFTlwufZodrAkErUuYV3brtkqTMBSdKskBLH/TUGvsvjE8AdDB@lists.infradead.org X-Gm-Message-State: AOJu0Yw4eRF9ITzNddHd6hnfNH9+EyabHHCgI5NjkN7wtLr3UjyDonPD C077tVI2HPFoSFbJCsIjSt/JXy2aMU0qBX+fE0D+JBjXcQFdu5A1mt7F/2dJtw4= X-Google-Smtp-Source: AGHT+IHIB0jGC+rRkMo8IDU8M56OjRH4fYE4YIr0S9tvlFg9or1QcS58k5s2WfCgUk3OlQ5thdo7OQ== X-Received: by 2002:a2e:1312:0:b0:2f3:d82b:1959 with SMTP id 38308e7fff4ca-2f64441ec9fmr46353361fa.23.1725452252267; Wed, 04 Sep 2024 05:17:32 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.144]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c226c7c39bsm7568836a12.52.2024.09.04.05.17.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Sep 2024 05:17:31 -0700 (PDT) Message-ID: Date: Wed, 4 Sep 2024 15:17:30 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 07/12] arm64: dts: renesas: r9a08g045: Add VBATTB node Content-Language: en-US To: Stephen Boyd , alexandre.belloni@bootlin.com, conor+dt@kernel.org, geert+renesas@glider.be, krzk+dt@kernel.org, magnus.damm@gmail.com, mturquette@baylibre.com, p.zabel@pengutronix.de, robh@kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Claudiu Beznea References: <20240830130218.3377060-1-claudiu.beznea.uj@bp.renesas.com> <20240830130218.3377060-8-claudiu.beznea.uj@bp.renesas.com> <83fac884d749bda0cf0b346e4e869bc8.sboyd@kernel.org> From: claudiu beznea In-Reply-To: <83fac884d749bda0cf0b346e4e869bc8.sboyd@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_051734_977577_747C541E X-CRM114-Status: GOOD ( 19.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, Stephen, On 03.09.2024 22:48, Stephen Boyd wrote: > Quoting Claudiu (2024-08-30 06:02:13) >> diff --git a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi >> index 067a26a66c24..247fa80a4f53 100644 >> --- a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi >> +++ b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi >> @@ -160,6 +160,18 @@ i2c3: i2c@10090c00 { >> status = "disabled"; >> }; >> >> + vbattb: vbattb@1005c000 { >> + compatible = "renesas,r9a08g045-vbattb"; >> + reg = <0 0x1005c000 0 0x1000>; >> + interrupts = ; >> + clocks = <&cpg CPG_MOD R9A08G045_VBAT_BCLK>, <&vbattb_xtal>; >> + clock-names = "bclk", "rtx"; >> + #clock-cells = <1>; >> + power-domains = <&cpg>; >> + resets = <&cpg R9A08G045_VBAT_BRESETN>; >> + status = "disabled"; >> + }; >> + >> cpg: clock-controller@11010000 { >> compatible = "renesas,r9a08g045-cpg"; >> reg = <0 0x11010000 0 0x10000>; >> @@ -425,4 +437,11 @@ timer { >> interrupt-names = "sec-phys", "phys", "virt", "hyp-phys", >> "hyp-virt"; >> }; >> + >> + vbattb_xtal: vbattb-xtal { > > The node name should be something like clock- but if the > frequency is different per-board then I don't know what should happen > here. The frequency should be always around 32768 Hz but not necessarily exactly 32768 Hz. It depends on what is installed on the board, indeed. RTC can do time error adjustments based on the variations around 32768 Hz. > Can you leave the vbattb_xtal phandle up above and then require > the node to be defined in the board with the proper frequency after the > dash? Is it OK for you something like this (applied on top of this series)? diff --git a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi index f31ec08a1e1d..60679211dc48 100644 --- a/arch/arm64/boot/dts/renesas/r9a08g045.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a08g045.dtsi @@ -181,7 +181,8 @@ vbattb: clock-controller@1005c000 { compatible = "renesas,r9a08g045-vbattb"; reg = <0 0x1005c000 0 0x1000>; interrupts = ; - clocks = <&cpg CPG_MOD R9A08G045_VBAT_BCLK>, <&vbattb_xtal>; + /* rtx clock must be overridden by the board. */ + clocks = <&cpg CPG_MOD R9A08G045_VBAT_BCLK>, <0>; clock-names = "bclk", "rtx"; #clock-cells = <1>; power-domains = <&cpg>; @@ -454,11 +455,4 @@ timer { interrupt-names = "sec-phys", "phys", "virt", "hyp-phys", "hyp-virt"; }; - - vbattb_xtal: vbattb-xtal { - compatible = "fixed-clock"; - #clock-cells = <0>; - /* This value must be overridden by the board. */ - clock-frequency = <0>; - }; }; diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi index 95b79a03d3d5..46cce0d48ddc 100644 --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi @@ -47,6 +47,12 @@ chosen { stdout-path = "serial0:115200n8"; }; + vbattb_xtal: clock-32768 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + memory@48000000 { device_type = "memory"; /* First 128MB is reserved for secure area. */ @@ -351,14 +357,11 @@ &rtc { }; &vbattb { + clocks = <&cpg CPG_MOD R9A08G045_VBAT_BCLK>, <&vbattb_xtal>; renesas,vbattb-load-nanofarads = <12500>; status = "okay"; }; -&vbattb_xtal { - clock-frequency = <32768>; -}; - &wdt0 { timeout-sec = <60>; status = "okay"; Thank you for your review, Claudiu Beznea > >> + compatible = "fixed-clock"; >> + #clock-cells = <0>; >> + /* This value must be overridden by the board. */ >> + clock-frequency = <0>;