Skip to content

Commit

Permalink
Merge branches 'clk-xilinx', 'clk-kunit', 'clk-cs2000' and 'clk-renes…
Browse files Browse the repository at this point in the history
…as' into clk-next

 - Kunit tests for clk-gate implementation
 - Convert Cirrus Logic CS2000P driver to regmap, yamlify DT binding and add
   support for dynamic mode

* clk-xilinx:
  clk: zynqmp: replace warn_once with pr_debug for failed clock ops

* clk-kunit:
  clk: gate: Add some kunit test suites

* clk-cs2000:
  clk: cs2000-cp: convert driver to regmap
  clk: cs2000-cp: freeze config during register fiddling
  clk: cs2000-cp: make clock skip setting configurable
  clk: cs2000-cp: add support for dynamic mode
  clk: cs2000-cp: Make aux output function controllable
  dt-bindings: clock: cs2000-cp: document cirrus,dynamic-mode
  dt-bindings: clock: cs2000-cp: document cirrus,clock-skip flag
  dt-bindings: clock: cs2000-cp: document aux-output-source
  dt-bindings: clock: convert cs2000-cp bindings to yaml

* clk-renesas:
  dt-bindings: clock: renesas: Make example 'clocks' parsable
  clk: rs9: Add Renesas 9-series PCIe clock generator driver
  clk: fixed-factor: Introduce devm_clk_hw_register_fixed_factor_index()
  dt-bindings: clk: rs9: Add Renesas 9-series I2C PCIe clock generator
  clk: renesas: r8a779f0: Add PFC clock
  clk: renesas: r8a779f0: Add I2C clocks
  clk: renesas: r8a779f0: Add WDT clock
  clk: renesas: r8a779f0: Fix RSW2 clock divider
  clk: renesas: rzg2l-cpg: Add support for RZ/V2L SoC
  dt-bindings: clock: renesas: Document RZ/V2L SoC
  dt-bindings: clock: Add R9A07G054 CPG Clock and Reset Definitions
  clk: renesas: r8a779a0: Add CANFD module clock
  clk: renesas: r9a07g044: Update multiplier and divider values for PLL2/3
  clk: renesas: r8a7799[05]: Add MLP clocks
  clk: renesas: r8a779f0: Add SYS-DMAC clocks
  • Loading branch information
Stephen Boyd committed Mar 29, 2022
5 parents 407c04d + 4917394 + a992acb + 5edffb9 + 3b1db05 commit f9fca89
Show file tree
Hide file tree
Showing 28 changed files with 1,744 additions and 337 deletions.
91 changes: 91 additions & 0 deletions Documentation/devicetree/bindings/clock/cirrus,cs2000-cp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/cirrus,cs2000-cp.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Binding CIRRUS LOGIC Fractional-N Clock Synthesizer & Clock Multiplier

maintainers:
- Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

description: |
The CS2000-CP is an extremely versatile system clocking device that
utilizes a programmable phase lock loop.
Link: https://www.cirrus.com/products/cs2000/
properties:
compatible:
enum:
- cirrus,cs2000-cp

clocks:
description:
Common clock binding for CLK_IN, XTI/REF_CLK
minItems: 2
maxItems: 2

clock-names:
items:
- const: clk_in
- const: ref_clk

'#clock-cells':
const: 0

reg:
maxItems: 1

cirrus,aux-output-source:
description:
Specifies the function of the auxiliary clock output pin
$ref: /schemas/types.yaml#/definitions/uint32
enum:
- 0 # CS2000CP_AUX_OUTPUT_REF_CLK: ref_clk input
- 1 # CS2000CP_AUX_OUTPUT_CLK_IN: clk_in input
- 2 # CS2000CP_AUX_OUTPUT_CLK_OUT: clk_out output
- 3 # CS2000CP_AUX_OUTPUT_PLL_LOCK: pll lock status
default: 0

cirrus,clock-skip:
description:
This mode allows the PLL to maintain lock even when CLK_IN
has missing pulses for up to 20 ms.
$ref: /schemas/types.yaml#/definitions/flag

cirrus,dynamic-mode:
description:
In dynamic mode, the CLK_IN input is used to drive the
digital PLL of the silicon.
If not given, the static mode shall be used to derive the
output signal directly from the REF_CLK input.
$ref: /schemas/types.yaml#/definitions/flag

