mbox series

[v3,0/2] Add Qualcomm MSM8939 GCC binding and driver

Message ID 20200423103406.481289-1-bryan.odonoghue@linaro.org (mailing list archive)
Headers show
Series Add Qualcomm MSM8939 GCC binding and driver | expand

Message

Bryan O'Donoghue April 23, 2020, 10:34 a.m. UTC
V3:
This update removes the old clock name arrays which I forgot to prune in
the previous V2.

git diff bod/clk-next+msm8939 bod/clk-next+msm8939-v2.1

V2:
This update does the following

1. Drops code in the probe routine to add xo and sleep_clk. Instead
   the DTS for the GCC will need to declare both of those clocks for the
   GCC controller.

2. Supplants parent_names for parent_data for all clocks.

3. Squashes down the previous three patches into two.

4. Drops the git log of copying files. The git log makes clear the silicon
   is highly similar, so, you can just as easily read the log and do a
   diff.

5. Doesn't update the MSM8916 with parent_data.
   Happy to do this at a later date but, don't have the time to validate
   this properly at the moment. This set focuses on the MSM8939 alone.

6. Dropped comment and boilerplate license text as indicated.

7. Dropped dependency on COMMON_CLK_QCOM seems to not be needed.

8. Easily view the changes here:
   git add bod https://github.com/bryanodonoghue/linux.git
   git fetch bod
   git diff bod/clk-next+msm8939 bod/clk-next+msm8939-v2   

V1:
These three patches add support for the MSM8939 Global Clock Controller.
The MSM8939 is a derivation of the MSM8916 sharing the large majority of
its clock settings with MSM8916, however, there are enough changes, in some
cases mutually incompatible changes that necessitate a separate driver.

I thought it was both important and useful to show in the git log the
differences between MSM8916 and MSM8939 so, one patch copies the MSM8916
driver while another patch applies the entire gamut of MSM8939 changes,
squashing down from a git log of approximately 31 separate commits.

For reference that log is here:
https://github.com/bryanodonoghue/linux/pull/new/msm8939-clk-next-reference-log

Generally speaking MSM8939 differes from MSM8916 in two key ways.

- New and higher clock frequencies for existing IP blocks.
- New PLLs to drive those higher frequencies

Bryan O'Donoghue (2):
  clk: qcom: Add DT bindings for MSM8939 GCC
  clk: qcom: gcc-msm8939: Add MSM8939 Generic Clock Controller

Bryan O'Donoghue (2):
  clk: qcom: Add DT bindings for MSM8939 GCC
  clk: qcom: gcc-msm8939: Add MSM8939 Generic Clock Controller

 .../devicetree/bindings/clock/qcom,gcc.yaml   |    3 +
 drivers/clk/qcom/Kconfig                      |    8 +
 drivers/clk/qcom/Makefile                     |    1 +
 drivers/clk/qcom/gcc-msm8939.c                | 3999 +++++++++++++++++
 include/dt-bindings/clock/qcom,gcc-msm8939.h  |  206 +
 include/dt-bindings/reset/qcom,gcc-msm8939.h  |  110 +
 6 files changed, 4327 insertions(+)
 create mode 100644 drivers/clk/qcom/gcc-msm8939.c
 create mode 100644 include/dt-bindings/clock/qcom,gcc-msm8939.h
 create mode 100644 include/dt-bindings/reset/qcom,gcc-msm8939.h

Comments

Bryan O'Donoghue May 7, 2020, 3:57 p.m. UTC | #1
On 23/04/2020 11:34, Bryan O'Donoghue wrote:
> V3:
> This update removes the old clock name arrays which I forgot to prune in
> the previous V2.
> 
> git diff bod/clk-next+msm8939 bod/clk-next+msm8939-v2.1

I should have mentioned.

If you want to test this you'll need to do the following to your 
msm8939.dtsi

diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi 
b/arch/arm64/boot/dts/qcom/msm8939.dtsi
index 996425a70014..2d54ad7f99b6 100644
--- a/arch/arm64/boot/dts/qcom/msm8939.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi
@@ -673,6 +673,10 @@ gcc: clock-controller@1800000 {
                         reg = <0x1800000 0x80000>;
+                       clock-names = "xo",
+                                     "sleep_clk";
+                       clocks = <&xo_board>,
+                                <&sleep_clk>;
                 };

"xo" and "sleep_clk" names can be resolved.

