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