required:
- compatible
- reg
- clocks
- clock-names
- '#clock-cells'

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/cirrus,cs2000-cp.h>
i2c@0 {
reg = <0x0 0x100>;
#address-cells = <1>;
#size-cells = <0>;
clock-controller@4f {
#clock-cells = <0>;
compatible = "cirrus,cs2000-cp";
reg = <0x4f>;
clocks = <&rcar_sound 0>, <&x12_clk>;
clock-names = "clk_in", "ref_clk";
cirrus,aux-output-source = <CS2000CP_AUX_OUTPUT_CLK_OUT>;
};
};
22 changes: 0 additions & 22 deletions Documentation/devicetree/bindings/clock/cs2000-cp.txt

This file was deleted.

97 changes: 97 additions & 0 deletions Documentation/devicetree/bindings/clock/renesas,9series.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/renesas,9series.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Binding for Renesas 9-series I2C PCIe clock generators

description: |
The Renesas 9-series are I2C PCIe clock generators providing
from 1 to 20 output clocks.
When referencing the provided clock in the DT using phandle
and clock specifier, the following mapping applies:
- 9FGV0241:
0 -- DIF0
1 -- DIF1
maintainers:
- Marek Vasut <marex@denx.de>

properties:
compatible:
enum:
- renesas,9fgv0241

reg:
description: I2C device address
enum: [ 0x68, 0x6a ]

'#clock-cells':
const: 1

clocks:
items:
- description: XTal input clock

renesas,out-amplitude-microvolt:
enum: [ 600000, 700000, 800000, 900000 ]
description: Output clock signal amplitude

renesas,out-spread-spectrum:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [ 100000, 99750, 99500 ]
description: Output clock down spread in pcm (1/1000 of percent)

patternProperties:
"^DIF[0-19]$":
type: object
description:
Description of one of the outputs (DIF0..DIF19).

properties:
renesas,slew-rate:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [ 2000000, 3000000 ]
description: Output clock slew rate select in V/ns

additionalProperties: false

required:
- compatible
- reg
- clocks
- '#clock-cells'

additionalProperties: false

