xref: /freebsd/sys/contrib/device-tree/Bindings/clock/baikal,bt1-ccu-pll.yaml (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*c66ec88fSEmmanuel Vadot# Copyright (C) 2020 BAIKAL ELECTRONICS, JSC
3*c66ec88fSEmmanuel Vadot%YAML 1.2
4*c66ec88fSEmmanuel Vadot---
5*c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/clock/baikal,bt1-ccu-pll.yaml#
6*c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel Vadottitle: Baikal-T1 Clock Control Unit PLL
9*c66ec88fSEmmanuel Vadot
10*c66ec88fSEmmanuel Vadotmaintainers:
11*c66ec88fSEmmanuel Vadot  - Serge Semin <fancer.lancer@gmail.com>
12*c66ec88fSEmmanuel Vadot
13*c66ec88fSEmmanuel Vadotdescription: |
14*c66ec88fSEmmanuel Vadot  Clocks Control Unit is the core of Baikal-T1 SoC System Controller
15*c66ec88fSEmmanuel Vadot  responsible for the chip subsystems clocking and resetting. The CCU is
16*c66ec88fSEmmanuel Vadot  connected with an external fixed rate oscillator, which signal is transformed
17*c66ec88fSEmmanuel Vadot  into clocks of various frequencies and then propagated to either individual
18*c66ec88fSEmmanuel Vadot  IP-blocks or to groups of blocks (clock domains). The transformation is done
19*c66ec88fSEmmanuel Vadot  by means of PLLs and gateable/non-gateable dividers embedded into the CCU.
20*c66ec88fSEmmanuel Vadot  It's logically divided into the next components:
21*c66ec88fSEmmanuel Vadot  1) External oscillator (normally XTAL's 25 MHz crystal oscillator, but
22*c66ec88fSEmmanuel Vadot     in general can provide any frequency supported by the CCU PLLs).
23*c66ec88fSEmmanuel Vadot  2) PLLs clocks generators (PLLs) - described in this binding file.
24*c66ec88fSEmmanuel Vadot  3) AXI-bus clock dividers (AXI).
25*c66ec88fSEmmanuel Vadot  4) System devices reference clock dividers (SYS).
26*c66ec88fSEmmanuel Vadot  which are connected with each other as shown on the next figure:
27*c66ec88fSEmmanuel Vadot
28*c66ec88fSEmmanuel Vadot          +---------------+
29*c66ec88fSEmmanuel Vadot          | Baikal-T1 CCU |
30*c66ec88fSEmmanuel Vadot          |   +----+------|- MIPS P5600 cores
31*c66ec88fSEmmanuel Vadot          | +-|PLLs|------|- DDR controller
32*c66ec88fSEmmanuel Vadot          | | +----+      |
33*c66ec88fSEmmanuel Vadot  +----+  | |  |  |       |
34*c66ec88fSEmmanuel Vadot  |XTAL|--|-+  |  | +---+-|
35*c66ec88fSEmmanuel Vadot  +----+  | |  |  +-|AXI|-|- AXI-bus
36*c66ec88fSEmmanuel Vadot          | |  |    +---+-|
37*c66ec88fSEmmanuel Vadot          | |  |          |
38*c66ec88fSEmmanuel Vadot          | |  +----+---+-|- APB-bus
39*c66ec88fSEmmanuel Vadot          | +-------|SYS|-|- Low-speed Devices
40*c66ec88fSEmmanuel Vadot          |         +---+-|- High-speed Devices
41*c66ec88fSEmmanuel Vadot          +---------------+
42*c66ec88fSEmmanuel Vadot
43*c66ec88fSEmmanuel Vadot  Each CCU sub-block is represented as a separate dts-node and has an
44*c66ec88fSEmmanuel Vadot  individual driver to be bound with.
45*c66ec88fSEmmanuel Vadot
46*c66ec88fSEmmanuel Vadot  In order to create signals of wide range frequencies the external oscillator
47*c66ec88fSEmmanuel Vadot  output is primarily connected to a set of CCU PLLs. There are five PLLs
48*c66ec88fSEmmanuel Vadot  to create a clock for the MIPS P5600 cores, the embedded DDR controller,
49*c66ec88fSEmmanuel Vadot  SATA, Ethernet and PCIe domains. The last three domains though named by the
50*c66ec88fSEmmanuel Vadot  biggest system interfaces in fact include nearly all of the rest SoC
51*c66ec88fSEmmanuel Vadot  peripherals. Each of the PLLs is based on True Circuits TSMC CLN28HPM core
52*c66ec88fSEmmanuel Vadot  with an interface wrapper (so called safe PLL' clocks switcher) to simplify
53*c66ec88fSEmmanuel Vadot  the PLL configuration procedure. The PLLs work as depicted on the next
54*c66ec88fSEmmanuel Vadot  diagram:
55*c66ec88fSEmmanuel Vadot
56*c66ec88fSEmmanuel Vadot      +--------------------------+
57*c66ec88fSEmmanuel Vadot      |                          |
58*c66ec88fSEmmanuel Vadot      +-->+---+    +---+   +---+ |  +---+   0|\
59*c66ec88fSEmmanuel Vadot  CLKF--->|/NF|--->|PFD|...|VCO|-+->|/OD|--->| |
60*c66ec88fSEmmanuel Vadot          +---+ +->+---+   +---+ /->+---+    | |--->CLKOUT
61*c66ec88fSEmmanuel Vadot  CLKOD---------C----------------+          1| |
62*c66ec88fSEmmanuel Vadot       +--------C--------------------------->|/
63*c66ec88fSEmmanuel Vadot       |        |                             ^
64*c66ec88fSEmmanuel Vadot  Rclk-+->+---+ |                             |
65*c66ec88fSEmmanuel Vadot  CLKR--->|/NR|-+                             |
66*c66ec88fSEmmanuel Vadot          +---+                               |
67*c66ec88fSEmmanuel Vadot  BYPASS--------------------------------------+
68*c66ec88fSEmmanuel Vadot  BWADJ--->
69*c66ec88fSEmmanuel Vadot
70*c66ec88fSEmmanuel Vadot  where Rclk is the reference clock coming  from XTAL, NR - reference clock
71*c66ec88fSEmmanuel Vadot  divider, NF - PLL clock multiplier, OD - VCO output clock divider, CLKOUT -
72*c66ec88fSEmmanuel Vadot  output clock, BWADJ is the PLL bandwidth adjustment parameter. At this moment
73*c66ec88fSEmmanuel Vadot  the binding supports the PLL dividers configuration in accordance with a
74*c66ec88fSEmmanuel Vadot  requested rate, while bypassing and bandwidth adjustment settings can be
75*c66ec88fSEmmanuel Vadot  added in future if it gets to be necessary.
76*c66ec88fSEmmanuel Vadot
77*c66ec88fSEmmanuel Vadot  The PLLs CLKOUT is then either directly connected with the corresponding
78*c66ec88fSEmmanuel Vadot  clocks consumer (like P5600 cores or DDR controller) or passed over a CCU
79*c66ec88fSEmmanuel Vadot  divider to create a signal required for the clock domain.
80*c66ec88fSEmmanuel Vadot
81*c66ec88fSEmmanuel Vadot  The CCU PLL dts-node uses the common clock bindings with no custom
82*c66ec88fSEmmanuel Vadot  parameters. The list of exported clocks can be found in
83*c66ec88fSEmmanuel Vadot  'include/dt-bindings/clock/bt1-ccu.h'. Since CCU PLL is a part of the
84*c66ec88fSEmmanuel Vadot  Baikal-T1 SoC System Controller its DT node is supposed to be a child of
85*c66ec88fSEmmanuel Vadot  later one.
86*c66ec88fSEmmanuel Vadot
87*c66ec88fSEmmanuel Vadotproperties:
88*c66ec88fSEmmanuel Vadot  compatible:
89*c66ec88fSEmmanuel Vadot    const: baikal,bt1-ccu-pll
90*c66ec88fSEmmanuel Vadot
91*c66ec88fSEmmanuel Vadot  reg:
92*c66ec88fSEmmanuel Vadot    maxItems: 1
93*c66ec88fSEmmanuel Vadot
94*c66ec88fSEmmanuel Vadot  "#clock-cells":
95*c66ec88fSEmmanuel Vadot    const: 1
96*c66ec88fSEmmanuel Vadot
97*c66ec88fSEmmanuel Vadot  clocks:
98*c66ec88fSEmmanuel Vadot    description: External reference clock
99*c66ec88fSEmmanuel Vadot    maxItems: 1
100*c66ec88fSEmmanuel Vadot
101*c66ec88fSEmmanuel Vadot  clock-names:
102*c66ec88fSEmmanuel Vadot    const: ref_clk
103*c66ec88fSEmmanuel Vadot
104*c66ec88fSEmmanuel VadotunevaluatedProperties: false
105*c66ec88fSEmmanuel Vadot
106*c66ec88fSEmmanuel Vadotrequired:
107*c66ec88fSEmmanuel Vadot  - compatible
108*c66ec88fSEmmanuel Vadot  - "#clock-cells"
109*c66ec88fSEmmanuel Vadot  - clocks
110*c66ec88fSEmmanuel Vadot  - clock-names
111*c66ec88fSEmmanuel Vadot
112*c66ec88fSEmmanuel Vadotexamples:
113*c66ec88fSEmmanuel Vadot  # Clock Control Unit PLL node:
114*c66ec88fSEmmanuel Vadot  - |
115*c66ec88fSEmmanuel Vadot    clock-controller@1f04d000 {
116*c66ec88fSEmmanuel Vadot      compatible = "baikal,bt1-ccu-pll";
117*c66ec88fSEmmanuel Vadot      reg = <0x1f04d000 0x028>;
118*c66ec88fSEmmanuel Vadot      #clock-cells = <1>;
119*c66ec88fSEmmanuel Vadot
120*c66ec88fSEmmanuel Vadot      clocks = <&clk25m>;
121*c66ec88fSEmmanuel Vadot      clock-names = "ref_clk";
122*c66ec88fSEmmanuel Vadot    };
123*c66ec88fSEmmanuel Vadot  # Required external oscillator:
124*c66ec88fSEmmanuel Vadot  - |
125*c66ec88fSEmmanuel Vadot    clk25m: clock-oscillator-25m {
126*c66ec88fSEmmanuel Vadot      compatible = "fixed-clock";
127*c66ec88fSEmmanuel Vadot      #clock-cells = <0>;
128*c66ec88fSEmmanuel Vadot      clock-frequency  = <25000000>;
129*c66ec88fSEmmanuel Vadot      clock-output-names = "clk25m";
130*c66ec88fSEmmanuel Vadot    };
131*c66ec88fSEmmanuel Vadot...
132