[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABGWkvpgGNitRfe+qxT9faZ=Oa5+OzbE06dr-0O+w31JOmOQfw@mail.gmail.com>
Date: Thu, 9 Jan 2025 22:18:05 +0100
From: Dario Binacchi <dario.binacchi@...rulasolutions.com>
To: Rob Herring <robh@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-amarula@...rulasolutions.com,
Alexandre Torgue <alexandre.torgue@...s.st.com>, Conor Dooley <conor+dt@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Maxime Coquelin <mcoquelin.stm32@...il.com>,
Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com
Subject: Re: [PATCH 4/6] dt-bindings: clock: st,stm32-rcc: support spread
spectrum clocking
Hello Rob,
On Thu, Jan 9, 2025 at 12:48 AM Rob Herring <robh@...nel.org> 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@...rulasolutions.com>
> > ---
> >
> > .../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@...rulasolutions.com
__________________________________
Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
info@...rulasolutions.com
www.amarulasolutions.com
Powered by blists - more mailing lists