Baikal-T1 Clock Control Unit Dividers
Schema identifier ($id): "http://devicetree.org/schemas/clock/baikal,bt1-ccu-div.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Serge Semin <fancer.lancer@gmail.com>"
Clocks Control Unit is the core of Baikal-T1 SoC System Controller
responsible for the chip subsystems clocking and resetting. The CCU is
connected with an external fixed rate oscillator, which signal is transformed
into clocks of various frequencies and then propagated to either individual
IP-blocks or to groups of blocks (clock domains). The transformation is done
by means of an embedded into CCU PLLs and gateable/non-gateable dividers. The
later ones are described in this binding. Each clock domain can be also
individually reset by using the domain clocks divider configuration
registers. Baikal-T1 CCU is logically divided into the next components:
1) External oscillator (normally XTAL's 25 MHz crystal oscillator, but
in general can provide any frequency supported by the CCU PLLs).
2) PLLs clocks generators (PLLs).
3) AXI-bus clock dividers (AXI) - described in this binding file.
4) System devices reference clock dividers (SYS) - described in this binding
file.
which are connected with each other as shown on the next figure:
+---------------+
| Baikal-T1 CCU |
| +----+------|- MIPS P5600 cores
| +-|PLLs|------|- DDR controller
| | +----+ |
+----+ | | | | |
|XTAL|--|-+ | | +---+-|
+----+ | | | +-|AXI|-|- AXI-bus
| | | +---+-|
| | | |
| | +----+---+-|- APB-bus
| +-------|SYS|-|- Low-speed Devices
| +---+-|- High-speed Devices
+---------------+
Each sub-block is represented as a separate DT node and has an individual driver to be bound with.
In order to create signals of wide range frequencies the external oscillator output is primarily connected to a set of CCU PLLs. Some of PLLs CLKOUT are then passed over CCU dividers to create signals required for the target clock domain (like AXI-bus or System Device consumers). The dividers have the following structure:
+--------------+
CLKIN --|->+----+ 1|\ |
SETCLK--|--|/DIV|->| | |
CLKDIV--|--| | | |-|->CLKLOUT
LOCK----|--+----+ | | |
| |/ |
| | |
EN------|-----------+ |
RST-----|--------------|->RSTOUT
+--------------+
where CLKIN is the reference clock coming either from CCU PLLs or from an external clock oscillator, SETCLK - a command to update the output clock in accordance with a set divider, CLKDIV - clocks divider, LOCK - a signal of the output clock stabilization, EN - enable/disable the divider block, RST/RSTOUT - reset clocks domain signal. Depending on the consumer IP-core peculiarities the dividers may lack of some functionality depicted on the figure above (like EN, CLKDIV/LOCK/SETCLK). In this case the corresponding clock provider just doesn't expose either switching functions, or the rate configuration, or both of them.
The clock dividers, which output clock is then consumed by the SoC individual devices, are united into a single clocks provider called System Devices CCU. Similarly the dividers with output clocks utilized as AXI-bus reference clocks are called AXI-bus CCU. Both of them use the common clock bindings with no custom properties. The list of exported clocks and reset signals can be found in the files: 'include/dt-bindings/clock/bt1-ccu.h' and 'include/dt-bindings/reset/bt1-ccu.h'. Since System Devices and AXI-bus CCU are a part of the Baikal-T1 SoC System Controller their DT nodes are supposed to be a children of later one.
Condition (if) #
Properties and child nodes (
properties) #
compatible— not listed as required here #Rule for matching array elements (
contains)Exact value (
const):"baikal,bt1-ccu-axi"
When the condition matches (then) #
Properties and child nodes (
properties) #
clocks— not listed as required here #Array item rules (
items)Item 1
CCU SATA PLL output clock
Item 2
CCU PCIe PLL output clock
Item 3
CCU Ethernet PLL output clock
clock-names— not listed as required here #Array item rules (
items)Item 1
Exact value (
const):"sata_clk"Item 2
Exact value (
const):"pcie_clk"Item 3
Exact value (
const):"eth_clk"
When the condition does not match (else) #
Properties and child nodes (
properties) #
clocks— not listed as required here #Array item rules (
items)Item 1
External reference clock
Item 2
CCU SATA PLL output clock
Item 3
CCU PCIe PLL output clock
Item 4
CCU Ethernet PLL output clock
clock-names— not listed as required here #Array item rules (
items)Item 1
Exact value (
const):"ref_clk"Item 2
Exact value (
const):"sata_clk"Item 3
Exact value (
const):"pcie_clk"Item 4
Exact value (
const):"eth_clk"
Properties and child nodes (properties) #
compatible — required here #
Allowed values (enum): "baikal,bt1-ccu-axi", "baikal,bt1-ccu-sys"
reg — not listed as required here #
Maximum number of items (maxItems): 1
#clock-cells — required here #
Exact value (const): 1
#reset-cells — not listed as required here #
Exact value (const): 1
clocks — required here #
Minimum number of items (minItems): 3
Maximum number of items (maxItems): 4
clock-names — required here #
Minimum number of items (minItems): 3
Maximum number of items (maxItems): 4
Properties not matched by properties or patternProperties in this schema (additionalProperties) #
false
Not allowed by this rule.
Required in this object (required): "compatible", "#clock-cells", "clocks", "clock-names"
Examples (examples) #
#include <dt-bindings/clock/bt1-ccu.h>
clock-controller@1f04d030 {
compatible = "baikal,bt1-ccu-axi";
reg = <0x1f04d030 0x030>;
#clock-cells = <1>;
#reset-cells = <1>;
clocks = <&ccu_pll CCU_SATA_PLL>,
<&ccu_pll CCU_PCIE_PLL>,
<&ccu_pll CCU_ETH_PLL>;
clock-names = "sata_clk", "pcie_clk", "eth_clk";
};
#include <dt-bindings/clock/bt1-ccu.h>
clock-controller@1f04d060 {
compatible = "baikal,bt1-ccu-sys";
reg = <0x1f04d060 0x0a0>;
#clock-cells = <1>;
#reset-cells = <1>;
clocks = <&clk25m>,
<&ccu_pll CCU_SATA_PLL>,
<&ccu_pll CCU_PCIE_PLL>,
<&ccu_pll CCU_ETH_PLL>;
clock-names = "ref_clk", "sata_clk", "pcie_clk",
"eth_clk";
};
ccu_pll: clock-controller@1f04d000 {
compatible = "baikal,bt1-ccu-pll";
reg = <0x1f04d000 0x028>;
#clock-cells = <1>;
clocks = <&clk25m>;
clock-names = "ref_clk";
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
Line 2: Copyright (C) 2020 BAIKAL ELECTRONICS, JSC
Line 154: AXI-bus Clock Control Unit node:
Line 169: System Devices Clock Control Unit node:
Line 186: Required Clock Control Unit PLL node: