lpc1850-cgu.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. * NXP LPC1850 Clock Generation Unit (CGU)
  2. The CGU generates multiple independent clocks for the core and the
  3. peripheral blocks of the LPC18xx. Each independent clock is called
  4. a base clock and itself is one of the inputs to the two Clock
  5. Control Units (CCUs) which control the branch clocks to the
  6. individual peripherals.
  7. The CGU selects the inputs to the clock generators from multiple
  8. clock sources, controls the clock generation, and routes the outputs
  9. of the clock generators through the clock source bus to the output
  10. stages. Each output stage provides an independent clock source and
  11. corresponds to one of the base clocks for the LPC18xx.
  12. - Above text taken from NXP LPC1850 User Manual.
  13. This binding uses the common clock binding:
  14. Documentation/devicetree/bindings/clock/clock-bindings.txt
  15. Required properties:
  16. - compatible:
  17. Should be "nxp,lpc1850-cgu"
  18. - reg:
  19. Shall define the base and range of the address space
  20. containing clock control registers
  21. - #clock-cells:
  22. Shall have value <1>. The permitted clock-specifier values
  23. are the base clock numbers defined below.
  24. - clocks:
  25. Shall contain a list of phandles for the external input
  26. sources to the CGU. The list shall be in the following
  27. order: xtal, 32khz, enet_rx_clk, enet_tx_clk, gp_clkin.
  28. - clock-indices:
  29. Shall be an ordered list of numbers defining the base clock
  30. number provided by the CGU.
  31. - clock-output-names:
  32. Shall be an ordered list of strings defining the names of
  33. the clocks provided by the CGU.
  34. Which base clocks that are available on the CGU depends on the
  35. specific LPC part. Base clocks are numbered from 0 to 27.
  36. Number: Name: Description:
  37. 0 BASE_SAFE_CLK Base safe clock (always on) for WWDT
  38. 1 BASE_USB0_CLK Base clock for USB0
  39. 2 BASE_PERIPH_CLK Base clock for Cortex-M0SUB subsystem,
  40. SPI, and SGPIO
  41. 3 BASE_USB1_CLK Base clock for USB1
  42. 4 BASE_CPU_CLK System base clock for ARM Cortex-M core
  43. and APB peripheral blocks #0 and #2
  44. 5 BASE_SPIFI_CLK Base clock for SPIFI
  45. 6 BASE_SPI_CLK Base clock for SPI
  46. 7 BASE_PHY_RX_CLK Base clock for Ethernet PHY Receive clock
  47. 8 BASE_PHY_TX_CLK Base clock for Ethernet PHY Transmit clock
  48. 9 BASE_APB1_CLK Base clock for APB peripheral block # 1
  49. 10 BASE_APB3_CLK Base clock for APB peripheral block # 3
  50. 11 BASE_LCD_CLK Base clock for LCD
  51. 12 BASE_ADCHS_CLK Base clock for ADCHS
  52. 13 BASE_SDIO_CLK Base clock for SD/MMC
  53. 14 BASE_SSP0_CLK Base clock for SSP0
  54. 15 BASE_SSP1_CLK Base clock for SSP1
  55. 16 BASE_UART0_CLK Base clock for UART0
  56. 17 BASE_UART1_CLK Base clock for UART1
  57. 18 BASE_UART2_CLK Base clock for UART2
  58. 19 BASE_UART3_CLK Base clock for UART3
  59. 20 BASE_OUT_CLK Base clock for CLKOUT pin
  60. 24-21 - Reserved
  61. 25 BASE_AUDIO_CLK Base clock for audio system (I2S)
  62. 26 BASE_CGU_OUT0_CLK Base clock for CGU_OUT0 clock output
  63. 27 BASE_CGU_OUT1_CLK Base clock for CGU_OUT1 clock output
  64. BASE_PERIPH_CLK and BASE_SPI_CLK is only available on LPC43xx.
  65. BASE_ADCHS_CLK is only available on LPC4370.
  66. Example board file:
  67. / {
  68. clocks {
  69. xtal: xtal {
  70. compatible = "fixed-clock";
  71. #clock-cells = <0>;
  72. clock-frequency = <12000000>;
  73. };
  74. xtal32: xtal32 {
  75. compatible = "fixed-clock";
  76. #clock-cells = <0>;
  77. clock-frequency = <32768>;
  78. };
  79. enet_rx_clk: enet_rx_clk {
  80. compatible = "fixed-clock";
  81. #clock-cells = <0>;
  82. clock-frequency = <0>;
  83. clock-output-names = "enet_rx_clk";
  84. };
  85. enet_tx_clk: enet_tx_clk {
  86. compatible = "fixed-clock";
  87. #clock-cells = <0>;
  88. clock-frequency = <0>;
  89. clock-output-names = "enet_tx_clk";
  90. };
  91. gp_clkin: gp_clkin {
  92. compatible = "fixed-clock";
  93. #clock-cells = <0>;
  94. clock-frequency = <0>;
  95. clock-output-names = "gp_clkin";
  96. };
  97. };
  98. soc {
  99. cgu: clock-controller@40050000 {
  100. compatible = "nxp,lpc1850-cgu";
  101. reg = <0x40050000 0x1000>;
  102. #clock-cells = <1>;
  103. clocks = <&xtal>, <&creg_clk 1>, <&enet_rx_clk>, <&enet_tx_clk>, <&gp_clkin>;
  104. };
  105. /* A CGU and CCU clock consumer */
  106. lcdc: lcdc@40008000 {
  107. ...
  108. clocks = <&cgu BASE_LCD_CLK>, <&ccu1 CLK_CPU_LCD>;
  109. clock-names = "clcdclk", "apb_pclk";
  110. ...
  111. };
  112. };
  113. };