xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/clock/baikal,bt1-ccu-div.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*4882a593Smuzhiyun# Copyright (C) 2020 BAIKAL ELECTRONICS, JSC
3*4882a593Smuzhiyun%YAML 1.2
4*4882a593Smuzhiyun---
5*4882a593Smuzhiyun$id: http://devicetree.org/schemas/clock/baikal,bt1-ccu-div.yaml#
6*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
7*4882a593Smuzhiyun
8*4882a593Smuzhiyuntitle: Baikal-T1 Clock Control Unit Dividers
9*4882a593Smuzhiyun
10*4882a593Smuzhiyunmaintainers:
11*4882a593Smuzhiyun  - Serge Semin <fancer.lancer@gmail.com>
12*4882a593Smuzhiyun
13*4882a593Smuzhiyundescription: |
14*4882a593Smuzhiyun  Clocks Control Unit is the core of Baikal-T1 SoC System Controller
15*4882a593Smuzhiyun  responsible for the chip subsystems clocking and resetting. The CCU is
16*4882a593Smuzhiyun  connected with an external fixed rate oscillator, which signal is transformed
17*4882a593Smuzhiyun  into clocks of various frequencies and then propagated to either individual
18*4882a593Smuzhiyun  IP-blocks or to groups of blocks (clock domains). The transformation is done
19*4882a593Smuzhiyun  by means of an embedded into CCU PLLs and gateable/non-gateable dividers. The
20*4882a593Smuzhiyun  later ones are described in this binding. Each clock domain can be also
21*4882a593Smuzhiyun  individually reset by using the domain clocks divider configuration
22*4882a593Smuzhiyun  registers. Baikal-T1 CCU is logically divided into the next components:
23*4882a593Smuzhiyun  1) External oscillator (normally XTAL's 25 MHz crystal oscillator, but
24*4882a593Smuzhiyun     in general can provide any frequency supported by the CCU PLLs).
25*4882a593Smuzhiyun  2) PLLs clocks generators (PLLs).
26*4882a593Smuzhiyun  3) AXI-bus clock dividers (AXI) - described in this binding file.
27*4882a593Smuzhiyun  4) System devices reference clock dividers (SYS) - described in this binding
28*4882a593Smuzhiyun     file.
29*4882a593Smuzhiyun  which are connected with each other as shown on the next figure:
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun          +---------------+
32*4882a593Smuzhiyun          | Baikal-T1 CCU |
33*4882a593Smuzhiyun          |   +----+------|- MIPS P5600 cores
34*4882a593Smuzhiyun          | +-|PLLs|------|- DDR controller
35*4882a593Smuzhiyun          | | +----+      |
36*4882a593Smuzhiyun  +----+  | |  |  |       |
37*4882a593Smuzhiyun  |XTAL|--|-+  |  | +---+-|
38*4882a593Smuzhiyun  +----+  | |  |  +-|AXI|-|- AXI-bus
39*4882a593Smuzhiyun          | |  |    +---+-|
40*4882a593Smuzhiyun          | |  |          |
41*4882a593Smuzhiyun          | |  +----+---+-|- APB-bus
42*4882a593Smuzhiyun          | +-------|SYS|-|- Low-speed Devices
43*4882a593Smuzhiyun          |         +---+-|- High-speed Devices
44*4882a593Smuzhiyun          +---------------+
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun  Each sub-block is represented as a separate DT node and has an individual
47*4882a593Smuzhiyun  driver to be bound with.
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun  In order to create signals of wide range frequencies the external oscillator
50*4882a593Smuzhiyun  output is primarily connected to a set of CCU PLLs. Some of PLLs CLKOUT are
51*4882a593Smuzhiyun  then passed over CCU dividers to create signals required for the target clock
52*4882a593Smuzhiyun  domain (like AXI-bus or System Device consumers). The dividers have the
53*4882a593Smuzhiyun  following structure:
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun          +--------------+
56*4882a593Smuzhiyun  CLKIN --|->+----+ 1|\  |
57*4882a593Smuzhiyun  SETCLK--|--|/DIV|->| | |
58*4882a593Smuzhiyun  CLKDIV--|--|    |  | |-|->CLKLOUT
59*4882a593Smuzhiyun  LOCK----|--+----+  | | |
60*4882a593Smuzhiyun          |          |/  |
61*4882a593Smuzhiyun          |           |  |
62*4882a593Smuzhiyun  EN------|-----------+  |
63*4882a593Smuzhiyun  RST-----|--------------|->RSTOUT
64*4882a593Smuzhiyun          +--------------+
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun  where CLKIN is the reference clock coming either from CCU PLLs or from an
67*4882a593Smuzhiyun  external clock oscillator, SETCLK - a command to update the output clock in
68*4882a593Smuzhiyun  accordance with a set divider, CLKDIV - clocks divider, LOCK - a signal of
69*4882a593Smuzhiyun  the output clock stabilization, EN - enable/disable the divider block,
70*4882a593Smuzhiyun  RST/RSTOUT - reset clocks domain signal. Depending on the consumer IP-core
71*4882a593Smuzhiyun  peculiarities the dividers may lack of some functionality depicted on the
72*4882a593Smuzhiyun  figure above (like EN, CLKDIV/LOCK/SETCLK). In this case the corresponding
73*4882a593Smuzhiyun  clock provider just doesn't expose either switching functions, or the rate
74*4882a593Smuzhiyun  configuration, or both of them.
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun  The clock dividers, which output clock is then consumed by the SoC individual
77*4882a593Smuzhiyun  devices, are united into a single clocks provider called System Devices CCU.
78*4882a593Smuzhiyun  Similarly the dividers with output clocks utilized as AXI-bus reference clocks
79*4882a593Smuzhiyun  are called AXI-bus CCU. Both of them use the common clock bindings with no
80*4882a593Smuzhiyun  custom properties. The list of exported clocks and reset signals can be found
81*4882a593Smuzhiyun  in the files: 'include/dt-bindings/clock/bt1-ccu.h' and
82*4882a593Smuzhiyun  'include/dt-bindings/reset/bt1-ccu.h'. Since System Devices and AXI-bus CCU
83*4882a593Smuzhiyun  are a part of the Baikal-T1 SoC System Controller their DT nodes are supposed
84*4882a593Smuzhiyun  to be a children of later one.
85*4882a593Smuzhiyun
86*4882a593Smuzhiyunif:
87*4882a593Smuzhiyun  properties:
88*4882a593Smuzhiyun    compatible:
89*4882a593Smuzhiyun      contains:
90*4882a593Smuzhiyun        const: baikal,bt1-ccu-axi
91*4882a593Smuzhiyun
92*4882a593Smuzhiyunthen:
93*4882a593Smuzhiyun  properties:
94*4882a593Smuzhiyun    clocks:
95*4882a593Smuzhiyun      items:
96*4882a593Smuzhiyun        - description: CCU SATA PLL output clock
97*4882a593Smuzhiyun        - description: CCU PCIe PLL output clock
98*4882a593Smuzhiyun        - description: CCU Ethernet PLL output clock
99*4882a593Smuzhiyun
100*4882a593Smuzhiyun    clock-names:
101*4882a593Smuzhiyun      items:
102*4882a593Smuzhiyun        - const: sata_clk
103*4882a593Smuzhiyun        - const: pcie_clk
104*4882a593Smuzhiyun        - const: eth_clk
105*4882a593Smuzhiyun
106*4882a593Smuzhiyunelse:
107*4882a593Smuzhiyun  properties:
108*4882a593Smuzhiyun    clocks:
109*4882a593Smuzhiyun      items:
110*4882a593Smuzhiyun        - description: External reference clock
111*4882a593Smuzhiyun        - description: CCU SATA PLL output clock
112*4882a593Smuzhiyun        - description: CCU PCIe PLL output clock
113*4882a593Smuzhiyun        - description: CCU Ethernet PLL output clock
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun    clock-names:
116*4882a593Smuzhiyun      items:
117*4882a593Smuzhiyun        - const: ref_clk
118*4882a593Smuzhiyun        - const: sata_clk
119*4882a593Smuzhiyun        - const: pcie_clk
120*4882a593Smuzhiyun        - const: eth_clk
121*4882a593Smuzhiyun
122*4882a593Smuzhiyunproperties:
123*4882a593Smuzhiyun  compatible:
124*4882a593Smuzhiyun    enum:
125*4882a593Smuzhiyun      - baikal,bt1-ccu-axi
126*4882a593Smuzhiyun      - baikal,bt1-ccu-sys
127*4882a593Smuzhiyun
128*4882a593Smuzhiyun  reg:
129*4882a593Smuzhiyun    maxItems: 1
130*4882a593Smuzhiyun
131*4882a593Smuzhiyun  "#clock-cells":
132*4882a593Smuzhiyun    const: 1
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun  "#reset-cells":
135*4882a593Smuzhiyun    const: 1
136*4882a593Smuzhiyun
137*4882a593Smuzhiyun  clocks: true
138*4882a593Smuzhiyun
139*4882a593Smuzhiyun  clock-names: true
140*4882a593Smuzhiyun
141*4882a593SmuzhiyunadditionalProperties: false
142*4882a593Smuzhiyun
143*4882a593Smuzhiyunrequired:
144*4882a593Smuzhiyun  - compatible
145*4882a593Smuzhiyun  - "#clock-cells"
146*4882a593Smuzhiyun  - clocks
147*4882a593Smuzhiyun  - clock-names
148*4882a593Smuzhiyun
149*4882a593Smuzhiyunexamples:
150*4882a593Smuzhiyun  # AXI-bus Clock Control Unit node:
151*4882a593Smuzhiyun  - |
152*4882a593Smuzhiyun    #include <dt-bindings/clock/bt1-ccu.h>
153*4882a593Smuzhiyun
154*4882a593Smuzhiyun    clock-controller@1f04d030 {
155*4882a593Smuzhiyun      compatible = "baikal,bt1-ccu-axi";
156*4882a593Smuzhiyun      reg = <0x1f04d030 0x030>;
157*4882a593Smuzhiyun      #clock-cells = <1>;
158*4882a593Smuzhiyun      #reset-cells = <1>;
159*4882a593Smuzhiyun
160*4882a593Smuzhiyun      clocks = <&ccu_pll CCU_SATA_PLL>,
161*4882a593Smuzhiyun               <&ccu_pll CCU_PCIE_PLL>,
162*4882a593Smuzhiyun               <&ccu_pll CCU_ETH_PLL>;
163*4882a593Smuzhiyun      clock-names = "sata_clk", "pcie_clk", "eth_clk";
164*4882a593Smuzhiyun    };
165*4882a593Smuzhiyun  # System Devices Clock Control Unit node:
166*4882a593Smuzhiyun  - |
167*4882a593Smuzhiyun    #include <dt-bindings/clock/bt1-ccu.h>
168*4882a593Smuzhiyun
169*4882a593Smuzhiyun    clock-controller@1f04d060 {
170*4882a593Smuzhiyun      compatible = "baikal,bt1-ccu-sys";
171*4882a593Smuzhiyun      reg = <0x1f04d060 0x0a0>;
172*4882a593Smuzhiyun      #clock-cells = <1>;
173*4882a593Smuzhiyun      #reset-cells = <1>;
174*4882a593Smuzhiyun
175*4882a593Smuzhiyun      clocks = <&clk25m>,
176*4882a593Smuzhiyun               <&ccu_pll CCU_SATA_PLL>,
177*4882a593Smuzhiyun               <&ccu_pll CCU_PCIE_PLL>,
178*4882a593Smuzhiyun               <&ccu_pll CCU_ETH_PLL>;
179*4882a593Smuzhiyun      clock-names = "ref_clk", "sata_clk", "pcie_clk",
180*4882a593Smuzhiyun                    "eth_clk";
181*4882a593Smuzhiyun    };
182*4882a593Smuzhiyun  # Required Clock Control Unit PLL node:
183*4882a593Smuzhiyun  - |
184*4882a593Smuzhiyun    ccu_pll: clock-controller@1f04d000 {
185*4882a593Smuzhiyun      compatible = "baikal,bt1-ccu-pll";
186*4882a593Smuzhiyun      reg = <0x1f04d000 0x028>;
187*4882a593Smuzhiyun      #clock-cells = <1>;
188*4882a593Smuzhiyun
189*4882a593Smuzhiyun      clocks = <&clk25m>;
190*4882a593Smuzhiyun      clock-names = "ref_clk";
191*4882a593Smuzhiyun    };
192*4882a593Smuzhiyun...
193