---
bod
Bryan O'Donoghue May 7, 2020, 4:06 p.m. UTC | #2
On 07/05/2020 16:57, Bryan O'Donoghue wrote:
> On 23/04/2020 11:34, Bryan O'Donoghue wrote:
>> V3:
>> This update removes the old clock name arrays which I forgot to prune in
>> the previous V2.
>>
>> git diff bod/clk-next+msm8939 bod/clk-next+msm8939-v2.1
> 
> I should have mentioned.
> 
> If you want to test this you'll need to do the following to your 
> msm8939.dtsi
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi 
> b/arch/arm64/boot/dts/qcom/msm8939.dtsi
> index 996425a70014..2d54ad7f99b6 100644
> --- a/arch/arm64/boot/dts/qcom/msm8939.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi
> @@ -673,6 +673,10 @@ gcc: clock-controller@1800000 {
>                          reg = <0x1800000 0x80000>;
> +                       clock-names = "xo",
> +                                     "sleep_clk";
> +                       clocks = <&xo_board>,
> +                                <&sleep_clk>;
>                  };
> 
> "xo" and "sleep_clk" names can be resolved.
> 
> ---
> bod

and this...

clocks {
     xo_board: xo_board {
         compatible = "fixed-clock";
         #clock-cells = <0>;
         clock-frequency = <19200000>;
     };

     sleep_clk: sleep_clk {
         compatible = "fixed-clock";
         #clock-cells = <0>;
         clock-frequency = <32768>;
     };
};
Vincent Knecht May 8, 2020, 10:06 a.m. UTC | #3
Le jeudi 07 mai 2020 à 17:06 +0100, Bryan O'Donoghue a écrit :
> On 07/05/2020 16:57, Bryan O'Donoghue wrote:
> > On 23/04/2020 11:34, Bryan O'Donoghue wrote:
> > > V3:
> > > This update removes the old clock name arrays which I forgot to prune in
> > > the previous V2.
> > > 
> > > git diff bod/clk-next+msm8939 bod/clk-next+msm8939-v2.1
> > 
> > I should have mentioned.
> > 
> > If you want to test this you'll need to do the following to your 
> > msm8939.dtsi
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi 
> > b/arch/arm64/boot/dts/qcom/msm8939.dtsi
> > index 996425a70014..2d54ad7f99b6 100644
> > --- a/arch/arm64/boot/dts/qcom/msm8939.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi
> > @@ -673,6 +673,10 @@ gcc: clock-controller@1800000 {
> >                          reg = <0x1800000 0x80000>;
> > +                       clock-names = "xo",
> > +                                     "sleep_clk";
> > +                       clocks = <&xo_board>,
> > +                                <&sleep_clk>;
> >                  };
> > 
> > "xo" and "sleep_clk" names can be resolved.
> > 
> > ---
> > bod
> 
> and this...
> 
> clocks {
>      xo_board: xo_board {
>          compatible = "fixed-clock";
>          #clock-cells = <0>;
>          clock-frequency = <19200000>;
>      };
> 
>      sleep_clk: sleep_clk {
>          compatible = "fixed-clock";
>          #clock-cells = <0>;
>          clock-frequency = <32768>;
>      };
> };
> 

Thank you, works for me over v5.7-rc2 with an Alcatel Idol 3 (5.5").

Tested-by: Vincent Knecht <vincent.knecht@mailoo.org>
Rob Herring May 11, 2020, 8:35 p.m. UTC | #4
On Thu, Apr 23, 2020 at 11:34:06AM +0100, Bryan O'Donoghue wrote:
> This patch adds support for the MSM8939 GCC. The MSM8939 is based on the
> MSM8916. MSM8939 is compatible in several ways with MSM8916 but, has
> additional functional blocks added which require additional PLL sources. In
> some cases functional blocks from the MSM8916 have different clock sources
> or different supported frequencies.
> 
> Cc: Andy Gross <agross@kernel.org>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: linux-arm-msm@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/clk/qcom/Kconfig                     |    8 +
>  drivers/clk/qcom/Makefile                    |    1 +
>  drivers/clk/qcom/gcc-msm8939.c               | 3999 ++++++++++++++++++

>  include/dt-bindings/clock/qcom,gcc-msm8939.h |   27 +
>  include/dt-bindings/reset/qcom,gcc-msm8939.h |   10 +

These go in patch 1.

>  5 files changed, 4045 insertions(+)
>  create mode 100644 drivers/clk/qcom/gcc-msm8939.c