1 STMicroelectronics STM32MP1 clock tree initialization
2 =====================================================
4 The STM32MP clock tree initialization is based on device tree information
5 for RCC IP and on fixed clocks.
7 -------------------------------
8 RCC CLOCK = st,stm32mp1-rcc-clk
9 -------------------------------
11 The RCC IP is both a reset and a clock controller but this documentation only
12 describes the fields added for clock tree initialization which are not present
15 Please refer to ../mfd/st,stm32-rcc.txt for all the other properties common
20 - compatible: Should be "st,stm32mp1-rcc-clk"
22 - st,clksrc : The clock source in this order
24 for STM32MP15x: 9 clock sources are requested
25 MPU AXI MCU PLL12 PLL3 PLL4 RTC MCO1 MCO2
27 with value equals to RCC clock specifier as defined in
28 dt-bindings/clock/stm32mp1-clksrc.h: CLK_<NAME>_<SOURCE>
30 - st,clkdiv : The div parameters in this order
31 for STM32MP15x: 11 dividers value are requested
32 MPU AXI MCU APB1 APB2 APB3 APB4 APB5 RTC MCO1 MCO2
34 with DIV coding defined in RCC associated register RCC_xxxDIVR
43 but for RTC MCO1 MCO2, the coding is different:
52 PLL children node for PLL1 to PLL4 : (see ref manual for details)
53 with associated index 0 to 3 (st,pll@0 to st,pll@4)
54 PLLx is off when the associated node is absent
58 - cfg: The parameters for PLL configuration in this order:
59 DIVM DIVN DIVP DIVQ DIVR Output
61 with DIV value as defined in RCC spec:
62 0x0: bypass (division by 1)
68 and Output = bitfield for each output value = 1:ON/0:OFF
69 BIT(0) => output P : DIVPEN
70 BIT(1) => output Q : DIVQEN
71 BIT(2) => output R : DIVREN
72 NB : macro PQR(p,q,r) can be used to build this value
75 - frac : Fractional part of the multiplication factor
76 (optional, PLL is in integer mode when absent)
78 - csg : Clock Spreading Generator (optional)
79 with parameters in this order:
80 MOD_PER INC_STEP SSCG_MODE
82 * MOD_PER: Modulation Period Adjustment
83 * INC_STEP: Modulation Depth Adjustment
84 * SSCG_MODE: Spread spectrum clock generator mode
85 you can use associated defines from stm32mp1-clksrc.h
86 * SSCG_MODE_CENTER_SPREAD = 0
87 * SSCG_MODE_DOWN_SPREAD = 1
90 - st,pkcs : used to configure the peripherals kernel clock selection
91 containing a list of peripheral kernel clock source identifier as defined
92 in the file dt-bindings/clock/stm32mp1-clksrc.h
97 compatible = "syscon", "simple-mfd";
99 reg = <0x50000000 0x1000>;
101 rcc_clk: rcc-clk@50000000 {
103 compatible = "st,stm32mp1-rcc-clk";
105 st,clksrc = < CLK_MPU_PLL1P
131 cfg = < 1 53 0 0 0 1 >;
135 cfg = < 1 43 1 0 0 PQR(0,1,1) >;
139 cfg = < 2 85 3 13 3 0 >;
140 csg = < 10 20 SSCG_MODE_CENTER_SPREAD >;
143 cfg = < 2 78 4 7 9 3 >;
154 --------------------------
155 other clocks = fixed-clock
156 --------------------------
157 The clock tree is also based on 5 fixed-clock in clocks node
158 used to define the state of associated ST32MP1 oscillators:
165 At boot the clock tree initialization will
166 - enable the oscillator present in device tree
167 - disable HSI oscillator if the node is absent (always activated by bootrom)
169 Optional properties :
171 a) for external oscillator: "clk-lse", "clk-hse"
173 4 optional fields are managed
174 - "st,bypass" Configure the oscillator bypass mode (HSEBYP, LSEBYP)
175 - "st,digbypass" Configure the bypass mode as full-swing digital signal
177 - "st,css" Activate the clock security system (HSECSSON, LSECSSON)
178 - "st,drive" (only for LSE) value of the drive for the oscillator
179 (see LSEDRV_ define in the file dt-bindings/clock/stm32mp1-clksrc.h)
187 compatible = "fixed-clock";
188 clock-frequency = <64000000>;
194 compatible = "fixed-clock";
195 clock-frequency = <32768>;
197 st,drive = <LSEDRV_LOWEST>;
201 b) for internal oscillator: "clk-hsi"
203 internally HSI clock is fixed to 64MHz for STM32MP157 soc
204 in device tree clk-hsi is the clock after HSIDIV (ck_hsi in RCC doc)
205 So this clock frequency is used to compute the expected HSI_DIV
206 for the clock tree initialisation
214 compatible = "fixed-clock";
215 clock-frequency = <64000000>;
225 compatible = "fixed-clock";
226 clock-frequency = <32000000>;