blob: b955deb290afad73942265fc69a085760d77f5ee [file] [log] [blame]
Sascha Hauer1a7676f2008-03-26 20:40:42 +01001/*
2 *
3 * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Sascha Hauer1a7676f2008-03-26 20:40:42 +01006 */
7
Stefano Babic78129d92011-03-14 15:43:56 +01008#ifndef __ASM_ARCH_CLOCK_H
9#define __ASM_ARCH_CLOCK_H
Sascha Hauer1a7676f2008-03-26 20:40:42 +010010
Benoît Thébaudeau38e2f082012-08-21 11:06:03 +000011#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 Babic43dc3f02011-07-13 14:34:52 +020025enum mxc_clock {
26 MXC_ARM_CLK,
27 MXC_IPG_CLK,
Stefano Babic2def40f2011-08-30 00:51:13 +000028 MXC_IPG_PERCLK,
Stefano Babic43dc3f02011-07-13 14:34:52 +020029 MXC_CSPI_CLK,
30 MXC_UART_CLK,
Helmut Raiger64c316d2012-01-11 03:59:22 +000031 MXC_IPU_CLK,
32 MXC_ESDHC_CLK,
Matthias Weisser99ba3422012-09-24 02:46:53 +000033 MXC_I2C_CLK,
Stefano Babic43dc3f02011-07-13 14:34:52 +020034};
35
36unsigned int mxc_get_clock(enum mxc_clock clk);
Stefano Babic7f9e79c2011-07-28 19:28:13 +020037extern u32 imx_get_uartclk(void);
Guennadi Liakhovetski08601a62008-05-08 10:09:27 +020038extern void mx31_gpio_mux(unsigned long mode);
Stefano Babic5f09b922010-10-19 20:19:13 +020039extern void mx31_set_pad(enum iomux_pins pin, u32 config);
Fabio Estevam87db8c92011-10-20 16:01:29 +000040extern void mx31_set_gpr(enum iomux_gp_func gp, char en);
Sascha Hauer1a7676f2008-03-26 20:40:42 +010041
Magnus Lilja17635312009-06-13 20:50:03 +020042void mx31_uart1_hw_init(void);
Helmut Raiger1f2850f2011-10-27 01:31:13 +000043void mx31_uart2_hw_init(void);
Magnus Lilja17635312009-06-13 20:50:03 +020044void mx31_spi2_hw_init(void);
45
Stefano Babic78129d92011-03-14 15:43:56 +010046#endif /* __ASM_ARCH_CLOCK_H */