Hello Rob, On Thu, Jan 9, 2025 at 12:48 AM Rob Herring <robh@xxxxxxxxxx> wrote: > > On Sun, Jan 05, 2025 at 07:14:16PM +0100, Dario Binacchi wrote: > > The addition of DT bindings for enabling and tuning spread spectrum > > clocking generation is available only for the main PLL. > > > > Signed-off-by: Dario Binacchi <dario.binacchi@xxxxxxxxxxxxxxxxxxxx> > > --- > > > > .../bindings/clock/st,stm32-rcc.yaml | 27 +++++++++++++++++++ > > 1 file changed, 27 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml b/Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml > > index ae9e5b26d876..c345d3ff3fc4 100644 > > --- a/Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml > > +++ b/Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml > > @@ -77,6 +77,26 @@ properties: > > Phandle to system configuration controller. It can be used to control the > > power domain circuitry. > > > > + st,ssc-modfreq-hz: > > + description: > > + The modulation frequency for main PLL (in Hz) > > No constraints? They vary depending on the HSE clock frequency used. > > > + > > + st,ssc-moddepth-permyriad: > > + $ref: /schemas/types.yaml#/definitions/uint32 > > + description: > > + The modulation rate for main PLL (in permyriad, i.e. 0.01%) > > + minimum: 25 > > + maximum: 200 > > + > > + st,ssc-modmethod: > > + $ref: /schemas/types.yaml#/definitions/non-unique-string-array > > + description: > > + The modulation techniques for main PLL. > > + items: > > + enum: > > + - center-spread > > + - down-spread > > What's the default? If there's only 2 possibilities, then you can use a > boolean instead. Though I assume you want to support spread-spectrum > disabled. Generally, there can also be more than two options. For example, in the case of the imx8m platform, there are three possibilities: - down-spread - center-spread - up-spread In our case, using a boolean would hide one of the two pieces of information, meaning that if I'm not using center-spread, what am I using? IMHO, I would keep the string type, changing it from on-unique-string-array to string. > > Are there dependencies between these properties? The values moddepth and modfreq are used to calculate, according to specific relationships, two values MODPER and INCSTEP, which are bit fields of a suitable register for managing the SSCG. There is a constraint between these two values, namely that MODPER * INCSTEP < 32768. This constraint will be managed at the driver level. Thanks and regards, Dario > > > + > > required: > > - compatible > > - reg > > @@ -97,6 +117,10 @@ allOf: > > const: 1 > > description: | > > The clock index for the specified type. > > + st,ssc-modfreq-hz: false > > + st,ssc-moddepth-permyriad: false > > + st,ssc-modmethod: false > > + > > else: > > properties: > > '#clock-cells': > > @@ -118,6 +142,9 @@ examples: > > reg = <0x40023800 0x400>; > > clocks = <&clk_hse>, <&clk_i2s_ckin>; > > st,syscfg = <&pwrcfg>; > > + st,ssc-modfreq-hz = <10000>; > > + st,ssc-moddepth-permyriad = <200>; > > + st,ssc-modmethod = "center-spread"; > > }; > > > > - | > > -- > > 2.43.0 > > -- Dario Binacchi Senior Embedded Linux Developer dario.binacchi@xxxxxxxxxxxxxxxxxxxx __________________________________ Amarula Solutions SRL Via Le Canevare 30, 31100 Treviso, Veneto, IT T. +39 042 243 5310 info@xxxxxxxxxxxxxxxxxxxx www.amarulasolutions.com