Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30107799rwd; Thu, 6 Jul 2023 00:38:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlF1WOKLWy2fWTaIl25p0HRL7JWceVbpj9z68P7QhXjaukeaybSDdNUJdMRwWxblK5KcJhN3 X-Received: by 2002:a05:6a20:1611:b0:12e:d8ee:8f2e with SMTP id l17-20020a056a20161100b0012ed8ee8f2emr1248971pzj.27.1688629130668; Thu, 06 Jul 2023 00:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688629130; cv=none; d=google.com; s=arc-20160816; b=KK43YmPp1Hx0fhrxFuKyzzxO0wl71bfxtr/7nk5rAfCUosRdasM7c8kyCTSfp8XBQh xrm02d3HNmOLDqqZWgSIUQ06aTPWRsVTid/0nwdHH2tsFtVpplz8JfSEMDpILns5JYlb 3eQjBZF76SehXMdykCwqRM6hUVsse+v55nHu+kXDFdbnnZrvK2Pd9lCO36CgXWQVuKt0 s9UbTr/cpHbXyb9L4kTbuykGGlLP4X3FFlA6eT1I5ThJJIRzFzGpKHAnqZGjCuYmh6u0 LxrvsC2Uyq3cNrXszjv6sc5HhrVdw0Hs4PQeVBXCfDPJ3+8WI5z4UKycknOq1epEM3oG vtvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:user-agent:references:dkim-signature; bh=cMM/JKhymf2QTww3ufNFI5eYv4LI0VojyRQq8UqQbR0=; fh=yqoyGZh7k2tx6cDesVN5E0y33/Z8NWddb9wnWIyeXzU=; b=yWZPbT0M+bZCgkKx8Md//JCpWvhS+1b39rR/IhjYS5pFtQeT0ztKCMxbKpSBXx4MR3 eebSwQB1UVUoLK5GS1wZtyKmOjBZvTNtHdIdqmXRh2kJ6dABVvIrOziB/WkU2J/P8RTm 4XepxNUYJKSvFebOmmKDC+vOgfg4sgDnD700fA+p+I9b+LW5Ct48oeHLPodJ5/CNNC5F wZzaoGFq0jkOWdXS1PJDcwuFkvKR85nv4N2euporx8/HRPkjUEp7f84rUQlE1MfKotzS M50senctQ8bB23KjPKFaCitns6YICOIWVg6S9wEPPEG/WVCnRN2EVJVcrcam2fhegGJp kfkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=TCngYVh5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o12-20020a65614c000000b0055721c3946fsi873488pgv.792.2023.07.06.00.38.35; Thu, 06 Jul 2023 00:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=TCngYVh5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233161AbjGFHUK (ORCPT + 99 others); Thu, 6 Jul 2023 03:20:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233166AbjGFHUJ (ORCPT ); Thu, 6 Jul 2023 03:20:09 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 357981BEB for ; Thu, 6 Jul 2023 00:20:02 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2b6f0508f54so4440461fa.3 for ; Thu, 06 Jul 2023 00:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1688628000; x=1691220000; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=cMM/JKhymf2QTww3ufNFI5eYv4LI0VojyRQq8UqQbR0=; b=TCngYVh5UCe5aCujjz8cVO6NfM+vf4AaK153X9x8q1taYuWwF2V2S748W9YntSs0Vs /Ce6vCDiIO8VxO8WnoCOzoFt4lE5jQ91NqmQ2ILCSA6VfjoJmRNPRN/CIfMgwTawXNt1 YGsjfKWsphZP0ryythXMVprouE2vn7FKLJQ2gug32NOG5HMcG9SmkNVtpvW32OfT6xwR h2xBoTyQa4o5BkajN+RrqkRN2xBTCSmKyD+IzxxKZnB2hIjuT9+9emA7x2oAJbPNPK7x GpjHBTGiAln/vqjmjm4L+hafxgMq6rMPP3X89torWeIUob/ImptdOujse03LWkreJ+e+ J6rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688628000; x=1691220000; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cMM/JKhymf2QTww3ufNFI5eYv4LI0VojyRQq8UqQbR0=; b=Jz+tAcKgFCAXcFwggMLr9qG/ettbrHYDIJ0p5ihWzVI40UTjdV+4cBNI1e7wN5icWa tQzV76HF+ttzV5yCOXg+6tfnX9Zmx5tZHqJJbvzeMo+wbyRblBRkNmRypHPdxNzDaee3 L4XHuo3QucyAmwNA98y7C+U5bP7BtGRFxnQLx52zuQa6c26wt2XGdR4VkFMIdBpDMKdj Jrg4Arqo20XtUpDVF8C2Q8OEVucxdYqsXS+T5hZbZt/UgAub34cPZQAUpXGrVHfdXZwq GJxr+02u58ogwyVJ77AXqVh6tcTlAq/TPrd0QMI0NPaEqqkbzHm3I9exmZSOJLNNNM6k kL/Q== X-Gm-Message-State: ABy/qLZKMeUpPjCi9lhIytHb3s9rY0GQMZ1MI0iJmUwpzJekBjUl9vov Fxvqx1JQC0nHimH0BjdsqvAfLA== X-Received: by 2002:a2e:8908:0:b0:2b6:ee1c:216a with SMTP id d8-20020a2e8908000000b002b6ee1c216amr669843lji.34.1688628000429; Thu, 06 Jul 2023 00:20:00 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb0:4a33:b29e:11b3:752b]) by smtp.gmail.com with ESMTPSA id l6-20020adfe586000000b003112f836d4esm1033839wrm.85.2023.07.06.00.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 00:20:00 -0700 (PDT) References: <20230705-b4-amlogic-bindings-convert-take2-v2-0-22be915ddc3b@linaro.org> <20230705-b4-amlogic-bindings-convert-take2-v2-2-22be915ddc3b@linaro.org> <20230705195631.GA1732680-robh@kernel.org> User-agent: mu4e 1.8.13; emacs 28.2 From: Jerome Brunet To: Rob Herring , Neil Armstrong Cc: Michael Turquette , Stephen Boyd , Krzysztof Kozlowski , Conor Dooley , Kevin Hilman , Martin Blumenstingl , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 2/3] dt-bindings: clock: amlogic: convert amlogic,gxbb-aoclkc.txt to dt-schema Date: Thu, 06 Jul 2023 09:15:26 +0200 In-reply-to: <20230705195631.GA1732680-robh@kernel.org> Message-ID: <1jttuh5www.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 05 Jul 2023 at 13:56, Rob Herring wrote: > On Wed, Jul 05, 2023 at 01:41:52PM +0200, Neil Armstrong wrote: >> Convert the Amlogic Always-On Clock Controller bindings to dt-schema. >> >> Signed-off-by: Neil Armstrong >> --- >> .../bindings/clock/amlogic,gxbb-aoclkc.txt | 64 ------------- >> .../bindings/clock/amlogic,gxbb-aoclkc.yaml | 101 +++++++++++++++++++++ >> 2 files changed, 101 insertions(+), 64 deletions(-) >> >> diff --git >> a/Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt >> b/Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt >> deleted file mode 100644 >> index c41f0be5d438..000000000000 >> --- a/Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.txt >> +++ /dev/null >> @@ -1,64 +0,0 @@ >> -* Amlogic GXBB AO Clock and Reset Unit >> - >> -The Amlogic GXBB AO clock controller generates and supplies clock to various >> -controllers within the Always-On part of the SoC. >> - >> -Required Properties: >> - >> -- compatible: value should be different for each SoC family as : >> - - GXBB (S905) : "amlogic,meson-gxbb-aoclkc" >> - - GXL (S905X, S905D) : "amlogic,meson-gxl-aoclkc" >> - - GXM (S912) : "amlogic,meson-gxm-aoclkc" >> - - AXG (A113D, A113X) : "amlogic,meson-axg-aoclkc" >> - - G12A (S905X2, S905D2, S905Y2) : "amlogic,meson-g12a-aoclkc" >> - followed by the common "amlogic,meson-gx-aoclkc" >> -- clocks: list of clock phandle, one for each entry clock-names. >> -- clock-names: should contain the following: >> - * "xtal" : the platform xtal >> - * "mpeg-clk" : the main clock controller mother clock (aka clk81) >> - * "ext-32k-0" : external 32kHz reference #0 if any (optional) >> - * "ext-32k-1" : external 32kHz reference #1 if any (optional - gx only) >> - * "ext-32k-2" : external 32kHz reference #2 if any (optional - gx only) >> - >> -- #clock-cells: should be 1. >> - >> -Each clock is assigned an identifier and client nodes can use this identifier >> -to specify the clock which they consume. All available clocks are defined as >> -preprocessor macros in the dt-bindings/clock/gxbb-aoclkc.h header and can be >> -used in device tree sources. >> - >> -- #reset-cells: should be 1. >> - >> -Each reset is assigned an identifier and client nodes can use this identifier >> -to specify the reset which they consume. All available resets are defined as >> -preprocessor macros in the dt-bindings/reset/gxbb-aoclkc.h header and can be >> -used in device tree sources. >> - >> -Parent node should have the following properties : >> -- compatible: "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd" >> -- reg: base address and size of the AO system control register space. >> - >> -Example: AO Clock controller node: >> - >> -ao_sysctrl: sys-ctrl@0 { >> - compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd"; >> - reg = <0x0 0x0 0x0 0x100>; >> - >> - clkc_AO: clock-controller { >> - compatible = "amlogic,meson-gxbb-aoclkc", "amlogic,meson-gx-aoclkc"; >> - #clock-cells = <1>; >> - #reset-cells = <1>; >> - clocks = <&xtal>, <&clkc CLKID_CLK81>; >> - clock-names = "xtal", "mpeg-clk"; >> - }; >> - >> -Example: UART controller node that consumes the clock and reset generated >> - by the clock controller: >> - >> - uart_AO: serial@4c0 { >> - compatible = "amlogic,meson-uart"; >> - reg = <0x4c0 0x14>; >> - interrupts = <0 90 1>; >> - clocks = <&clkc_AO CLKID_AO_UART1>; >> - resets = <&clkc_AO RESET_AO_UART1>; >> - }; >> diff --git >> a/Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.yaml >> b/Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.yaml >> new file mode 100644 >> index 000000000000..0adcfbcf5c85 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/clock/amlogic,gxbb-aoclkc.yaml >> @@ -0,0 +1,101 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/clock/amlogic,gxbb-aoclkc.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Amlogic Always-On Clock Controller >> + >> +maintainers: >> + - Neil Armstrong >> + >> +properties: >> + compatible: >> + oneOf: >> + - items: >> + - enum: >> + - amlogic,meson-gxbb-aoclkc >> + - amlogic,meson-gxl-aoclkc >> + - amlogic,meson-gxm-aoclkc >> + - amlogic,meson-axg-aoclkc >> + - const: amlogic,meson-gx-aoclkc >> + - enum: >> + - amlogic,meson-axg-aoclkc >> + - amlogic,meson-g12a-aoclkc >> + >> + clocks: >> + minItems: 2 >> + maxItems: 5 >> + >> + clock-names: >> + minItems: 2 >> + maxItems: 5 >> + >> + '#clock-cells': >> + const: 1 >> + >> + '#reset-cells': >> + const: 1 >> + >> +required: >> + - compatible >> + - clocks >> + - clock-names >> + - '#clock-cells' >> + - '#reset-cells' >> + >> +allOf: >> + - if: >> + properties: >> + compatible: >> + enum: >> + - amlogic,meson-gxbb-aoclkc >> + >> + then: >> + properties: >> + clock-names: >> + minItems: 2 >> + items: >> + - const: xtal >> + - const: mpeg-clk >> + - const: ext-32k-0 >> + - const: ext-32k-1 >> + - const: ext-32k-2 > > As the names are always the same, move this to top-level and just set > the length here (except the constraints are the same as top-level, so > you can just drop this if/then). If this is done, aren't we losing information ? For example, "ext-32k-1" would become valid with a g12a as long as the number of clocks is alright, which it is not. I'm not concerned by the automated verification, more the information provided to the users, which we used to have in the txt format. > >> + >> + - if: >> + properties: >> + compatible: >> + enum: >> + - amlogic,meson-g12a-aoclkc >> + >> + then: >> + properties: >> + clocks: >> + maxItems: 3 >> + >> + clock-names: >> + minItems: 2 >> + items: >> + - const: xtal >> + - const: mpeg-clk >> + - const: ext-32k-0 > > Just 'maxItems: 3' > >> + >> + - if: >> + properties: >> + compatible: >> + enum: >> + - amlogic,meson-gxl-aoclkc >> + - amlogic,meson-gxm-aoclkc >> + - amlogic,meson-axg-aoclkc >> + >> + then: >> + properties: >> + clocks: >> + maxItems: 2 >> + >> + clock-names: >> + items: >> + - const: xtal >> + - const: mpeg-clk > > maxItems: 2 > >> + >> +additionalProperties: false >> >> -- >> 2.34.1 >>