blob: ae5db86da206aa8acf1981cd56ef9e059e35b396 [file] [log] [blame]
Magnus Lilja17635312009-06-13 20:50:03 +02001/*
2 *
3 * (C) Copyright 2009 Magnus Lilja <lilja.magnus@gmail.com>
4 *
5 * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
6 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Magnus Lilja17635312009-06-13 20:50:03 +02008 */
9
10#include <common.h>
Stefano Babic78129d92011-03-14 15:43:56 +010011#include <asm/arch/imx-regs.h>
12#include <asm/arch/clock.h>
Magnus Lilja17635312009-06-13 20:50:03 +020013
Magnus Lilja17635312009-06-13 20:50:03 +020014void mx31_uart1_hw_init(void)
15{
16 /* setup pins for UART1 */
17 mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX);
18 mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX);
19 mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
20 mx31_gpio_mux(MUX_CTS1__UART1_CTS_B);
21}
Magnus Lilja17635312009-06-13 20:50:03 +020022
Helmut Raiger1f2850f2011-10-27 01:31:13 +000023void mx31_uart2_hw_init(void)
24{
25 /* setup pins for UART2 */
26 mx31_gpio_mux(MUX_RXD2__UART2_RXD_MUX);
27 mx31_gpio_mux(MUX_TXD2__UART2_TXD_MUX);
28 mx31_gpio_mux(MUX_RTS2__UART2_RTS_B);
29 mx31_gpio_mux(MUX_CTS2__UART2_CTS_B);
30}
Helmut Raiger1f2850f2011-10-27 01:31:13 +000031
Magnus Lilja17635312009-06-13 20:50:03 +020032#ifdef CONFIG_MXC_SPI
Helmut Raiger1f2850f2011-10-27 01:31:13 +000033/*
34 * Note: putting several spi setups here makes no sense as they may differ
35 * at board level (physical pin SS0 of CSPI2 may aswell be used as SS0 of CSPI3)
36 */
Magnus Lilja17635312009-06-13 20:50:03 +020037void mx31_spi2_hw_init(void)
38{
39 /* SPI2 */
40 mx31_gpio_mux(MUX_CSPI2_SS2__CSPI2_SS2_B);
41 mx31_gpio_mux(MUX_CSPI2_SCLK__CSPI2_CLK);
42 mx31_gpio_mux(MUX_CSPI2_SPI_RDY__CSPI2_DATAREADY_B);
43 mx31_gpio_mux(MUX_CSPI2_MOSI__CSPI2_MOSI);
44 mx31_gpio_mux(MUX_CSPI2_MISO__CSPI2_MISO);
45 mx31_gpio_mux(MUX_CSPI2_SS0__CSPI2_SS0_B);
46 mx31_gpio_mux(MUX_CSPI2_SS1__CSPI2_SS1_B);
47
48 /* start SPI2 clock */
49 __REG(CCM_CGR2) = __REG(CCM_CGR2) | (3 << 4);
50}
51#endif