Sascha Hauer | 1a7676f | 2008-03-26 20:40:42 +0100 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> |
| 4 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Sascha Hauer | 1a7676f | 2008-03-26 20:40:42 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
Stefano Babic | 78129d9 | 2011-03-14 15:43:56 +0100 | [diff] [blame] | 8 | #ifndef __ASM_ARCH_CLOCK_H |
| 9 | #define __ASM_ARCH_CLOCK_H |
Sascha Hauer | 1a7676f | 2008-03-26 20:40:42 +0100 | [diff] [blame] | 10 | |
Benoît Thébaudeau | 38e2f08 | 2012-08-21 11:06:03 +0000 | [diff] [blame] | 11 | #include <common.h> |
| 12 | |
| 13 | #ifdef CONFIG_MX31_HCLK_FREQ |
| 14 | #define MXC_HCLK CONFIG_MX31_HCLK_FREQ |
| 15 | #else |
| 16 | #define MXC_HCLK 26000000 |
| 17 | #endif |
| 18 | |
| 19 | #ifdef CONFIG_MX31_CLK32 |
| 20 | #define MXC_CLK32 CONFIG_MX31_CLK32 |
| 21 | #else |
| 22 | #define MXC_CLK32 32768 |
| 23 | #endif |
| 24 | |
Stefano Babic | 43dc3f0 | 2011-07-13 14:34:52 +0200 | [diff] [blame] | 25 | enum mxc_clock { |
| 26 | MXC_ARM_CLK, |
| 27 | MXC_IPG_CLK, |
Stefano Babic | 2def40f | 2011-08-30 00:51:13 +0000 | [diff] [blame] | 28 | MXC_IPG_PERCLK, |
Stefano Babic | 43dc3f0 | 2011-07-13 14:34:52 +0200 | [diff] [blame] | 29 | MXC_CSPI_CLK, |
| 30 | MXC_UART_CLK, |
Helmut Raiger | 64c316d | 2012-01-11 03:59:22 +0000 | [diff] [blame] | 31 | MXC_IPU_CLK, |
| 32 | MXC_ESDHC_CLK, |
Matthias Weisser | 99ba342 | 2012-09-24 02:46:53 +0000 | [diff] [blame] | 33 | MXC_I2C_CLK, |
Stefano Babic | 43dc3f0 | 2011-07-13 14:34:52 +0200 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | unsigned int mxc_get_clock(enum mxc_clock clk); |
Stefano Babic | 7f9e79c | 2011-07-28 19:28:13 +0200 | [diff] [blame] | 37 | extern u32 imx_get_uartclk(void); |
Guennadi Liakhovetski | 08601a6 | 2008-05-08 10:09:27 +0200 | [diff] [blame] | 38 | extern void mx31_gpio_mux(unsigned long mode); |
Stefano Babic | 5f09b92 | 2010-10-19 20:19:13 +0200 | [diff] [blame] | 39 | extern void mx31_set_pad(enum iomux_pins pin, u32 config); |
Fabio Estevam | 87db8c9 | 2011-10-20 16:01:29 +0000 | [diff] [blame] | 40 | extern void mx31_set_gpr(enum iomux_gp_func gp, char en); |
Sascha Hauer | 1a7676f | 2008-03-26 20:40:42 +0100 | [diff] [blame] | 41 | |
Magnus Lilja | 1763531 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 42 | void mx31_uart1_hw_init(void); |
Helmut Raiger | 1f2850f | 2011-10-27 01:31:13 +0000 | [diff] [blame] | 43 | void mx31_uart2_hw_init(void); |
Magnus Lilja | 1763531 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 44 | void mx31_spi2_hw_init(void); |
| 45 | |
Stefano Babic | 78129d9 | 2011-03-14 15:43:56 +0100 | [diff] [blame] | 46 | #endif /* __ASM_ARCH_CLOCK_H */ |