linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Fernandez <gabriel.fernandez@st.com>
To: Rob Herring <robh@kernel.org>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@st.com>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@codeaurora.org>,
	"Nicolas Pitre" <nico@linaro.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Daniel Thompson" <daniel.thompson@linaro.org>,
	"Andrea Merello" <andrea.merello@gmail.com>,
	"Radosław Pietrzyk" <radoslaw.pietrzyk@gmail.com>,
	"Lee Jones" <lee.jones@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-clk <linux-clk@vger.kernel.org>,
	"Ludovic Barre" <ludovic.barre@st.com>,
	"Olivier Bideau" <olivier.bideau@st.com>,
	"Amelie Delaunay" <amelie.delaunay@st.com>
Subject: Re: [PATCH] clk: stm32h7: Add stm32h743 clock driver
Date: Tue, 28 Mar 2017 08:20:24 +0200	[thread overview]
Message-ID: <461b2321-c43c-6d88-c805-97a887cc431d@st.com> (raw)
In-Reply-To: <CAL_Jsq++rdPqNZk54S7gQaeLBdzSptogp3dp9P1HmNTV67Sk9w@mail.gmail.com>



On 03/27/2017 09:04 PM, Rob Herring wrote:
> On Fri, Mar 24, 2017 at 4:41 AM, Gabriel Fernandez
> <gabriel.fernandez@st.com> wrote:
>> Hi Rob,
>>
>> Thanks for reviewing
>>
>>
>>
>> On 03/24/2017 03:06 AM, Rob Herring wrote:
>>> On Wed, Mar 15, 2017 at 10:23:30AM +0100, gabriel.fernandez@st.com wrote:
>>>> From: Gabriel Fernandez <gabriel.fernandez@st.com>
>>>>
>>>> This patch enables clocks for STM32H743 boards.
>>>>
>>>> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
>>>> ---
>>>>    .../devicetree/bindings/clock/st,stm32h7-rcc.txt   |  152 ++
>>>>    drivers/clk/Makefile                               |    1 +
>>>>    drivers/clk/clk-stm32h7.c                          | 1586
>>>> ++++++++++++++++++++
>>>>    include/dt-bindings/clock/stm32h7-clks.h           |  165 ++
>>>>    include/dt-bindings/mfd/stm32h7-rcc.h              |  138 ++
>>>>    5 files changed, 2042 insertions(+)
>>>>    create mode 100644
>>>> Documentation/devicetree/bindings/clock/st,stm32h7-rcc.txt
>>>>    create mode 100644 drivers/clk/clk-stm32h7.c
>>>>    create mode 100644 include/dt-bindings/clock/stm32h7-clks.h
>>>>    create mode 100644 include/dt-bindings/mfd/stm32h7-rcc.h
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/clock/st,stm32h7-rcc.txt
>>>> b/Documentation/devicetree/bindings/clock/st,stm32h7-rcc.txt
>>>> new file mode 100644
>>>> index 0000000..9d4b587
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/clock/st,stm32h7-rcc.txt
>>>> @@ -0,0 +1,152 @@
>>>> +STMicroelectronics STM32H7 Reset and Clock Controller
>>>> +=====================================================
>>>> +
>>>> +The RCC IP is both a reset and a clock controller.
>>>> +
>>>> +Please refer to clock-bindings.txt for common clock controller binding
>>>> usage.
>>>> +Please also refer to reset.txt for common reset controller binding
>>>> usage.
>>>> +
>>>> +Required properties:
>>>> +- compatible: Should be:
>>>> +  "st,stm32h743-rcc"
>>>> +
>>>> +- reg: should be register base and length as documented in the
>>>> +  datasheet
>>>> +
>>>> +- #reset-cells: 1, see below
>>>> +
>>>> +- #clock-cells : from common clock binding; shall be set to 1
>>>> +
>>>> +- clocks: External oscillator clock phandle
>>>> +  - high speed external clock signal (HSE)
>>>> +  - low speed external clock signal (LSE)
>>>> +  - external I2S clock (I2S_CKIN)
>>>> +
>>>> +- st,syscfg: phandle for pwrcfg, mandatory to disable/enable backup
>>>> domain
>>>> +  write protection (RTC clock).
>>>> +
>>>> +- pll x node: Allow to register a pll with specific parameters.
>>>> +  Please see PLL section below.
>>>> +
>>>> +Example:
>>>> +
>>>> +       rcc: rcc@58024400 {
>>>> +               #reset-cells = <1>;
>>>> +               #clock-cells = <2>
>>>> +               compatible = "st,stm32h743-rcc", "st,stm32-rcc";
>>>> +               reg = <0x58024400 0x400>;
>>>> +               clocks = <&clk_hse>, <&clk_lse>, <&clk_i2s_ckin>;
>>>> +
>>>> +               st,syscfg = <&pwrcfg>;
>>>> +
>>>> +               #address-cells = <1>;
>>>> +               #size-cells = <0>;
>>>> +
>>>> +               vco1@58024430 {
>>>> +                       #clock-cells = <0>;
>>>> +                       compatible = "stm32,pll";
>>>> +                       reg = <0>;
>>> The reg addr value and unit address don't match.
>> ok il will change into
>>
>>          vco1@0 {
>>                  reg = <0>;
>>
>>
>>>> +               };
>>>> +
>>>> +               vco2@58024438 {
>>>> +                       #clock-cells = <0>;
>>>> +                       compatible = "stm32,pll";
>>>> +                       reg = <1>;
>>>> +                       st,clock-div = <2>;
>>>> +                       st,clock-mult = <40>;
>>>> +                       st,frac-status = <0>;
>>>> +                       st,frac = <0>;
>>>> +                       st,vcosel = <1>;
>>>> +                       st,pllrge = <2>;
>>>> +               };
>>>> +       };
>>>> +
>>>> +
>>>> +STM32H7 PLL
>>>> +-----------
>>>> +
>>>> +The VCO of STM32 PLL could be reprensented like this:
>>>> +
>>>> +  Vref    ---------       --------
>>>> +    ---->| / DIVM  |---->| x DIVN | ------> VCO
>>>> +          ---------       --------
>>>> +                            ^
>>>> +                            |
>>>> +                         -------
>>>> +                        | FRACN |
>>>> +                         -------
>>>> +
>>>> +When the PLL is configured in integer mode:
>>>> +- VCO = ( Vref / DIVM ) * DIVN
>>>> +
>>>> +When the PLL is configured in fractional mode:
>>>> +- VCO = ( Vref / DIVM ) * ( DIVN + FRACN / 2^13)
>>>> +
>>>> +
>>>> +Required properties for pll node:
>>>> +- compatible: Should be:
>>>> +  "stm32,pll"
>>> Only 1 single PLL design for all STM32 chips ever?
>> no, i can change into "stm32h7,pll"
> Actually, should be "st,stm32h7-pll".
ok

>>>> +
>>>> +- #clock-cells: from common clock binding; shall be set to 0
>>>> +- reg: Should be the pll number.
>>>> +
>>>> +Optional properties:
>>>> +- st,clock-div:  DIVM division factor       : <1..63>
>>>> +- st,clock-mult: DIVN multiplication factor : <4..512>
>>>> +
>>>> +- st,frac-status:
>>>> +   - 0 Pll is configured in integer mode
>>>> +   - 1 Pll is configure in fractional mode
>>> Isn't this implied by the presence of the next property?
>> do you prefer this ?
>>
>> - st,frac :
>> 0 : pll is configured in integer mode
>> 1..8191 : Fractional part of the multiplication factor and pll is configured
>> in fractional mode
> Why not no st,frac property means integer mode?
No

no st,frac property means no change (keep default values from bootloader)


Best Regards

Gabriel

> Rob

  reply	other threads:[~2017-03-28  6:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15  9:23 [PATCH] clk: stm32h7: Add stm32h743 clock driver gabriel.fernandez
2017-03-15 12:15 ` Lee Jones
2017-03-24  2:06 ` Rob Herring
2017-03-24  9:41   ` Gabriel Fernandez
2017-03-27 19:04     ` Rob Herring
2017-03-28  6:20       ` Gabriel Fernandez [this message]
2017-03-28 15:19         ` Rob Herring
2017-04-05 22:32 ` Stephen Boyd
2017-04-06  9:35   ` Gabriel Fernandez
2017-04-07 19:51     ` Stephen Boyd
2017-04-28 14:56       ` Gabriel Fernandez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=461b2321-c43c-6d88-c805-97a887cc431d@st.com \
    --to=gabriel.fernandez@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=amelie.delaunay@st.com \
    --cc=andrea.merello@gmail.com \
    --cc=arnd@arndb.de \
    --cc=daniel.thompson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ludovic.barre@st.com \
    --cc=mark.rutland@arm.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=nico@linaro.org \
    --cc=olivier.bideau@st.com \
    --cc=radoslaw.pietrzyk@gmail.com \
    --cc=robh@kernel.org \
    --cc=sboyd@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).