mbox series

[v3,00/12] clock: qcom: apq8084: convert to parent_data/_hws

Message ID 20230111060402.1168726-1-dmitry.baryshkov@linaro.org
Headers show
Series clock: qcom: apq8084: convert to parent_data/_hws | expand

Message

Dmitry Baryshkov Jan. 11, 2023, 6:03 a.m. UTC
Rework apq8084 gcc and mmcc drivers to use parent_data and parent_hws
instead of parent_names.

Changes since v2:
- Reverted the qcom,gcc-apq8084 example to use numbers for ufsphy clock
  indices rather than defining them right in the example.

Changes since RFC:
- Fixed clock/clock-names's maxItems in qcom,mmcc.yaml
- Expanded qcom,gcc-apq8084 example to include an example of UFS symbol
  clock bindings


Dmitry Baryshkov (12):
  dt-bindings: clock: qcom,gcc-apq8084: define clocks/clock-names
  dt-bindings: clock: qcom,gcc-apq8084: add GCC_MMSS_GPLL0_CLK_SRC
  dt-bindings: clock: qcom,mmcc: define clocks/clock-names for APQ8084
  clk: qcom: gcc-apq8084: use ARRAY_SIZE instead of specifying
    num_parents
  clk: qcom: gcc-apq8084: move PLL clocks up
  clk: qcom: gcc-apq8084: use parent_hws/_data instead of parent_names
  clk: qcom: gcc-apq8084: add GCC_MMSS_GPLL0_CLK_SRC
  clk: qcom: mmcc-apq8084: use ARRAY_SIZE instead of specifying
    num_parents
  clk: qcom: mmcc-apq8084: move clock parent tables down
  clk: qcom: mmcc-apq8084: remove spdm clocks
  clk: qcom: mmcc-apq8084: use parent_hws/_data instead of parent_names
  ARM: dts: qcom: apq8084: add clocks and clock-names to gcc device

 .../bindings/clock/qcom,gcc-apq8084.yaml      |   44 +
 .../devicetree/bindings/clock/qcom,mmcc.yaml  |   44 +-
 arch/arm/boot/dts/qcom-apq8084.dtsi           |   18 +
 drivers/clk/qcom/gcc-apq8084.c                | 1024 +++++++-------
 drivers/clk/qcom/mmcc-apq8084.c               | 1189 +++++++----------
 include/dt-bindings/clock/qcom,gcc-apq8084.h  |    1 +
 6 files changed, 1098 insertions(+), 1222 deletions(-)

Comments

Bjorn Andersson Jan. 19, 2023, 2:16 a.m. UTC | #1
On Wed, 11 Jan 2023 08:03:50 +0200, Dmitry Baryshkov wrote:
> Rework apq8084 gcc and mmcc drivers to use parent_data and parent_hws
> instead of parent_names.
> 
> Changes since v2:
> - Reverted the qcom,gcc-apq8084 example to use numbers for ufsphy clock
>   indices rather than defining them right in the example.
> 
> [...]

Applied, thanks!

[12/12] ARM: dts: qcom: apq8084: add clocks and clock-names to gcc device
        commit: b894f2cf915479f9b25266da394942db9736161d

Best regards,
Stephen Boyd Jan. 25, 2023, 9:44 p.m. UTC | #2
Quoting Dmitry Baryshkov (2023-01-10 22:03:51)
> Define clock/clock-names properties of the GCC device node to be used
> on APQ8084 platform.
> 
> Note: the driver uses a single pcie_pipe clock, however most probably
> there are two pipe clocks, one from each of PCIe QMP PHYs.
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@kernel.org>

> diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc-apq8084.yaml b/Documentation/devicetree/bindings/clock/qcom,gcc-apq8084.yaml
> index 8ade176c24f4..d84608269080 100644
> --- a/Documentation/devicetree/bindings/clock/qcom,gcc-apq8084.yaml
> +++ b/Documentation/devicetree/bindings/clock/qcom,gcc-apq8084.yaml
> @@ -32,11 +56,31 @@ unevaluatedProperties: false
>  
>  examples:
>    - |
> +    /* UFS PHY on APQ8084 is not supported (yet), so these bindings just serve an example */

This comment will go out of date and probably nobody will notice. Just
remove it?

