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