xref: /openbmc/u-boot/arch/arm/include/asm/arch-mxs/clock.h (revision 95ae700044ee54c01ae7c5e52cd4a28f1aed4533)
13a0398d7SOtavio Salvador /*
200239977SOtavio Salvador  * Freescale i.MX23/i.MX28 Clock
33a0398d7SOtavio Salvador  *
43a0398d7SOtavio Salvador  * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
53a0398d7SOtavio Salvador  * on behalf of DENX Software Engineering GmbH
63a0398d7SOtavio Salvador  *
71a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
83a0398d7SOtavio Salvador  */
93a0398d7SOtavio Salvador 
103a0398d7SOtavio Salvador #ifndef __CLOCK_H__
113a0398d7SOtavio Salvador #define __CLOCK_H__
123a0398d7SOtavio Salvador 
133a0398d7SOtavio Salvador enum mxc_clock {
143a0398d7SOtavio Salvador 	MXC_ARM_CLK = 0,
153a0398d7SOtavio Salvador 	MXC_AHB_CLK,
163a0398d7SOtavio Salvador 	MXC_IPG_CLK,
173a0398d7SOtavio Salvador 	MXC_EMI_CLK,
183a0398d7SOtavio Salvador 	MXC_GPMI_CLK,
193a0398d7SOtavio Salvador 	MXC_IO0_CLK,
203a0398d7SOtavio Salvador 	MXC_IO1_CLK,
2100239977SOtavio Salvador 	MXC_XTAL_CLK,
223a0398d7SOtavio Salvador 	MXC_SSP0_CLK,
2300239977SOtavio Salvador #ifdef CONFIG_MX28
243a0398d7SOtavio Salvador 	MXC_SSP1_CLK,
253a0398d7SOtavio Salvador 	MXC_SSP2_CLK,
263a0398d7SOtavio Salvador 	MXC_SSP3_CLK,
2700239977SOtavio Salvador #endif
283a0398d7SOtavio Salvador };
293a0398d7SOtavio Salvador 
303a0398d7SOtavio Salvador enum mxs_ioclock {
313a0398d7SOtavio Salvador 	MXC_IOCLK0 = 0,
323a0398d7SOtavio Salvador 	MXC_IOCLK1,
333a0398d7SOtavio Salvador };
343a0398d7SOtavio Salvador 
353a0398d7SOtavio Salvador enum mxs_sspclock {
363a0398d7SOtavio Salvador 	MXC_SSPCLK0 = 0,
3700239977SOtavio Salvador #ifdef CONFIG_MX28
383a0398d7SOtavio Salvador 	MXC_SSPCLK1,
393a0398d7SOtavio Salvador 	MXC_SSPCLK2,
403a0398d7SOtavio Salvador 	MXC_SSPCLK3,
4100239977SOtavio Salvador #endif
423a0398d7SOtavio Salvador };
433a0398d7SOtavio Salvador 
443a0398d7SOtavio Salvador uint32_t mxc_get_clock(enum mxc_clock clk);
453a0398d7SOtavio Salvador 
46bf48fcb6SOtavio Salvador void mxs_set_ioclk(enum mxs_ioclock io, uint32_t freq);
47bf48fcb6SOtavio Salvador void mxs_set_sspclk(enum mxs_sspclock ssp, uint32_t freq, int xtal);
48bf48fcb6SOtavio Salvador void mxs_set_ssp_busclock(unsigned int bus, uint32_t freq);
49*95ae7000SPeng Fan void mxs_set_lcdclk(uint32_t __maybe_unused lcd_base, uint32_t freq);
503a0398d7SOtavio Salvador 
513a0398d7SOtavio Salvador /* Compatibility with the FEC Ethernet driver */
523a0398d7SOtavio Salvador #define	imx_get_fecclk()	mxc_get_clock(MXC_AHB_CLK)
533a0398d7SOtavio Salvador 
543a0398d7SOtavio Salvador #endif	/* __CLOCK_H__ */
55