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
48 /* Source clock this clk depends on */
50 /* Secondary clock to enable/disable with this clock */
51 struct clk *secondary;
52 /* Current clock rate */
54 /* Reference count of clock enable/disable */
56 /* Register bit position for clock's enable/disable control. */
58 /* Register address for clock's enable/disable control. */
62 * Function ptr to recalculate the clock's rate based on parent
65 void (*recalc) (struct clk *);
67 * Function ptr to set the clock to a new rate. The rate must match a
68 * supported rate returned from round_rate. Leave blank if clock is not
71 int (*set_rate) (struct clk *, unsigned long);
73 * Function ptr to round the requested clock rate to the nearest
74 * supported rate that is less than or equal to the requested rate.
76 unsigned long (*round_rate) (struct clk *, unsigned long);
78 * Function ptr to enable the clock. Leave blank if clock can not
81 int (*enable) (struct clk *);
83 * Function ptr to disable the clock. Leave blank if clock can not
86 void (*disable) (struct clk *);
87 /* Function ptr to set the parent clock of the clock. */
88 int (*set_parent) (struct clk *, struct clk *);
91 u32 imx_get_uartclk(void);
92 u32 imx_get_fecclk(void);
93 unsigned int mxc_get_clock(enum mxc_clock clk);
94 int mxc_set_clock(u32 ref, u32 freq, enum mxc_clock clk);
95 void set_usb_phy_clk(void);
96 void enable_usb_phy1_clk(unsigned char enable);
97 void enable_usb_phy2_clk(unsigned char enable);
98 void set_usboh3_clk(void);
99 void enable_usboh3_clk(unsigned char enable);
100 void mxc_set_sata_internal_clock(void);
101 int enable_i2c_clk(unsigned char enable, unsigned i2c_num);
102 void enable_nfc_clk(unsigned char enable);
103 void ipu_clk_enable(void);
104 void ipu_clk_disable(void);
106 #endif /* __ASM_ARCH_CLOCK_H */