lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <SEYPR01MB42213A1B4824D594D857A3BDD7932@SEYPR01MB4221.apcprd01.prod.exchangelabs.com>
Date: Tue, 3 Sep 2024 08:50:56 +0000
From: Haylen Chu <heylenay@...look.com>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: Michael Turquette <mturquette@...libre.com>,
	Stephen Boyd <sboyd@...nel.org>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>, linux-clk@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: clock: spacemit: Add clock controlers
 of Spacemit K1 SoC

On Sun, Sep 01, 2024 at 12:55:21PM +0200, Krzysztof Kozlowski wrote:
> On Sat, Aug 31, 2024 at 03:47:12PM +0000, Haylen Chu wrote:
> > Add definition for the clock controllers of Spacemit K1 SoC. The clock
> > tree is managed by several SoC parts, thus different compatible strings
> > are added for each.
> > 
> > Signed-off-by: Haylen Chu <heylenay@...look.com>
> > ---
> 
> This wasn't ever tested...
> 
> >  .../bindings/clock/spacemit,ccu.yaml          | 116 +++++++++++
> >  include/dt-bindings/clock/spacemit,ccu.h      | 197 ++++++++++++++++++
> >  2 files changed, 313 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/clock/spacemit,ccu.yaml
> >  create mode 100644 include/dt-bindings/clock/spacemit,ccu.h
> > 
> > diff --git a/Documentation/devicetree/bindings/clock/spacemit,ccu.yaml b/Documentation/devicetree/bindings/clock/spacemit,ccu.yaml
> > new file mode 100644
> > index 000000000000..90ddfc5e2a2f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/clock/spacemit,ccu.yaml
> > @@ -0,0 +1,116 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/clock/spacemit,ccu.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Spacemit SoC Clock Controller
> 
> What's the SoC name?
> 
> > +
> > +maintainers:
> > +  - Haylen Chu <heylenay@...look.com>
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - spacemit,ccu-apbs
> > +      - spacemit,ccu-mpmu
> > +      - spacemit,ccu-apbc
> > +      - spacemit,ccu-apmu
> > +
> > +  clocks: true
> 
> No, this must be specific. min/maxItems
> 
> > +
> > +  clock-names: true
> 
> No, this must be specific. min/maxItems
> 
> > +
> > +  spacemit,mpmu:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +    description:
> > +      Phandle to the syscon managing "Main PMU (MPMU)" registers
> 
> Explain what for.
> 
> > +
> > +  "#clock-cells":
> > +    const: 1
> > +    description:
> > +      See <dt-bindings/clock/spacemit,ccu.h> for valid indices.
> > +
> > +required:
> > +  - compatible
> > +  - "#clock-cells"
> > +
> > +additionalProperties: false
> 
> This goes after allOf block.
> 
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: spacemit,ccu-apbs
> > +    then:
> > +      properties:
> > +        clocks:
> > +          maxItems: 1
> > +
> > +        clock-names:
> > +          const: pll1_2457p6_vco
> 
> Don't use some weird, fake names. That's pll or vco or whatever the
> input is called.
> 
> > +
> > +      required:
> > +        - compatible
> > +        - clocks
> > +        - clock-names
> > +        - "#clock-cells"
> > +        - spacemit,mpmu
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: spacemit,ccu-apbc
> > +    then:
> > +      properties:
> > +        clocks:
> > +          maxItems: 4
> > +
> > +        clock-names:
> > +          items:
> > +            - const: clk_32k
> > +            - const: vctcxo_1
> > +            - const: vctcxo_24
> > +            - const: vctcxo_3
> > +
> > +      required:
> > +        - compatible
> > +        - clocks
> > +        - clock-names
> > +        - "#clock-cells"
> > +
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: spacemit,ccu-apmu
> > +    then:
> > +      properties:
> > +        clocks:
> > +          maxItems: 1
> > +
> > +        clock-names:
> > +          const: vctcxo_24
> > +
> > +      required:
> > +        - compatible
> > +        - clocks
> > +        - clock-names
> > +        - "#clock-cells"
> > +
> > +examples:
> > +  - |
> > +    syscon_apbs: system-control@...90000 {
> > +        compatible = "spacemit,mpmu-syscon", "syscon",
> > +        "simple-mfd";
> 
> Messed indentation.
> 
> Anyway, parent device nodes should have complete example.
> 
> > +        reg = <0x0 0xd4090000 0x0 0x1000>;
> > +
> > +        clk_apbs: clock-controller {
> > +            compatible = "spacemit,ccu-apbs";
> > +            clocks = <&pll1_2457p6_vco>;
> > +            clock-names = "pll1_2457p6_vco";
> > +            #clock-cells = <1>;
> > +            spacemit,mpmu = <&syscon_mpmu>;
> > +        };
> > +    };
> > diff --git a/include/dt-bindings/clock/spacemit,ccu.h b/include/dt-bindings/clock/spacemit,ccu.h
> > new file mode 100644
> > index 000000000000..ce84690684ff
> > --- /dev/null
> > +++ b/include/dt-bindings/clock/spacemit,ccu.h
> > @@ -0,0 +1,197 @@
> > +/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
> 
> Use the same license. (one pointed out by checkpatch)
> 
> Best regards,
> Krzysztof
> 

Thansk for your time and review, I realized it is better to split out
multiple bindings instead of writing these messy "allOf" block. Will
also adapt your suggestions in v2.

Best regards,
Haylen Chu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