examples:
- |
/* 25MHz reference crystal */
ref25: ref25m {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <25000000>;
};
i2c@0 {
reg = <0x0 0x100>;
#address-cells = <1>;
#size-cells = <0>;
rs9: clock-generator@6a {
compatible = "renesas,9fgv0241";
reg = <0x6a>;
#clock-cells = <1>;
clocks = <&ref25m>;
DIF0 {
renesas,slew-rate = <3000000>;
};
};
};
...
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/clock/r8a73a4-clock.h>
cpg_clocks: cpg_clocks@e6150000 {
compatible = "renesas,r8a73a4-cpg-clocks";
reg = <0xe6150000 0x10000>;
clocks = <&extal1_clk>, <&extal2_clk>;
#clock-cells = <1>;
clock-output-names = "main", "pll0", "pll1", "pll2",
"pll2s", "pll2h", "z", "z2",
"i", "m3", "b", "m1", "m2",
"zx", "zs", "hp";
};
sdhi2_clk: sdhi2_clk@e615007c {
compatible = "renesas,r8a73a4-div6-clock", "renesas,cpg-div6-clock";
reg = <0xe615007c 4>;
Expand Down
14 changes: 8 additions & 6 deletions Documentation/devicetree/bindings/clock/renesas,rzg2l-cpg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
$id: "http://devicetree.org/schemas/clock/renesas,rzg2l-cpg.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Renesas RZ/G2L Clock Pulse Generator / Module Standby Mode
title: Renesas RZ/{G2L,V2L} Clock Pulse Generator / Module Standby Mode

maintainers:
- Geert Uytterhoeven <geert+renesas@glider.be>

description: |
On Renesas RZ/G2L SoC, the CPG (Clock Pulse Generator) and Module
On Renesas RZ/{G2L,V2L} SoC, the CPG (Clock Pulse Generator) and Module
Standby Mode share the same register block.
They provide the following functionalities:
Expand All @@ -22,7 +22,9 @@ description: |
properties:
compatible:
const: renesas,r9a07g044-cpg # RZ/G2{L,LC}
enum:
- renesas,r9a07g044-cpg # RZ/G2{L,LC}
- renesas,r9a07g054-cpg # RZ/V2L

reg:
maxItems: 1
Expand All @@ -40,9 +42,9 @@ properties:
description: |
- For CPG core clocks, the two clock specifier cells must be "CPG_CORE"
and a core clock reference, as defined in
<dt-bindings/clock/r9a07g044-cpg.h>
<dt-bindings/clock/r9a07g*-cpg.h>
- For module clocks, the two clock specifier cells must be "CPG_MOD" and
a module number, as defined in the <dt-bindings/clock/r9a07g044-cpg.h>.
a module number, as defined in the <dt-bindings/clock/r9a07g0*-cpg.h>.
const: 2

'#power-domain-cells':
Expand All @@ -56,7 +58,7 @@ properties:
'#reset-cells':
description:
The single reset specifier cell must be the module number, as defined in
the <dt-bindings/clock/r9a07g044-cpg.h>.
the <dt-bindings/clock/r9a07g0*-cpg.h>.
const: 1

required:
Expand Down
3 changes: 3 additions & 0 deletions drivers/clk/.kunitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_KUNIT=y
CONFIG_COMMON_CLK=y
CONFIG_CLK_GATE_KUNIT_TEST=y
18 changes: 18 additions & 0 deletions drivers/clk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ config COMMON_CLK_CDCE925
config COMMON_CLK_CS2000_CP
tristate "Clock driver for CS2000 Fractional-N Clock Synthesizer & Clock Multiplier"
depends on I2C
select REGMAP_I2C
help
If you say yes here you get support for the CS2000 clock multiplier.

Expand Down Expand Up @@ -337,6 +338,15 @@ config COMMON_CLK_OXNAS
help
Support for the OXNAS SoC Family clocks.

config COMMON_CLK_RS9_PCIE
tristate "Clock driver for Renesas 9-series PCIe clock generators"
depends on I2C
depends on OF
select REGMAP_I2C
help
This driver supports the Renesas 9-series PCIe clock generator
models 9FGV/9DBV/9DMV/9FGL/9DML/9QXL/9SQ.

config COMMON_CLK_VC5
tristate "Clock driver for IDT VersaClock 5,6 devices"
depends on I2C
Expand Down Expand Up @@ -426,4 +436,12 @@ source "drivers/clk/x86/Kconfig"
source "drivers/clk/xilinx/Kconfig"
source "drivers/clk/zynqmp/Kconfig"

# Kunit test cases
config CLK_GATE_KUNIT_TEST
tristate "Basic gate type Kunit test" if !KUNIT_ALL_TESTS
depends on KUNIT
default KUNIT_ALL_TESTS
help
Kunit test for the basic clk gate type.

endif
2 changes: 2 additions & 0 deletions drivers/clk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ obj-$(CONFIG_COMMON_CLK) += clk-divider.o
obj-$(CONFIG_COMMON_CLK) += clk-fixed-factor.o
obj-$(CONFIG_COMMON_CLK) += clk-fixed-rate.o
obj-$(CONFIG_COMMON_CLK) += clk-gate.o
obj-$(CONFIG_CLK_GATE_KUNIT_TEST) += clk-gate_test.o
obj-$(CONFIG_COMMON_CLK) += clk-multiplier.o
obj-$(CONFIG_COMMON_CLK) += clk-mux.o
obj-$(CONFIG_COMMON_CLK) += clk-composite.o
Expand Down Expand Up @@ -67,6 +68,7 @@ obj-$(CONFIG_COMMON_CLK_STM32MP157) += clk-stm32mp1.o
obj-$(CONFIG_COMMON_CLK_TPS68470) += clk-tps68470.o
obj-$(CONFIG_CLK_TWL6040) += clk-twl6040.o
obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o
obj-$(CONFIG_COMMON_CLK_RS9_PCIE) += clk-renesas-pcie.o
obj-$(CONFIG_COMMON_CLK_VC5) += clk-versaclock5.o
obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
obj-$(CONFIG_COMMON_CLK_XGENE) += clk-xgene.o
Expand Down
Loading

0 comments on commit f9fca89

Please sign in to comment.