186271115SStefano Babic /* 286271115SStefano Babic * 386271115SStefano Babic * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> 486271115SStefano Babic * 586271115SStefano Babic * See file CREDITS for list of people who contributed to this 686271115SStefano Babic * project. 786271115SStefano Babic * 886271115SStefano Babic * This program is free software; you can redistribute it and/or 986271115SStefano Babic * modify it under the terms of the GNU General Public License as 1086271115SStefano Babic * published by the Free Software Foundation; either version 2 of 1186271115SStefano Babic * the License, or (at your option) any later version. 1286271115SStefano Babic * 1386271115SStefano Babic * This program is distributed in the hope that it will be useful, 1486271115SStefano Babic * but WITHOUT ANY WARRANTY; without even the implied warranty of 1586271115SStefano Babic * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1686271115SStefano Babic * GNU General Public License for more details. 1786271115SStefano Babic * 1886271115SStefano Babic * You should have received a copy of the GNU General Public License 1986271115SStefano Babic * along with this program; if not, write to the Free Software 2086271115SStefano Babic * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 2186271115SStefano Babic * MA 02111-1307 USA 2286271115SStefano Babic */ 2386271115SStefano Babic 2486271115SStefano Babic #ifndef __ASM_ARCH_CLOCK_H 2586271115SStefano Babic #define __ASM_ARCH_CLOCK_H 2686271115SStefano Babic 270dc7b82eSBenoît Thébaudeau #include <common.h> 280dc7b82eSBenoît Thébaudeau 290dc7b82eSBenoît Thébaudeau #ifdef CONFIG_MX31_HCLK_FREQ 300dc7b82eSBenoît Thébaudeau #define MXC_HCLK CONFIG_MX31_HCLK_FREQ 310dc7b82eSBenoît Thébaudeau #else 320dc7b82eSBenoît Thébaudeau #define MXC_HCLK 26000000 330dc7b82eSBenoît Thébaudeau #endif 340dc7b82eSBenoît Thébaudeau 350dc7b82eSBenoît Thébaudeau #ifdef CONFIG_MX31_CLK32 360dc7b82eSBenoît Thébaudeau #define MXC_CLK32 CONFIG_MX31_CLK32 370dc7b82eSBenoît Thébaudeau #else 380dc7b82eSBenoît Thébaudeau #define MXC_CLK32 32768 390dc7b82eSBenoît Thébaudeau #endif 400dc7b82eSBenoît Thébaudeau 419f008bb4SStefano Babic enum mxc_clock { 429f008bb4SStefano Babic MXC_ARM_CLK, 439f008bb4SStefano Babic MXC_IPG_CLK, 4467f463b0SStefano Babic MXC_IPG_PERCLK, 459f008bb4SStefano Babic MXC_CSPI_CLK, 469f008bb4SStefano Babic MXC_UART_CLK, 47fa47a286SHelmut Raiger MXC_IPU_CLK, 48fa47a286SHelmut Raiger MXC_ESDHC_CLK, 49*e7bed5c2SMatthias Weisser MXC_I2C_CLK, 509f008bb4SStefano Babic }; 519f008bb4SStefano Babic 529f008bb4SStefano Babic unsigned int mxc_get_clock(enum mxc_clock clk); 53d321b64dSStefano Babic extern u32 imx_get_uartclk(void); 5486271115SStefano Babic extern void mx31_gpio_mux(unsigned long mode); 5586271115SStefano Babic extern void mx31_set_pad(enum iomux_pins pin, u32 config); 566d0fb3dbSFabio Estevam extern void mx31_set_gpr(enum iomux_gp_func gp, char en); 5786271115SStefano Babic 5886271115SStefano Babic void mx31_uart1_hw_init(void); 59d121d201SHelmut Raiger void mx31_uart2_hw_init(void); 6086271115SStefano Babic void mx31_spi2_hw_init(void); 61d109b11eSStefano Babic void mxc_hw_watchdog_enable(void); 62bdb3c203SStefano Babic void mxc_hw_watchdog_reset(void); 6386271115SStefano Babic 6486271115SStefano Babic #endif /* __ASM_ARCH_CLOCK_H */ 65