0031-dt-bindings-clock-Add-StarFive-JH7110-PLL-clock-gene.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. From 07f62b08668c0295b1c6342f9708b7e36093ff59 Mon Sep 17 00:00:00 2001
  2. From: Xingyu Wu <[email protected]>
  3. Date: Tue, 21 Feb 2023 17:13:48 +0800
  4. Subject: [PATCH 031/122] dt-bindings: clock: Add StarFive JH7110 PLL clock
  5. generator
  6. Add bindings for the PLL clock generator on the JH7110 RISC-V SoC.
  7. Reviewed-by: Krzysztof Kozlowski <[email protected]>
  8. Signed-off-by: Xingyu Wu <[email protected]>
  9. ---
  10. .../bindings/clock/starfive,jh7110-pll.yaml | 46 +++++++++++++++++++
  11. .../dt-bindings/clock/starfive,jh7110-crg.h | 6 +++
  12. 2 files changed, 52 insertions(+)
  13. create mode 100644 Documentation/devicetree/bindings/clock/starfive,jh7110-pll.yaml
  14. --- /dev/null
  15. +++ b/Documentation/devicetree/bindings/clock/starfive,jh7110-pll.yaml
  16. @@ -0,0 +1,46 @@
  17. +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
  18. +%YAML 1.2
  19. +---
  20. +$id: http://devicetree.org/schemas/clock/starfive,jh7110-pll.yaml#
  21. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  22. +
  23. +title: StarFive JH7110 PLL Clock Generator
  24. +
  25. +description:
  26. + This PLL are high speed, low jitter frequency synthesizers in JH7110.
  27. + Each PLL clocks work in integer mode or fraction mode by some dividers,
  28. + and the configuration registers and dividers are set in several syscon
  29. + registers. So pll node should be a child of SYS-SYSCON node.
  30. + The formula for calculating frequency is that,
  31. + Fvco = Fref * (NI + NF) / M / Q1
  32. +
  33. +maintainers:
  34. + - Xingyu Wu <[email protected]>
  35. +
  36. +properties:
  37. + compatible:
  38. + const: starfive,jh7110-pll
  39. +
  40. + clocks:
  41. + maxItems: 1
  42. + description: Main Oscillator (24 MHz)
  43. +
  44. + '#clock-cells':
  45. + const: 1
  46. + description:
  47. + See <dt-bindings/clock/starfive,jh7110-crg.h> for valid indices.
  48. +
  49. +required:
  50. + - compatible
  51. + - clocks
  52. + - '#clock-cells'
  53. +
  54. +additionalProperties: false
  55. +
  56. +examples:
  57. + - |
  58. + pll-clock-controller {
  59. + compatible = "starfive,jh7110-pll";
  60. + clocks = <&osc>;
  61. + #clock-cells = <1>;
  62. + };
  63. --- a/include/dt-bindings/clock/starfive,jh7110-crg.h
  64. +++ b/include/dt-bindings/clock/starfive,jh7110-crg.h
  65. @@ -6,6 +6,12 @@
  66. #ifndef __DT_BINDINGS_CLOCK_STARFIVE_JH7110_CRG_H__
  67. #define __DT_BINDINGS_CLOCK_STARFIVE_JH7110_CRG_H__
  68. +/* PLL clocks */
  69. +#define JH7110_CLK_PLL0_OUT 0
  70. +#define JH7110_CLK_PLL1_OUT 1
  71. +#define JH7110_CLK_PLL2_OUT 2
  72. +#define JH7110_PLLCLK_END 3
  73. +
  74. /* SYSCRG clocks */
  75. #define JH7110_SYSCLK_CPU_ROOT 0
  76. #define JH7110_SYSCLK_CPU_CORE 1