18c2ecf20Sopenharmony_ciSTMicroelectronics STM32H7 Reset and Clock Controller 28c2ecf20Sopenharmony_ci===================================================== 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ciThe RCC IP is both a reset and a clock controller. 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciPlease refer to clock-bindings.txt for common clock controller binding usage. 78c2ecf20Sopenharmony_ciPlease also refer to reset.txt for common reset controller binding usage. 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciRequired properties: 108c2ecf20Sopenharmony_ci- compatible: Should be: 118c2ecf20Sopenharmony_ci "st,stm32h743-rcc" 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci- reg: should be register base and length as documented in the 148c2ecf20Sopenharmony_ci datasheet 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci- #reset-cells: 1, see below 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci- #clock-cells : from common clock binding; shall be set to 1 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci- clocks: External oscillator clock phandle 218c2ecf20Sopenharmony_ci - high speed external clock signal (HSE) 228c2ecf20Sopenharmony_ci - low speed external clock signal (LSE) 238c2ecf20Sopenharmony_ci - external I2S clock (I2S_CKIN) 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ciOptional properties: 268c2ecf20Sopenharmony_ci- st,syscfg: phandle for pwrcfg, mandatory to disable/enable backup domain 278c2ecf20Sopenharmony_ci write protection (RTC clock). 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ciExample: 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci rcc: reset-clock-controller@58024400 { 328c2ecf20Sopenharmony_ci compatible = "st,stm32h743-rcc", "st,stm32-rcc"; 338c2ecf20Sopenharmony_ci reg = <0x58024400 0x400>; 348c2ecf20Sopenharmony_ci #reset-cells = <1>; 358c2ecf20Sopenharmony_ci #clock-cells = <1>; 368c2ecf20Sopenharmony_ci clocks = <&clk_hse>, <&clk_lse>, <&clk_i2s_ckin>; 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci st,syscfg = <&pwrcfg>; 398c2ecf20Sopenharmony_ci}; 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ciThe peripheral clock consumer should specify the desired clock by 428c2ecf20Sopenharmony_cihaving the clock ID in its "clocks" phandle cell. 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ciExample: 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci timer5: timer@40000c00 { 478c2ecf20Sopenharmony_ci compatible = "st,stm32-timer"; 488c2ecf20Sopenharmony_ci reg = <0x40000c00 0x400>; 498c2ecf20Sopenharmony_ci interrupts = <50>; 508c2ecf20Sopenharmony_ci clocks = <&rcc TIM5_CK>; 518c2ecf20Sopenharmony_ci }; 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ciSpecifying softreset control of devices 548c2ecf20Sopenharmony_ci======================================= 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ciDevice nodes should specify the reset channel required in their "resets" 578c2ecf20Sopenharmony_ciproperty, containing a phandle to the reset device node and an index specifying 588c2ecf20Sopenharmony_ciwhich channel to use. 598c2ecf20Sopenharmony_ciThe index is the bit number within the RCC registers bank, starting from RCC 608c2ecf20Sopenharmony_cibase address. 618c2ecf20Sopenharmony_ciIt is calculated as: index = register_offset / 4 * 32 + bit_offset. 628c2ecf20Sopenharmony_ciWhere bit_offset is the bit offset within the register. 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ciFor example, for CRC reset: 658c2ecf20Sopenharmony_ci crc = AHB4RSTR_offset / 4 * 32 + CRCRST_bit_offset = 0x88 / 4 * 32 + 19 = 1107 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ciExample: 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci timer2 { 708c2ecf20Sopenharmony_ci resets = <&rcc STM32H7_APB1L_RESET(TIM2)>; 718c2ecf20Sopenharmony_ci }; 72