blob: 87ca303e31ba8c53c6dc0ddd053ba89385c0f6f0 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Magnus Lilja17635312009-06-13 20:50:03 +02002/*
3 *
4 * (C) Copyright 2009 Magnus Lilja <lilja.magnus@gmail.com>
5 *
6 * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
Magnus Lilja17635312009-06-13 20:50:03 +02007 */
8
Stefano Babic78129d92011-03-14 15:43:56 +01009#include <asm/arch/imx-regs.h>
10#include <asm/arch/clock.h>
Magnus Lilja17635312009-06-13 20:50:03 +020011
Magnus Lilja17635312009-06-13 20:50:03 +020012void mx31_uart1_hw_init(void)
13{
14 /* setup pins for UART1 */
15 mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX);
16 mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX);
17 mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
18 mx31_gpio_mux(MUX_CTS1__UART1_CTS_B);
19}
Magnus Lilja17635312009-06-13 20:50:03 +020020
Helmut Raiger1f2850f2011-10-27 01:31:13 +000021void mx31_uart2_hw_init(void)
22{
23 /* setup pins for UART2 */
24 mx31_gpio_mux(MUX_RXD2__UART2_RXD_MUX);
25 mx31_gpio_mux(MUX_TXD2__UART2_TXD_MUX);
26 mx31_gpio_mux(MUX_RTS2__UART2_RTS_B);
27 mx31_gpio_mux(MUX_CTS2__UART2_CTS_B);
28}
Helmut Raiger1f2850f2011-10-27 01:31:13 +000029
Magnus Lilja17635312009-06-13 20:50:03 +020030#ifdef CONFIG_MXC_SPI
Helmut Raiger1f2850f2011-10-27 01:31:13 +000031/*
32 * Note: putting several spi setups here makes no sense as they may differ
33 * at board level (physical pin SS0 of CSPI2 may aswell be used as SS0 of CSPI3)
34 */
Magnus Lilja17635312009-06-13 20:50:03 +020035void mx31_spi2_hw_init(void)
36{
37 /* SPI2 */
38 mx31_gpio_mux(MUX_CSPI2_SS2__CSPI2_SS2_B);
39 mx31_gpio_mux(MUX_CSPI2_SCLK__CSPI2_CLK);
40 mx31_gpio_mux(MUX_CSPI2_SPI_RDY__CSPI2_DATAREADY_B);
41 mx31_gpio_mux(MUX_CSPI2_MOSI__CSPI2_MOSI);
42 mx31_gpio_mux(MUX_CSPI2_MISO__CSPI2_MISO);
43 mx31_gpio_mux(MUX_CSPI2_SS0__CSPI2_SS0_B);
44 mx31_gpio_mux(MUX_CSPI2_SS1__CSPI2_SS1_B);
45
46 /* start SPI2 clock */
47 __REG(CCM_CGR2) = __REG(CCM_CGR2) | (3 << 4);
48}
49#endif