xref: /rk3399_rockchip-uboot/arch/arm/include/asm/arch-mx6/clock.h (revision 833b6435de3e8cf5b06ba81cb1b2b50e044269ff)
123608e23SJason Liu /*
223608e23SJason Liu  * (C) Copyright 2009
323608e23SJason Liu  * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
423608e23SJason Liu  *
523608e23SJason Liu  * See file CREDITS for list of people who contributed to this
623608e23SJason Liu  * project.
723608e23SJason Liu  *
823608e23SJason Liu  * This program is free software; you can redistribute it and/or
923608e23SJason Liu  * modify it under the terms of the GNU General Public License as
1023608e23SJason Liu  * published by the Free Software Foundation; either version 2 of
1123608e23SJason Liu  * the License, or (at your option) any later version.
1223608e23SJason Liu  *
1323608e23SJason Liu  * This program is distributed in the hope that it will be useful,
1423608e23SJason Liu  * but WITHOUT ANY WARRANTY; without even the implied warranty of
1523608e23SJason Liu  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1623608e23SJason Liu  * GNU General Public License for more details.
1723608e23SJason Liu  *
1823608e23SJason Liu  * You should have received a copy of the GNU General Public License
1923608e23SJason Liu  * along with this program; if not, write to the Free Software
2023608e23SJason Liu  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2123608e23SJason Liu  * MA 02111-1307 USA
2223608e23SJason Liu  */
2323608e23SJason Liu 
2423608e23SJason Liu #ifndef __ASM_ARCH_CLOCK_H
2523608e23SJason Liu #define __ASM_ARCH_CLOCK_H
2623608e23SJason Liu 
27*833b6435SBenoît Thébaudeau #include <common.h>
28*833b6435SBenoît Thébaudeau 
29*833b6435SBenoît Thébaudeau #ifdef CONFIG_SYS_MX6_HCLK
30*833b6435SBenoît Thébaudeau #define MXC_HCLK	CONFIG_SYS_MX6_HCLK
31*833b6435SBenoît Thébaudeau #else
32*833b6435SBenoît Thébaudeau #define MXC_HCLK	24000000
33*833b6435SBenoît Thébaudeau #endif
34*833b6435SBenoît Thébaudeau 
35*833b6435SBenoît Thébaudeau #ifdef CONFIG_SYS_MX6_CLK32
36*833b6435SBenoît Thébaudeau #define MXC_CLK32	CONFIG_SYS_MX6_CLK32
37*833b6435SBenoît Thébaudeau #else
38*833b6435SBenoît Thébaudeau #define MXC_CLK32	32768
39*833b6435SBenoît Thébaudeau #endif
40*833b6435SBenoît Thébaudeau 
4123608e23SJason Liu enum mxc_clock {
4223608e23SJason Liu 	MXC_ARM_CLK = 0,
4323608e23SJason Liu 	MXC_PER_CLK,
4423608e23SJason Liu 	MXC_AHB_CLK,
4523608e23SJason Liu 	MXC_IPG_CLK,
4623608e23SJason Liu 	MXC_IPG_PERCLK,
4723608e23SJason Liu 	MXC_UART_CLK,
4823608e23SJason Liu 	MXC_CSPI_CLK,
4923608e23SJason Liu 	MXC_AXI_CLK,
5023608e23SJason Liu 	MXC_EMI_SLOW_CLK,
5123608e23SJason Liu 	MXC_DDR_CLK,
5223608e23SJason Liu 	MXC_ESDHC_CLK,
5323608e23SJason Liu 	MXC_ESDHC2_CLK,
5423608e23SJason Liu 	MXC_ESDHC3_CLK,
5523608e23SJason Liu 	MXC_ESDHC4_CLK,
5623608e23SJason Liu 	MXC_SATA_CLK,
5723608e23SJason Liu 	MXC_NFC_CLK,
58e7bed5c2SMatthias Weisser 	MXC_I2C_CLK,
5923608e23SJason Liu };
6023608e23SJason Liu 
6123608e23SJason Liu u32 imx_get_uartclk(void);
6223608e23SJason Liu u32 imx_get_fecclk(void);
6323608e23SJason Liu unsigned int mxc_get_clock(enum mxc_clock clk);
643f467529SWolfgang Grandegger void enable_usboh3_clk(unsigned char enable);
6564e7cdb5SEric Nelson int enable_sata_clock(void);
66cc54a0f7STroy Kisky int enable_i2c_clk(unsigned char enable, unsigned i2c_num);
6723608e23SJason Liu 
6823608e23SJason Liu #endif /* __ASM_ARCH_CLOCK_H */
69