Sascha Hauer | 9b56f4f | 2008-03-26 20:40:42 +0100 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Sascha Hauer | 9b56f4f | 2008-03-26 20:40:42 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
Stefano Babic | 8627111 | 2011-03-14 15:43:56 +0100 | [diff] [blame] | 8 | #ifndef __ASM_ARCH_CLOCK_H |
| 9 | #define __ASM_ARCH_CLOCK_H |
Sascha Hauer | 9b56f4f | 2008-03-26 20:40:42 +0100 | [diff] [blame] | 10 | |
Benoît Thébaudeau | 0dc7b82 | 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 | 9f008bb | 2011-07-13 14:34:52 +0200 | [diff] [blame] | 25 | enum mxc_clock { |
| 26 | MXC_ARM_CLK, |
| 27 | MXC_IPG_CLK, |
Stefano Babic | 67f463b | 2011-08-30 00:51:13 +0000 | [diff] [blame] | 28 | MXC_IPG_PERCLK, |
Stefano Babic | 9f008bb | 2011-07-13 14:34:52 +0200 | [diff] [blame] | 29 | MXC_CSPI_CLK, |
| 30 | MXC_UART_CLK, |
Helmut Raiger | fa47a28 | 2012-01-11 03:59:22 +0000 | [diff] [blame] | 31 | MXC_IPU_CLK, |
| 32 | MXC_ESDHC_CLK, |
Matthias Weisser | e7bed5c | 2012-09-24 02:46:53 +0000 | [diff] [blame] | 33 | MXC_I2C_CLK, |
Stefano Babic | 9f008bb | 2011-07-13 14:34:52 +0200 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | unsigned int mxc_get_clock(enum mxc_clock clk); |
Stefano Babic | d321b64 | 2011-07-28 19:28:13 +0200 | [diff] [blame] | 37 | extern u32 imx_get_uartclk(void); |
Guennadi Liakhovetski | 2ab02fd | 2008-05-08 10:09:27 +0200 | [diff] [blame] | 38 | extern void mx31_gpio_mux(unsigned long mode); |
Stefano Babic | d078b7c | 2010-10-19 20:19:13 +0200 | [diff] [blame] | 39 | extern void mx31_set_pad(enum iomux_pins pin, u32 config); |
Fabio Estevam | 6d0fb3d | 2011-10-20 16:01:29 +0000 | [diff] [blame] | 40 | extern void mx31_set_gpr(enum iomux_gp_func gp, char en); |
Sascha Hauer | 9b56f4f | 2008-03-26 20:40:42 +0100 | [diff] [blame] | 41 | |
Magnus Lilja | dd2f696 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 42 | void mx31_uart1_hw_init(void); |
Helmut Raiger | d121d20 | 2011-10-27 01:31:13 +0000 | [diff] [blame] | 43 | void mx31_uart2_hw_init(void); |
Magnus Lilja | dd2f696 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 44 | void mx31_spi2_hw_init(void); |
| 45 | |
Stefano Babic | 8627111 | 2011-03-14 15:43:56 +0100 | [diff] [blame] | 46 | #endif /* __ASM_ARCH_CLOCK_H */ |