Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4325538rwe; Mon, 17 Apr 2023 10:54:16 -0700 (PDT) X-Google-Smtp-Source: AKy350bQM2hKjff2PmiQJdHjZIZ7P5VPHtrHN1mmveGmCeCAb8eGwnfg40B2EdMWZNLIbgJXEOR/ X-Received: by 2002:a17:902:d2c2:b0:1a6:3630:16e1 with SMTP id n2-20020a170902d2c200b001a6363016e1mr13284833plc.13.1681754056261; Mon, 17 Apr 2023 10:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681754056; cv=none; d=google.com; s=arc-20160816; b=Fng3HXQ9ZwitXYBbNmXGcU+VG/GVngV8oa2yeelslWzJQqIU9SMUhKhHU3vagu3FWD wWPT64sF+qp/PstAONNhpKxlpjT0yHn074XejnHY/cjCGmVde+YpBpXnUZVhdpB1gcgS kb/RLUeABgr44QygpllCT7nyvb00iBfhn6yfimvmvkDBVtLFDwJ/VRitvY20qu7WOIiZ cr6PcV1iGIvSKSat6ErnFP5dMOfC1/utMBOgQSrb1pi3h5bALu2e0vzqO2g7fqDjDbSe Tzm5PyNQCzW/tkgP6hc6/DBaHN9JiES5JIAyAM1ufYpgvb2Ueb+m7hpMiRb1QZmpLYDa CWRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=mElitKZ7sVJOTw6f2WC/zkSXCNzETK2pY5VMRBVufmw=; b=VGzKmr1GTECcymVDWzeICRBf2Su6YK20tWGorG2DHfsbP3hQbVKZ/FAJPka9RweznL j63xOdjapGYgyvj7mvI7oiev7mXZoncuucoTwcpsi2IWB0fPN7IBHNuX5gQqmReE8nda CQnzBT2NlbJyM3jOBTt6k/CT1EHaTDRSmZSG9BgRPg0lsCqlgHAAoG0d7NM4MmSC4sYU wozhRMsbopkmFBrj88QyDYUpTjB9iJVgACCkn/x2Cvpq6dKLKgCeCFDW8C0BupI2dl5E ik4tPcix2HHhOLuwpbUdGjGQqwG/AMkPwQ+04bBRz3XG2HG/oT2DLqAC2UKXYmxXnXJA yE2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=gGXX1Z3t; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a70-20020a639049000000b0051805159a1fsi8841668pge.462.2023.04.17.10.54.05; Mon, 17 Apr 2023 10:54:16 -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=@gmail.com header.s=20221208 header.b=gGXX1Z3t; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbjDQRsj (ORCPT + 99 others); Mon, 17 Apr 2023 13:48:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231151AbjDQRsg (ORCPT ); Mon, 17 Apr 2023 13:48:36 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C602CB46E; Mon, 17 Apr 2023 10:48:34 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1a66888cb89so10369745ad.3; Mon, 17 Apr 2023 10:48:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681753714; x=1684345714; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mElitKZ7sVJOTw6f2WC/zkSXCNzETK2pY5VMRBVufmw=; b=gGXX1Z3tsyEQ9yXV6FxAqKXrU/swtTH8fC2XXCDtPINtMLZI2Qi15weLR0kQC7WJ4c 0loRi1w73hJqt9ryrPCAGARvvap5ZEED70RY+GLV5zrLxpKLBFc4UyWIwxAVEd8waCOY enHkm3sQq6zWbLi4P+E6BJAk92u50FETpMdynIgvEyx+OvIggocKQSdR9iJFRe6f7dHp S8o9Pt9Pja5RR9HlOSzd3FzfcdJxprsgm09Lasp5okFZzJ6j8QO1nzWqxD05Q7c40D7K 2kw7b3bSHfowMrmkSVISE5Rn2bcrtF8dWZw7+Go3mNQwGpRFt3/zNwSO+OdNZmAL97IV 1Wyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681753714; x=1684345714; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mElitKZ7sVJOTw6f2WC/zkSXCNzETK2pY5VMRBVufmw=; b=GFdkTxaXCu68YvO3o6pZ9MvljjuaAg0OWu92mGUD/ph/qKwR08i33cSE2Up2qyQROD BYzn0l4B9tbl0F26lqBtv6oT4AfMJsKvCXega2Ooh1YzYYuQeOwqvgGQWutaN3cSTvVk p1xS3Modi30Md9ZDJM0twHdJDobquAqCZUaBsV4TvLn2gJF2I0njKyxgl0dhFIWGcGhL uXGykh7iU42Zgv01n7ofMFr+DXr2GChk/COrkszbEMoiIJ5jPgyN3sbFWoh0tpRos8lr H82XiYe1FVJ/+GWW3CyYzfDsrtNrmubSP93bRlybNniNP+ck6o7/Y6rMm4z6zKC3Skev pyZw== X-Gm-Message-State: AAQBX9fmPP0/nbHTsnxLV8OsjiPSsEKzLp/EuA3NqL5ZdhKJmJhrpKib Jh2rYDgg6BQNEeLC7/0wyh/YY6sdiXZn4Crh+esjcgKg2Gv+fLlpgcA= X-Received: by 2002:a05:6a00:228b:b0:63b:641d:76d8 with SMTP id f11-20020a056a00228b00b0063b641d76d8mr6279150pfe.2.1681753714033; Mon, 17 Apr 2023 10:48:34 -0700 (PDT) MIME-Version: 1.0 References: <20230414181302.986271-1-mmyangfl@gmail.com> <20230414181302.986271-2-mmyangfl@gmail.com> In-Reply-To: From: Yangfl Date: Tue, 18 Apr 2023 01:47:57 +0800 Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: clock: Add reg-clock-controller To: Krzysztof Kozlowski Cc: linux-clk@vger.kernel.org, Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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 Krzysztof Kozlowski =E4=BA=8E2023=E5=B9=B4= 4=E6=9C=8815=E6=97=A5=E5=91=A8=E5=85=AD 05:08=E5=86=99=E9=81=93=EF=BC=9A > > On 14/04/2023 20:12, David Yang wrote: > > Add DT bindings documentation for reg-clock-controller, collection of > > basic clocks common to many platforms. > > > > Signed-off-by: David Yang > > --- > > .../bindings/clock/reg-clock-controller.yaml | 245 ++++++++++++++++++ > > 1 file changed, 245 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/clock/reg-clock-c= ontroller.yaml > > > > diff --git a/Documentation/devicetree/bindings/clock/reg-clock-controll= er.yaml b/Documentation/devicetree/bindings/clock/reg-clock-controller.yaml > > new file mode 100644 > > index 000000000000..a6a7e0b05821 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/clock/reg-clock-controller.yaml > > @@ -0,0 +1,245 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/clock/reg-clock-controller.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Simple straight-forward register-based clocks > > + > > +maintainers: > > + - David Yang > > + > > +description: | > > + Basic clocks common to many platforms. > > + > > + If your clocks don't fit into these catagories, simply create your c= lock > > typo: categories Fixed in v2. > > > + controller. This driver normally work well with other controllers as= long as > > + they operate on different registers. > > + > > + See linux/clk-provider.h for details about properties for each type = of clock. > > Describe here what is this device, what such simple clock controller > represents. Description has been rewritten in v3, to describe the device. > > > + > > +properties: > > + compatible: > > + enum: > > + - reg-clock-controller > > + > > + ranges: true > > + > > + '#address-cells': > > + const: 1 > > + > > + '#size-cells': > > + const: 1 > > + > > +required: > > + - compatible > > + - ranges > > + - '#address-cells' > > + - '#size-cells' > > required goes after patternProperties. Fixed in v2. > > > + > > +patternProperties: > > + ".*gate-clock@.*": > > "gate-clock@" should be equivalent. However this should be just "clock". Fixed in v3. > > > + type: object > > + > > + description: | > > Do not need '|' unless you need to preserve formatting. Fixed in v2. > > > + Clock which can gate its output. > > + > > + properties: > > + compatible: > > + const: gate-clock > > + > > + reg: > > + maxItems: 1 > > + > > + '#clock-cells': > > + const: 0 > > + > > + clocks: > > + maxItems: 1 > > + description: > > + Parent clock. > > + > > + clock-output-name: > > names > > Don't create your own properties. Fixed in v2, "clock-output-names". > > > + maxItems: 1 > > + > > + bit-index: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: > > + Bit index which controls the output. > > I suggest to use same property as nvme, so bits. Replaced with "bits" in v2. > > > + > > + required: > > + - compatible > > + - reg > > + - '#clock-cells' > > + - bit-index > > + > > + additionalProperties: false > > + > > + ".*divider-clock@.*": > > + type: object > > + > > + description: | > > + Clock with an adjustable divider affecting its output frequency. > > + > > + properties: > > + compatible: > > + const: divider-clock > > + > > + reg: > > + maxItems: 1 > > + > > + '#clock-cells': > > + const: 0 > > + > > + clocks: > > + description: > > + Parent clocks. > > + > > + clock-output-name: > > + maxItems: 1 > > + > > + shift: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: > > + Shift to the divider bit field. > > + > > + width: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: > > + Width of the divider bit field. > > + > > + dividers: > > + $ref: /schemas/types.yaml#/definitions/uint32-array > > + description: > > + Array of value/divider pairs. > > Then it looks like matrix. This part of bindings has been (temporarily) removed from this series since v2, to make it simpler. > > > + > > + required: > > + - compatible > > + - reg > > + - '#clock-cells' > > + - shift > > + - width > > + > > + additionalProperties: false > > + > > + ".*mux-clock@.*": > > + type: object > > + > > + description: | > > + Clock with multiple selectable parents. > > + > > + properties: > > + compatible: > > + const: mux-clock > > + > > + reg: > > + maxItems: 1 > > + > > + '#clock-cells': > > + const: 0 > > + > > + clocks: > > + minItems: 1 > > + description: > > + Parent clock. > > + > > + clock-output-name: > > + maxItems: 1 > > + > > + shift: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: > > + Shift to multiplexer bit field. > > + > > + mask: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: > > + Mask of mutliplexer bit field. > > + > > + table: > > + $ref: /schemas/types.yaml#/definitions/uint32-array > > + description: > > + Array of register values corresponding to the parent index. > > + > > + required: > > + - compatible > > + - reg > > + - '#clock-cells' > > + - shift > > + - mask > > + > > + additionalProperties: false > > + > > + ".*fractional-divider-clock@.*": > > + type: object > > + > > + description: | > > + Clock with adjustable fractional divider affecting its output fr= equency. > > + > > + properties: > > + compatible: > > + const: fractional_divider-clock > > + > > + reg: > > + maxItems: 1 > > + > > + '#clock-cells': > > + const: 0 > > + > > + clocks: > > + maxItems: 1 > > + description: > > + Parent clock. > > + > > + clock-output-name: > > + maxItems: 1 > > + > > + numerator-shift: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: > > + Shift to the numerator bit field. > > + > > + numerator-width: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: > > + Width of the numerator bit field. > > + > > + denominator-shift: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: > > + Shift to the denominator bit field. > > + > > + denominator-width: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: > > + Width of the denominator bit field. > > + > > + required: > > + - compatible > > + - reg > > + - '#clock-cells' > > + - numerator-shift > > + - numerator-width > > + - denominator-shift > > + - denominator-width > > + > > + additionalProperties: false > > + > > +additionalProperties: true > > No, come on. This must be false. Fixed with "false" in v2. > > > + > > +examples: > > + - | > > + clks: reg-clk-ctrl@ffff0000 { > > Names should be generic, so clock-controller > > Drop the label. Dropped in v2. > > > + compatible =3D "reg-clock-controller"; > > + #address-cells =3D <1>; > > + #size-cells =3D <1>; > > + ranges =3D <0 0xffff0000 0x1000>; > > + > > + my_clk: gate-clock@cc-3 { > > Drop label. > > That's a new unit address to me. Did I miss a change in DT spec? Dropped label in v2. > > > + compatible =3D "gate-clock"; > > + #clock-cells =3D <0>; > > + reg =3D <0xcc 4>; > > reg is after compatible. > > > + bit-index =3D <3>; > > + clock-output-name =3D "my-clk"; > > Plus, test your patches. This fails testing... Fix name error in v3. > > > + }; > > + }; > > Best regards, > Krzysztof >