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 37969D1F9DB for ; Tue, 15 Oct 2024 21:29:01 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Gsf9BbQitLq23pqju39L1ABYKtFS4KAF82kGueRewzQ=; b=M4gTsEoZeNluCesRqsE3125Gc0 5oa1+qlER3fM3UDq1ZVMQwuUtdRFtbiqikS+7R/8ovWRyEQPIVH98n/pfvKlnXu+m5TxoeKRvvoAm BulmaDFuwzUwZRiO5NKgchdb/bZZ+pfbDeVw2j2lPkiJ33ESL0vyrUIbaquAdyUqp5ULtYyBu1k// 4oEu9TTYBI1z1QNOcDhPEn7C57qG/kg0rJvF3upEb9xojJP1Jpv03LZ0NDQzBLrNMPziyKwSpQSRo TAMH7LdnDI092eefC8akflnJ2pNcMWScBvsofG2RUKWhMPt8QvKXT/XtFH/YL5uwCyE3vn3jR7Z0K l60fYBDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0p61-00000009dgE-0tXH; Tue, 15 Oct 2024 21:28:49 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0p4a-00000009dPr-1LNy for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 21:27:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 4DF1CA435FC; Tue, 15 Oct 2024 21:27:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC321C4CEC6; Tue, 15 Oct 2024 21:27:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729027638; bh=bhRyfjKei9hYO+it+Ui9ogNxrCb+2kBRqH6VAgePJm4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L/zAiodbSwtCe9ReifgKdtFrqbxT3NIp3Sr6W752IMPxjf/kX3UXekdaTMlH3FlDB Hci17YfgZr+kQwDFseYSFoL81BYLtcFzzoxWt6OaOEVHO2/lvIIBAMkVnSrJA28NXA s1vEpqL/JotFF79L72rsyB5MuBWJp+kNHXY7nFzx3LDjTU24ARz6icr/ltxR9KPBks JdKPenUMCdKbxIvgq0s9PGciEQRQpmZH1SV1e1HtxFVtPJcPKqU89/IjetArNaW/7y a8rMV1fs0xA/+8qszQfl7wCw8U4b9cw6ZAB3dCkVVj3HqHtL0Y2nHE2KywDxivUu3j Bp1GwQOI9qiJA== Date: Tue, 15 Oct 2024 16:27:17 -0500 From: Rob Herring To: Ciprian Costea Cc: Alexandre Belloni , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP S32 Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Bogdan-Gabriel Roman , Ghennadi Procopciuc Subject: Re: [PATCH v2 1/4] dt-bindings: rtc: add schema for NXP S32G2/S32G3 SoCs Message-ID: <20241015212717.GA1983714-robh@kernel.org> References: <20241015105133.656360-1-ciprianmarian.costea@oss.nxp.com> <20241015105133.656360-2-ciprianmarian.costea@oss.nxp.com> <20241015211540.GA1968867-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241015211540.GA1968867-robh@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241015_142720_514820_6417D0BF X-CRM114-Status: GOOD ( 33.41 ) 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 On Tue, Oct 15, 2024 at 04:15:40PM -0500, Rob Herring wrote: > On Tue, Oct 15, 2024 at 01:51:30PM +0300, Ciprian Costea wrote: > > From: Ciprian Marian Costea > > > > This patch adds the dt-bindings for NXP S32G2/S32G3 SoCs RTC driver. > > > > Co-developed-by: Bogdan-Gabriel Roman > > Signed-off-by: Bogdan-Gabriel Roman > > Co-developed-by: Ghennadi Procopciuc > > Signed-off-by: Ghennadi Procopciuc > > Signed-off-by: Ciprian Marian Costea > > --- > > .../devicetree/bindings/rtc/nxp,s32g-rtc.yaml | 102 ++++++++++++++++++ > > 1 file changed, 102 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/rtc/nxp,s32g-rtc.yaml > > > > diff --git a/Documentation/devicetree/bindings/rtc/nxp,s32g-rtc.yaml b/Documentation/devicetree/bindings/rtc/nxp,s32g-rtc.yaml > > new file mode 100644 > > index 000000000000..3a77d4dd8f3d > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/rtc/nxp,s32g-rtc.yaml > > @@ -0,0 +1,102 @@ > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/rtc/nxp,s32g-rtc.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: NXP S32G2/S32G3 Real Time Clock (RTC) > > + > > +maintainers: > > + - Bogdan Hamciuc > > + - Ciprian Marian Costea > > + > > +properties: > > + compatible: > > + oneOf: > > + - enum: > > + - nxp,s32g2-rtc > > + - items: > > + - const: nxp,s32g3-rtc > > + - const: nxp,s32g2-rtc > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + > > + "#clock-cells": > > + const: 1 > > + > > + clocks: > > + items: > > + - description: ipg clock drives the access to the > > + RTC iomapped registers > > + > > + clock-names: > > + items: > > + - const: ipg > > + > > + assigned-clocks: > > + minItems: 1 > > + items: > > + - description: Runtime clock source. It must be a clock > > + source for the RTC module. It will be disabled by hardware > > + during Standby/Suspend. > > + - description: Standby/Suspend clock source. It is optional > > + and can be used in case the RTC will continue ticking during > > + platform/system suspend. RTC hardware module contains a > > + hardware mux for clock source selection. > > If the RTC h/w contains a mux, then your mux inputs should be listed in > 'clocks', not here. > > > + > > + assigned-clock-parents: > > + description: List of phandles to each parent clock. > > + > > + assigned-clock-rates: > > + description: List of frequencies for RTC clock sources. > > + RTC module contains 2 hardware divisors which can be > > + enabled or not. Hence, available frequencies are the following > > + parent_freq, parent_freq / 512, parent_freq / 32 or > > + parent_freq / (512 * 32) > > In general, assigned-clocks* do not need to be documented and should > never be required. > > > + > > +required: > > + - compatible > > + - reg > > + - interrupts > > + - "#clock-cells" > > + - clocks > > + - clock-names > > + - assigned-clocks > > + - assigned-clock-parents > > + - assigned-clock-rates > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + #include > > + #include > > + > > + rtc0: rtc@40060000 { > > + compatible = "nxp,s32g3-rtc", > > + "nxp,s32g2-rtc"; > > + reg = <0x40060000 0x1000>; > > + interrupts = ; > > + #clock-cells = <1>; > > + clocks = <&clks 54>; > > + clock-names = "ipg"; > > + /* > > + * Configuration of default parent clocks. > > + * 'assigned-clocks' 0-3 IDs are Runtime clock sources > > + * 4-7 IDs are Suspend/Standby clock sources. > > + */ > > + assigned-clocks = <&rtc0 2>, <&rtc0 4>; > > That's weird... > > > + assigned-clock-parents = <&clks 56>, <&clks 55>; > > I'd expect these should be in 'clocks'. I don't think this node should > be a clock provider unless it provides a clock to something outside the > RTC. > > Looks like you are just using assigned-clocks to configure the clock mux > in the RTC. That's way over complicated. Just define a vendor specific > property with the mux settings. I just read v1 and got told use the clock framework... I disagree completely. Tons of h/w blocks have the ability to select (internal to the block) from multiple clock sources. Making the block a clock provider to itself is completely pointless and an overkill, and we *never* do that. Any display controller or audio interface has mutiple clock sources as just 2 examples. However, I don't see why you need the divider config in DT. Can't you figure out what divider you need based on input frequency? The output frequency should be fixed, right? Rob