1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */ 23a0398d7SOtavio Salvador /* 300239977SOtavio Salvador * Freescale i.MX23/i.MX28 Clock 43a0398d7SOtavio Salvador * 53a0398d7SOtavio Salvador * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com> 63a0398d7SOtavio Salvador * on behalf of DENX Software Engineering GmbH 73a0398d7SOtavio Salvador */ 83a0398d7SOtavio Salvador 93a0398d7SOtavio Salvador #ifndef __CLOCK_H__ 103a0398d7SOtavio Salvador #define __CLOCK_H__ 113a0398d7SOtavio Salvador 123a0398d7SOtavio Salvador enum mxc_clock { 133a0398d7SOtavio Salvador MXC_ARM_CLK = 0, 143a0398d7SOtavio Salvador MXC_AHB_CLK, 153a0398d7SOtavio Salvador MXC_IPG_CLK, 163a0398d7SOtavio Salvador MXC_EMI_CLK, 173a0398d7SOtavio Salvador MXC_GPMI_CLK, 183a0398d7SOtavio Salvador MXC_IO0_CLK, 193a0398d7SOtavio Salvador MXC_IO1_CLK, 2000239977SOtavio Salvador MXC_XTAL_CLK, 213a0398d7SOtavio Salvador MXC_SSP0_CLK, 2200239977SOtavio Salvador #ifdef CONFIG_MX28 233a0398d7SOtavio Salvador MXC_SSP1_CLK, 243a0398d7SOtavio Salvador MXC_SSP2_CLK, 253a0398d7SOtavio Salvador MXC_SSP3_CLK, 2600239977SOtavio Salvador #endif 273a0398d7SOtavio Salvador }; 283a0398d7SOtavio Salvador 293a0398d7SOtavio Salvador enum mxs_ioclock { 303a0398d7SOtavio Salvador MXC_IOCLK0 = 0, 313a0398d7SOtavio Salvador MXC_IOCLK1, 323a0398d7SOtavio Salvador }; 333a0398d7SOtavio Salvador 343a0398d7SOtavio Salvador enum mxs_sspclock { 353a0398d7SOtavio Salvador MXC_SSPCLK0 = 0, 3600239977SOtavio Salvador #ifdef CONFIG_MX28 373a0398d7SOtavio Salvador MXC_SSPCLK1, 383a0398d7SOtavio Salvador MXC_SSPCLK2, 393a0398d7SOtavio Salvador MXC_SSPCLK3, 4000239977SOtavio Salvador #endif 413a0398d7SOtavio Salvador }; 423a0398d7SOtavio Salvador 433a0398d7SOtavio Salvador uint32_t mxc_get_clock(enum mxc_clock clk); 443a0398d7SOtavio Salvador 45bf48fcb6SOtavio Salvador void mxs_set_ioclk(enum mxs_ioclock io, uint32_t freq); 46bf48fcb6SOtavio Salvador void mxs_set_sspclk(enum mxs_sspclock ssp, uint32_t freq, int xtal); 47bf48fcb6SOtavio Salvador void mxs_set_ssp_busclock(unsigned int bus, uint32_t freq); 4895ae7000SPeng Fan void mxs_set_lcdclk(uint32_t __maybe_unused lcd_base, uint32_t freq); 493a0398d7SOtavio Salvador 503a0398d7SOtavio Salvador /* Compatibility with the FEC Ethernet driver */ 513a0398d7SOtavio Salvador #define imx_get_fecclk() mxc_get_clock(MXC_AHB_CLK) 523a0398d7SOtavio Salvador 533a0398d7SOtavio Salvador #endif /* __CLOCK_H__ */ 54