st,stm32h7-rcc.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. STMicroelectronics STM32H7 Reset and Clock Controller
  2. =====================================================
  3. The RCC IP is both a reset and a clock controller.
  4. Please refer to clock-bindings.txt for common clock controller binding usage.
  5. Please also refer to reset.txt for common reset controller binding usage.
  6. Required properties:
  7. - compatible: Should be:
  8. "st,stm32h743-rcc"
  9. - reg: should be register base and length as documented in the
  10. datasheet
  11. - #reset-cells: 1, see below
  12. - #clock-cells : from common clock binding; shall be set to 1
  13. - clocks: External oscillator clock phandle
  14. - high speed external clock signal (HSE)
  15. - low speed external clock signal (LSE)
  16. - external I2S clock (I2S_CKIN)
  17. - st,syscfg: phandle for pwrcfg, mandatory to disable/enable backup domain
  18. write protection (RTC clock).
  19. - pll x node: Allow to register a pll with specific parameters.
  20. Please see PLL section below.
  21. Example:
  22. rcc: rcc@58024400 {
  23. #reset-cells = <1>;
  24. #clock-cells = <2>
  25. compatible = "st,stm32h743-rcc", "st,stm32-rcc";
  26. reg = <0x58024400 0x400>;
  27. clocks = <&clk_hse>, <&clk_lse>, <&clk_i2s_ckin>;
  28. st,syscfg = <&pwrcfg>;
  29. #address-cells = <1>;
  30. #size-cells = <0>;
  31. vco1@58024430 {
  32. #clock-cells = <0>;
  33. compatible = "stm32,pll";
  34. reg = <0>;
  35. };
  36. vco2@58024438 {
  37. #clock-cells = <0>;
  38. compatible = "stm32,pll";
  39. reg = <1>;
  40. st,clock-div = <2>;
  41. st,clock-mult = <40>;
  42. st,frac-status = <0>;
  43. st,frac = <0>;
  44. st,vcosel = <1>;
  45. st,pllrge = <2>;
  46. };
  47. };
  48. STM32H7 PLL
  49. -----------
  50. The VCO of STM32 PLL could be reprensented like this:
  51. Vref --------- --------
  52. ---->| / DIVM |---->| x DIVN | ------> VCO
  53. --------- --------
  54. ^
  55. |
  56. -------
  57. | FRACN |
  58. -------
  59. When the PLL is configured in integer mode:
  60. - VCO = ( Vref / DIVM ) * DIVN
  61. When the PLL is configured in fractional mode:
  62. - VCO = ( Vref / DIVM ) * ( DIVN + FRACN / 2^13)
  63. Required properties for pll node:
  64. - compatible: Should be:
  65. "stm32,pll"
  66. - #clock-cells: from common clock binding; shall be set to 0
  67. - reg: Should be the pll number.
  68. Optional properties:
  69. - st,clock-div: DIVM division factor : <1..63>
  70. - st,clock-mult: DIVN multiplication factor : <4..512>
  71. - st,frac-status:
  72. - 0 Pll is configured in integer mode
  73. - 1 Pll is configure in fractional mode
  74. - st,frac: Fractional part of the multiplication factor : <0..8191>
  75. - st,vcosel: VCO selection
  76. - 0: Wide VCO range:192 to 836 MHz
  77. - 1: Medium VCO range:150 to 420 MHz
  78. - st,pllrge: PLL input frequency range
  79. - 0: The PLL input (Vref / DIVM) clock range frequency is between 1 and 2 MHz
  80. - 1: The PLL input (Vref / DIVM) clock range frequency is between 2 and 4 MHz
  81. - 2: The PLL input (Vref / DIVM) clock range frequency is between 4 and 8 MHz
  82. - 3: The PLL input (Vref / DIVM) clock range frequency is between 8 and 16 MHz
  83. The peripheral clock consumer should specify the desired clock by
  84. having the clock ID in its "clocks" phandle cell.
  85. All available clocks are defined as preprocessor macros in
  86. dt-bindings/clock/stm32h7-clks.h header and can be used in device
  87. tree sources.
  88. Example:
  89. timer5: timer@40000c00 {
  90. compatible = "st,stm32-timer";
  91. reg = <0x40000c00 0x400>;
  92. interrupts = <50>;
  93. clocks = <&rcc TIM5_CK>;
  94. };
  95. Specifying softreset control of devices
  96. =======================================
  97. Device nodes should specify the reset channel required in their "resets"
  98. property, containing a phandle to the reset device node and an index specifying
  99. which channel to use.
  100. The index is the bit number within the RCC registers bank, starting from RCC
  101. base address.
  102. It is calculated as: index = register_offset / 4 * 32 + bit_offset.
  103. Where bit_offset is the bit offset within the register.
  104. For example, for CRC reset:
  105. crc = AHB4RSTR_offset / 4 * 32 + CRCRST_bit_offset = 0x88 / 4 * 32 + 19 = 1107
  106. All available preprocessor macros for reset are defined dt-bindings//mfd/stm32h7-rcc.h
  107. header and can be used in device tree sources.
  108. example:
  109. timer2 {
  110. resets = <&rcc STM32H7_APB1L_RESET(TIM2)>;
  111. };