18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 28c2ecf20Sopenharmony_ci# Copyright (C) 2020 BAIKAL ELECTRONICS, JSC 38c2ecf20Sopenharmony_ci%YAML 1.2 48c2ecf20Sopenharmony_ci--- 58c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/clock/baikal,bt1-ccu-pll.yaml# 68c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml# 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_cititle: Baikal-T1 Clock Control Unit PLL 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_cimaintainers: 118c2ecf20Sopenharmony_ci - Serge Semin <fancer.lancer@gmail.com> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_cidescription: | 148c2ecf20Sopenharmony_ci Clocks Control Unit is the core of Baikal-T1 SoC System Controller 158c2ecf20Sopenharmony_ci responsible for the chip subsystems clocking and resetting. The CCU is 168c2ecf20Sopenharmony_ci connected with an external fixed rate oscillator, which signal is transformed 178c2ecf20Sopenharmony_ci into clocks of various frequencies and then propagated to either individual 188c2ecf20Sopenharmony_ci IP-blocks or to groups of blocks (clock domains). The transformation is done 198c2ecf20Sopenharmony_ci by means of PLLs and gateable/non-gateable dividers embedded into the CCU. 208c2ecf20Sopenharmony_ci It's logically divided into the next components: 218c2ecf20Sopenharmony_ci 1) External oscillator (normally XTAL's 25 MHz crystal oscillator, but 228c2ecf20Sopenharmony_ci in general can provide any frequency supported by the CCU PLLs). 238c2ecf20Sopenharmony_ci 2) PLLs clocks generators (PLLs) - described in this binding file. 248c2ecf20Sopenharmony_ci 3) AXI-bus clock dividers (AXI). 258c2ecf20Sopenharmony_ci 4) System devices reference clock dividers (SYS). 268c2ecf20Sopenharmony_ci which are connected with each other as shown on the next figure: 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci +---------------+ 298c2ecf20Sopenharmony_ci | Baikal-T1 CCU | 308c2ecf20Sopenharmony_ci | +----+------|- MIPS P5600 cores 318c2ecf20Sopenharmony_ci | +-|PLLs|------|- DDR controller 328c2ecf20Sopenharmony_ci | | +----+ | 338c2ecf20Sopenharmony_ci +----+ | | | | | 348c2ecf20Sopenharmony_ci |XTAL|--|-+ | | +---+-| 358c2ecf20Sopenharmony_ci +----+ | | | +-|AXI|-|- AXI-bus 368c2ecf20Sopenharmony_ci | | | +---+-| 378c2ecf20Sopenharmony_ci | | | | 388c2ecf20Sopenharmony_ci | | +----+---+-|- APB-bus 398c2ecf20Sopenharmony_ci | +-------|SYS|-|- Low-speed Devices 408c2ecf20Sopenharmony_ci | +---+-|- High-speed Devices 418c2ecf20Sopenharmony_ci +---------------+ 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci Each CCU sub-block is represented as a separate dts-node and has an 448c2ecf20Sopenharmony_ci individual driver to be bound with. 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci In order to create signals of wide range frequencies the external oscillator 478c2ecf20Sopenharmony_ci output is primarily connected to a set of CCU PLLs. There are five PLLs 488c2ecf20Sopenharmony_ci to create a clock for the MIPS P5600 cores, the embedded DDR controller, 498c2ecf20Sopenharmony_ci SATA, Ethernet and PCIe domains. The last three domains though named by the 508c2ecf20Sopenharmony_ci biggest system interfaces in fact include nearly all of the rest SoC 518c2ecf20Sopenharmony_ci peripherals. Each of the PLLs is based on True Circuits TSMC CLN28HPM core 528c2ecf20Sopenharmony_ci with an interface wrapper (so called safe PLL' clocks switcher) to simplify 538c2ecf20Sopenharmony_ci the PLL configuration procedure. The PLLs work as depicted on the next 548c2ecf20Sopenharmony_ci diagram: 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci +--------------------------+ 578c2ecf20Sopenharmony_ci | | 588c2ecf20Sopenharmony_ci +-->+---+ +---+ +---+ | +---+ 0|\ 598c2ecf20Sopenharmony_ci CLKF--->|/NF|--->|PFD|...|VCO|-+->|/OD|--->| | 608c2ecf20Sopenharmony_ci +---+ +->+---+ +---+ /->+---+ | |--->CLKOUT 618c2ecf20Sopenharmony_ci CLKOD---------C----------------+ 1| | 628c2ecf20Sopenharmony_ci +--------C--------------------------->|/ 638c2ecf20Sopenharmony_ci | | ^ 648c2ecf20Sopenharmony_ci Rclk-+->+---+ | | 658c2ecf20Sopenharmony_ci CLKR--->|/NR|-+ | 668c2ecf20Sopenharmony_ci +---+ | 678c2ecf20Sopenharmony_ci BYPASS--------------------------------------+ 688c2ecf20Sopenharmony_ci BWADJ---> 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci where Rclk is the reference clock coming from XTAL, NR - reference clock 718c2ecf20Sopenharmony_ci divider, NF - PLL clock multiplier, OD - VCO output clock divider, CLKOUT - 728c2ecf20Sopenharmony_ci output clock, BWADJ is the PLL bandwidth adjustment parameter. At this moment 738c2ecf20Sopenharmony_ci the binding supports the PLL dividers configuration in accordance with a 748c2ecf20Sopenharmony_ci requested rate, while bypassing and bandwidth adjustment settings can be 758c2ecf20Sopenharmony_ci added in future if it gets to be necessary. 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci The PLLs CLKOUT is then either directly connected with the corresponding 788c2ecf20Sopenharmony_ci clocks consumer (like P5600 cores or DDR controller) or passed over a CCU 798c2ecf20Sopenharmony_ci divider to create a signal required for the clock domain. 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci The CCU PLL dts-node uses the common clock bindings with no custom 828c2ecf20Sopenharmony_ci parameters. The list of exported clocks can be found in 838c2ecf20Sopenharmony_ci 'include/dt-bindings/clock/bt1-ccu.h'. Since CCU PLL is a part of the 848c2ecf20Sopenharmony_ci Baikal-T1 SoC System Controller its DT node is supposed to be a child of 858c2ecf20Sopenharmony_ci later one. 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ciproperties: 888c2ecf20Sopenharmony_ci compatible: 898c2ecf20Sopenharmony_ci const: baikal,bt1-ccu-pll 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci reg: 928c2ecf20Sopenharmony_ci maxItems: 1 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci "#clock-cells": 958c2ecf20Sopenharmony_ci const: 1 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci clocks: 988c2ecf20Sopenharmony_ci description: External reference clock 998c2ecf20Sopenharmony_ci maxItems: 1 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci clock-names: 1028c2ecf20Sopenharmony_ci const: ref_clk 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ciadditionalProperties: false 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_cirequired: 1078c2ecf20Sopenharmony_ci - compatible 1088c2ecf20Sopenharmony_ci - "#clock-cells" 1098c2ecf20Sopenharmony_ci - clocks 1108c2ecf20Sopenharmony_ci - clock-names 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ciexamples: 1138c2ecf20Sopenharmony_ci # Clock Control Unit PLL node: 1148c2ecf20Sopenharmony_ci - | 1158c2ecf20Sopenharmony_ci clock-controller@1f04d000 { 1168c2ecf20Sopenharmony_ci compatible = "baikal,bt1-ccu-pll"; 1178c2ecf20Sopenharmony_ci reg = <0x1f04d000 0x028>; 1188c2ecf20Sopenharmony_ci #clock-cells = <1>; 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci clocks = <&clk25m>; 1218c2ecf20Sopenharmony_ci clock-names = "ref_clk"; 1228c2ecf20Sopenharmony_ci }; 1238c2ecf20Sopenharmony_ci # Required external oscillator: 1248c2ecf20Sopenharmony_ci - | 1258c2ecf20Sopenharmony_ci clk25m: clock-oscillator-25m { 1268c2ecf20Sopenharmony_ci compatible = "fixed-clock"; 1278c2ecf20Sopenharmony_ci #clock-cells = <0>; 1288c2ecf20Sopenharmony_ci clock-frequency = <25000000>; 1298c2ecf20Sopenharmony_ci clock-output-names = "clk25m"; 1308c2ecf20Sopenharmony_ci }; 1318c2ecf20Sopenharmony_ci... 132