mbox series

[v3,0/2] Add GCC for SM4250/6115

Message ID 20210801103448.3329333-1-iskren.chernev@gmail.com
Headers show
Series Add GCC for SM4250/6115 | expand

Message

Iskren Chernev Aug. 1, 2021, 10:34 a.m. UTC
This patch adds support for the Global Clock Controller on QCom SM4250 and
SM6115, codename bengal. The code is taken from OnePlus repo [1]. The two
platforms are identical so there is only one compat string.

[1]: https://github.com/OnePlusOSS/android_kernel_oneplus_sm4250

v1: https://lkml.org/lkml/2021/6/22/1131
v2: https://lkml.org/lkml/2021/6/27/157

Changes from v2:
- Suggested by Stephen Boyd
  - switch to parent_data in place of parent_names
- other
  - drop parent refs to invalid clocks
  - use pll-alpha regs when possible
  - drop unused parent defs
  - add pll test clock to bindings

Changes from v1:
- remove sm4250 compat, there will be a single sm6115.dtsi for both platforms

Iskren Chernev (2):
  dt-bindings: clk: qcom: gcc-sm6115: Document SM6115 GCC
  clk: qcom: Add Global Clock controller (GCC) driver for SM6115

 .../bindings/clock/qcom,gcc-sm6115.yaml       |   74 +
 drivers/clk/qcom/Kconfig                      |    7 +
 drivers/clk/qcom/Makefile                     |    1 +
 drivers/clk/qcom/gcc-sm6115.c                 | 3582 +++++++++++++++++
 include/dt-bindings/clock/qcom,gcc-sm6115.h   |  201 +
 5 files changed, 3865 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml
 create mode 100644 drivers/clk/qcom/gcc-sm6115.c
 create mode 100644 include/dt-bindings/clock/qcom,gcc-sm6115.h


base-commit: 8d4b477da1a807199ca60e0829357ce7aa6758d5

Comments

Rob Herring (Arm) Aug. 2, 2021, 1:39 p.m. UTC | #1
On Sun, 01 Aug 2021 13:34:47 +0300, Iskren Chernev wrote:
> Add device tree bindings for global clock controller on SM6115 and

> SM4250 SoCs (pin and software compatible).

> 

> Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>

> ---

>  .../bindings/clock/qcom,gcc-sm6115.yaml       |  74 +++++++

>  include/dt-bindings/clock/qcom,gcc-sm6115.h   | 201 ++++++++++++++++++

>  2 files changed, 275 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml

>  create mode 100644 include/dt-bindings/clock/qcom,gcc-sm6115.h

> 


My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.example.dt.yaml: clock-controller@1400000: clocks: [[4294967295, 0], [4294967295]] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.example.dt.yaml: clock-controller@1400000: clock-names: ['bi_tcxo', 'sleep_clk'] is too short
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml
\ndoc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1512028

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Stephen Boyd Aug. 2, 2021, 10:21 p.m. UTC | #2
Quoting Iskren Chernev (2021-08-01 03:34:47)
> Add device tree bindings for global clock controller on SM6115 and

> SM4250 SoCs (pin and software compatible).

> 

> Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>

> ---

>  .../bindings/clock/qcom,gcc-sm6115.yaml       |  74 +++++++

>  include/dt-bindings/clock/qcom,gcc-sm6115.h   | 201 ++++++++++++++++++

>  2 files changed, 275 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml

>  create mode 100644 include/dt-bindings/clock/qcom,gcc-sm6115.h

> 

> diff --git a/Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml b/Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml

> new file mode 100644

> index 000000000000..c8c9eb82b9b4

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml

> @@ -0,0 +1,74 @@

> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

> +%YAML 1.2

> +---

> +$id: http://devicetree.org/schemas/clock/qcom,gcc-sm6115.yaml#

> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> +

> +title: Qualcomm Global Clock & Reset Controller Binding for SM6115 and SM4250

> +

> +maintainers:

> +  - Iskren Chernev <iskren.chernev@gmail.com>

> +

> +description: |

> +  Qualcomm global clock control module which supports the clocks, resets and

> +  power domains on SM4250/6115.

> +

> +  See also:

> +  - dt-bindings/clock/qcom,gcc-sm6115.h

> +

> +properties:

> +  compatible:

> +    const: qcom,gcc-sm6115

> +

> +  clocks:

> +    items:

> +      - description: Board XO source

> +      - description: Sleep clock source

> +      - description: PLL test clock source (Optional clock)


Please drop this last one

> +

> +  clock-names:

> +    items:

> +      - const: bi_tcxo

> +      - const: sleep_clk

> +      - const: core_bi_pll_test_se # Optional clock


And this last one. The test input is never used. I'd make this the same
as gcc-sc7180, i.e. have the always on XO as an input in case it is
needed.

> +

> +  '#clock-cells':

> +    const: 1