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