>      clock-controller@fc400000 {
>          compatible = "qcom,gcc-apq8084";
>          reg = <0xfc400000 0x4000>;
>          #clock-cells = <1>;
>          #reset-cells = <1>;
>          #power-domain-cells = <1>;
Stephen Boyd Jan. 25, 2023, 9:45 p.m. UTC | #3
Quoting Dmitry Baryshkov (2023-01-10 22:03:53)
> Define clock/clock-names properties of the MMCC device node to be used
> on APQ8084 platform.
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Stephen Boyd Jan. 25, 2023, 9:45 p.m. UTC | #4
Quoting Dmitry Baryshkov (2023-01-10 22:03:54)
> Use ARRAY_SIZE() instead of manually specifying num_parents. This makes
> adding/removing entries to/from parent_data easy and errorproof.
> 
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Stephen Boyd Jan. 25, 2023, 9:49 p.m. UTC | #5
Quoting Dmitry Baryshkov (2023-01-10 22:03:56)
> Convert the clock driver to specify parent data rather than parent
> names, to actually bind using 'clock-names' specified in the DTS rather
> than global clock names. Use parent_hws where possible to refer parent
> clocks directly, skipping the lookup.
> 
> Note, the system names for xo clocks were changed from "xo" to
> "xo_board" to follow the example of other platforms. This switches the
> clocks to use DT-provided "xo_board" clock instead of manually
> registered "xo" clock and allows us to drop qcom_cc_register_board_clk()
> call from the driver at some point.

Should probably also mention that using the firmware path will mean the
RPM control of XO could be involved and so suspend may no longer achieve
XO shutdown or it will stop working. In case bisect lands here we'll
know from the commit text that this likely broke power management.

> 
> In the same way change the looked up system "sleep_clk_src" clock to
> "sleep_clk", which is registered from DT.
> 
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Stephen Boyd Jan. 25, 2023, 9:50 p.m. UTC | #6
Quoting Dmitry Baryshkov (2023-01-10 22:03:58)
> Use ARRAY_SIZE() instead of manually specifying num_parents. This makes
> adding/removing entries to/from parent_data easy and errorproof.
> 
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Stephen Boyd Jan. 25, 2023, 9:52 p.m. UTC | #7
Quoting Dmitry Baryshkov (2023-01-10 22:04:02)
> diff --git a/arch/arm/boot/dts/qcom-apq8084.dtsi b/arch/arm/boot/dts/qcom-apq8084.dtsi
> index 4b0d2b4f4b6a..4d01f0f2292e 100644
> --- a/arch/arm/boot/dts/qcom-apq8084.dtsi
> +++ b/arch/arm/boot/dts/qcom-apq8084.dtsi
> @@ -388,6 +388,24 @@ gcc: clock-controller@fc400000 {
>                         #reset-cells = <1>;
>                         #power-domain-cells = <1>;
>                         reg = <0xfc400000 0x4000>;
> +                       clocks = <&xo_board>,
> +                                <&sleep_clk>,
> +                                <0>, /* ufs */
> +                                <0>,
> +                                <0>,
> +                                <0>,
> +                                <0>, /* sata */
> +                                <0>,
> +                                <0>; /* pcie */
> +                       clock-names = "xo",

It just uses xo_board again though, so it's a no-op until someone
decides to change this to the RPM provided XO clk.
Dmitry Baryshkov Jan. 26, 2023, 8:23 a.m. UTC | #8
On 25/01/2023 23:49, Stephen Boyd wrote:
> Quoting Dmitry Baryshkov (2023-01-10 22:03:56)
>> Convert the clock driver to specify parent data rather than parent
>> names, to actually bind using 'clock-names' specified in the DTS rather
>> than global clock names. Use parent_hws where possible to refer parent
>> clocks directly, skipping the lookup.
>>
>> Note, the system names for xo clocks were changed from "xo" to
>> "xo_board" to follow the example of other platforms. This switches the
>> clocks to use DT-provided "xo_board" clock instead of manually
>> registered "xo" clock and allows us to drop qcom_cc_register_board_clk()
>> call from the driver at some point.
> 
> Should probably also mention that using the firmware path will mean the
> RPM control of XO could be involved and so suspend may no longer achieve
> XO shutdown or it will stop working. In case bisect lands here we'll
> know from the commit text that this likely broke power management.

As you've seen from the DT changes, this series is a pure rework, no 
switching to RPM's XO clock.

> 
>>
>> In the same way change the looked up system "sleep_clk_src" clock to
>> "sleep_clk", which is registered from DT.
>>
>> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---
> 
> Reviewed-by: Stephen Boyd <sboyd@kernel.org>