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