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