blob: 2946cc19119dd6ff2e0ab066d8a72b4565eaec05 [file] [log] [blame]
Peng Fanb15705a2021-08-07 16:00:35 +08001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
Peng Fan690eea12021-08-07 16:00:45 +08003 * Copyright 2021 NXP
Peng Fanb15705a2021-08-07 16:00:35 +08004 */
5
6#ifndef _ASM_ARCH_IMX8ULP_CLOCK_H
7#define _ASM_ARCH_IMX8ULP_CLOCK_H
8
Peng Fan016e6502022-04-06 14:30:07 +08009#include <asm/arch/pcc.h>
10#include <asm/arch/cgc.h>
11
Peng Fan4cdb3a32022-04-06 14:30:12 +080012#define MHZ(X) ((X) * 1000000UL)
13
Peng Fanb15705a2021-08-07 16:00:35 +080014/* Mainly for compatible to imx common code. */
15enum mxc_clock {
16 MXC_ARM_CLK = 0,
17 MXC_AHB_CLK,
18 MXC_IPG_CLK,
19 MXC_UART_CLK,
20 MXC_CSPI_CLK,
21 MXC_AXI_CLK,
22 MXC_DDR_CLK,
23 MXC_ESDHC_CLK,
24 MXC_ESDHC2_CLK,
Peng Fan690eea12021-08-07 16:00:45 +080025 MXC_ESDHC3_CLK,
Peng Fanb15705a2021-08-07 16:00:35 +080026 MXC_I2C_CLK,
27};
28
29u32 mxc_get_clock(enum mxc_clock clk);
30u32 get_lpuart_clk(void);
31#ifdef CONFIG_SYS_I2C_IMX_LPI2C
32int enable_i2c_clk(unsigned char enable, unsigned int i2c_num);
33u32 imx_get_i2cclk(unsigned int i2c_num);
34#endif
Peng Fan690eea12021-08-07 16:00:45 +080035void enable_usboh3_clk(unsigned char enable);
36int enable_usb_pll(ulong usb_phy_base);
Peng Fanb15705a2021-08-07 16:00:35 +080037#ifdef CONFIG_MXC_OCOTP
38void enable_ocotp_clk(unsigned char enable);
39#endif
40void init_clk_usdhc(u32 index);
Peng Fan690eea12021-08-07 16:00:45 +080041void init_clk_fspi(int index);
42void init_clk_ddr(void);
43int set_ddr_clk(u32 phy_freq_mhz);
Peng Fan4cdb3a32022-04-06 14:30:12 +080044void clock_init_early(void);
45void clock_init_late(void);
Peng Fan690eea12021-08-07 16:00:45 +080046void cgc1_enet_stamp_sel(u32 clk_src);
Ye Li3d3dfb02021-10-29 09:46:19 +080047void mxs_set_lcdclk(u32 base_addr, u32 freq_in_khz);
Ye Licb7e3752021-10-29 09:46:27 +080048void reset_lcdclk(void);
Ye Li3d3dfb02021-10-29 09:46:19 +080049void enable_mipi_dsi_clk(unsigned char enable);
Alice Guo23ee0e12021-10-29 09:46:29 +080050void enable_adc1_clk(bool enable);
Peng Fanb15705a2021-08-07 16:00:35 +080051#endif