3 * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef __ASM_ARCH_CLOCK_H
9 #define __ASM_ARCH_CLOCK_H
13 #ifdef CONFIG_SYS_MX5_HCLK
14 #define MXC_HCLK CONFIG_SYS_MX5_HCLK
16 #define MXC_HCLK 24000000
19 #ifdef CONFIG_SYS_MX5_CLK32
20 #define MXC_CLK32 CONFIG_SYS_MX5_CLK32
22 #define MXC_CLK32 32768
51 /* Source clock this clk depends on */
53 /* Secondary clock to enable/disable with this clock */
54 struct clk *secondary;
55 /* Current clock rate */
57 /* Reference count of clock enable/disable */
59 /* Register bit position for clock's enable/disable control. */
61 /* Register address for clock's enable/disable control. */
65 * Function ptr to recalculate the clock's rate based on parent
68 void (*recalc) (struct clk *);
70 * Function ptr to set the clock to a new rate. The rate must match a
71 * supported rate returned from round_rate. Leave blank if clock is not
74 int (*set_rate) (struct clk *, unsigned long);
76 * Function ptr to round the requested clock rate to the nearest
77 * supported rate that is less than or equal to the requested rate.
79 unsigned long (*round_rate) (struct clk *, unsigned long);
81 * Function ptr to enable the clock. Leave blank if clock can not
84 int (*enable) (struct clk *);
86 * Function ptr to disable the clock. Leave blank if clock can not
89 void (*disable) (struct clk *);
90 /* Function ptr to set the parent clock of the clock. */
91 int (*set_parent) (struct clk *, struct clk *);
94 u32 imx_get_uartclk(void);
95 u32 imx_get_fecclk(void);
96 unsigned int mxc_get_clock(enum mxc_clock clk);
97 int mxc_set_clock(u32 ref, u32 freq, enum mxc_clock clk);
98 int adjust_core_voltage(u32 freq);
99 void set_usb_phy_clk(void);
100 void enable_usb_phy1_clk(bool enable);
101 void enable_usb_phy2_clk(bool enable);
102 void set_usboh3_clk(void);
103 void enable_usboh3_clk(bool enable);
104 void mxc_set_sata_internal_clock(void);
105 int enable_i2c_clk(unsigned char enable, unsigned i2c_num);
106 void enable_nfc_clk(unsigned char enable);
107 void enable_efuse_prog_supply(bool enable);
108 void ipu_clk_enable(void);
109 void ipu_clk_disable(void);
110 void ipu_di_clk_enable(int di);
111 void ipu_di_clk_disable(int di);
113 void ldb_clk_enable(int ldb);
114 void ldb_clk_disable(int ldb);
116 static inline void ldb_clk_enable(int ldb)
119 static inline void ldb_clk_disable(int ldb)
122 #endif /* CONFIG_MX53 */
124 #endif /* __ASM_ARCH_CLOCK_H */