Peng Fan | b15705a | 2021-08-07 16:00:35 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
Peng Fan | 690eea1 | 2021-08-07 16:00:45 +0800 | [diff] [blame] | 3 | * Copyright 2021 NXP |
Peng Fan | b15705a | 2021-08-07 16:00:35 +0800 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _ASM_ARCH_IMX8ULP_CLOCK_H |
| 7 | #define _ASM_ARCH_IMX8ULP_CLOCK_H |
| 8 | |
| 9 | /* Mainly for compatible to imx common code. */ |
| 10 | enum mxc_clock { |
| 11 | MXC_ARM_CLK = 0, |
| 12 | MXC_AHB_CLK, |
| 13 | MXC_IPG_CLK, |
| 14 | MXC_UART_CLK, |
| 15 | MXC_CSPI_CLK, |
| 16 | MXC_AXI_CLK, |
| 17 | MXC_DDR_CLK, |
| 18 | MXC_ESDHC_CLK, |
| 19 | MXC_ESDHC2_CLK, |
Peng Fan | 690eea1 | 2021-08-07 16:00:45 +0800 | [diff] [blame] | 20 | MXC_ESDHC3_CLK, |
Peng Fan | b15705a | 2021-08-07 16:00:35 +0800 | [diff] [blame] | 21 | MXC_I2C_CLK, |
| 22 | }; |
| 23 | |
| 24 | u32 mxc_get_clock(enum mxc_clock clk); |
| 25 | u32 get_lpuart_clk(void); |
| 26 | #ifdef CONFIG_SYS_I2C_IMX_LPI2C |
| 27 | int enable_i2c_clk(unsigned char enable, unsigned int i2c_num); |
| 28 | u32 imx_get_i2cclk(unsigned int i2c_num); |
| 29 | #endif |
Peng Fan | 690eea1 | 2021-08-07 16:00:45 +0800 | [diff] [blame] | 30 | void enable_usboh3_clk(unsigned char enable); |
| 31 | int enable_usb_pll(ulong usb_phy_base); |
Peng Fan | b15705a | 2021-08-07 16:00:35 +0800 | [diff] [blame] | 32 | #ifdef CONFIG_MXC_OCOTP |
| 33 | void enable_ocotp_clk(unsigned char enable); |
| 34 | #endif |
| 35 | void init_clk_usdhc(u32 index); |
Peng Fan | 690eea1 | 2021-08-07 16:00:45 +0800 | [diff] [blame] | 36 | void init_clk_fspi(int index); |
| 37 | void init_clk_ddr(void); |
| 38 | int set_ddr_clk(u32 phy_freq_mhz); |
Peng Fan | b15705a | 2021-08-07 16:00:35 +0800 | [diff] [blame] | 39 | void clock_init(void); |
Peng Fan | 690eea1 | 2021-08-07 16:00:45 +0800 | [diff] [blame] | 40 | void cgc1_enet_stamp_sel(u32 clk_src); |
Ye Li | 3d3dfb0 | 2021-10-29 09:46:19 +0800 | [diff] [blame] | 41 | void mxs_set_lcdclk(u32 base_addr, u32 freq_in_khz); |
Ye Li | cb7e375 | 2021-10-29 09:46:27 +0800 | [diff] [blame] | 42 | void reset_lcdclk(void); |
Ye Li | 3d3dfb0 | 2021-10-29 09:46:19 +0800 | [diff] [blame] | 43 | void enable_mipi_dsi_clk(unsigned char enable); |
Alice Guo | 23ee0e1 | 2021-10-29 09:46:29 +0800 | [diff] [blame] | 44 | void enable_adc1_clk(bool enable); |
Peng Fan | b15705a | 2021-08-07 16:00:35 +0800 | [diff] [blame] | 45 | #endif |