st,stm32-rcc.txt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. STMicroelectronics STM32 Reset and Clock Controller
  2. ===================================================
  3. The RCC IP is both a reset and a clock controller. This documentation only
  4. describes the clock part.
  5. Please also refer to clock-bindings.txt in this directory for common clock
  6. controller binding usage.
  7. Required properties:
  8. - compatible: Should be "st,stm32f42xx-rcc"
  9. - reg: should be register base and length as documented in the
  10. datasheet
  11. - #clock-cells: 2, device nodes should specify the clock in their "clocks"
  12. property, containing a phandle to the clock device node, an index selecting
  13. between gated clocks and other clocks and an index specifying the clock to
  14. use.
  15. Example:
  16. rcc: rcc@40023800 {
  17. #clock-cells = <2>
  18. compatible = "st,stm32f42xx-rcc", "st,stm32-rcc";
  19. reg = <0x40023800 0x400>;
  20. };
  21. Specifying gated clocks
  22. =======================
  23. The primary index must be set to 0.
  24. The secondary index is the bit number within the RCC register bank, starting
  25. from the first RCC clock enable register (RCC_AHB1ENR, address offset 0x30).
  26. It is calculated as: index = register_offset / 4 * 32 + bit_offset.
  27. Where bit_offset is the bit offset within the register (LSB is 0, MSB is 31).
  28. Example:
  29. /* Gated clock, AHB1 bit 0 (GPIOA) */
  30. ... {
  31. clocks = <&rcc 0 0>
  32. };
  33. /* Gated clock, AHB2 bit 4 (CRYP) */
  34. ... {
  35. clocks = <&rcc 0 36>
  36. };
  37. Specifying other clocks
  38. =======================
  39. The primary index must be set to 1.
  40. The secondary index is bound with the following magic numbers:
  41. 0 SYSTICK
  42. 1 FCLK
  43. Example:
  44. /* Misc clock, FCLK */
  45. ... {
  46. clocks = <&rcc 1 1>
  47. };