Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Magnus Lilja | 1763531 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 2 | /* |
| 3 | * |
| 4 | * (C) Copyright 2009 Magnus Lilja <lilja.magnus@gmail.com> |
| 5 | * |
| 6 | * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de> |
Magnus Lilja | 1763531 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 7 | */ |
| 8 | |
Tom Rini | abb9a04 | 2024-05-18 20:20:43 -0600 | [diff] [blame^] | 9 | #include <common.h> |
Stefano Babic | 78129d9 | 2011-03-14 15:43:56 +0100 | [diff] [blame] | 10 | #include <asm/arch/imx-regs.h> |
| 11 | #include <asm/arch/clock.h> |
Magnus Lilja | 1763531 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 12 | |
Magnus Lilja | 1763531 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 13 | void mx31_uart1_hw_init(void) |
| 14 | { |
| 15 | /* setup pins for UART1 */ |
| 16 | mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX); |
| 17 | mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX); |
| 18 | mx31_gpio_mux(MUX_RTS1__UART1_RTS_B); |
| 19 | mx31_gpio_mux(MUX_CTS1__UART1_CTS_B); |
| 20 | } |
Magnus Lilja | 1763531 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 21 | |
Helmut Raiger | 1f2850f | 2011-10-27 01:31:13 +0000 | [diff] [blame] | 22 | void mx31_uart2_hw_init(void) |
| 23 | { |
| 24 | /* setup pins for UART2 */ |
| 25 | mx31_gpio_mux(MUX_RXD2__UART2_RXD_MUX); |
| 26 | mx31_gpio_mux(MUX_TXD2__UART2_TXD_MUX); |
| 27 | mx31_gpio_mux(MUX_RTS2__UART2_RTS_B); |
| 28 | mx31_gpio_mux(MUX_CTS2__UART2_CTS_B); |
| 29 | } |
Helmut Raiger | 1f2850f | 2011-10-27 01:31:13 +0000 | [diff] [blame] | 30 | |
Magnus Lilja | 1763531 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 31 | #ifdef CONFIG_MXC_SPI |
Helmut Raiger | 1f2850f | 2011-10-27 01:31:13 +0000 | [diff] [blame] | 32 | /* |
| 33 | * Note: putting several spi setups here makes no sense as they may differ |
| 34 | * at board level (physical pin SS0 of CSPI2 may aswell be used as SS0 of CSPI3) |
| 35 | */ |
Magnus Lilja | 1763531 | 2009-06-13 20:50:03 +0200 | [diff] [blame] | 36 | void mx31_spi2_hw_init(void) |
| 37 | { |
| 38 | /* SPI2 */ |
| 39 | mx31_gpio_mux(MUX_CSPI2_SS2__CSPI2_SS2_B); |
| 40 | mx31_gpio_mux(MUX_CSPI2_SCLK__CSPI2_CLK); |
| 41 | mx31_gpio_mux(MUX_CSPI2_SPI_RDY__CSPI2_DATAREADY_B); |
| 42 | mx31_gpio_mux(MUX_CSPI2_MOSI__CSPI2_MOSI); |
| 43 | mx31_gpio_mux(MUX_CSPI2_MISO__CSPI2_MISO); |
| 44 | mx31_gpio_mux(MUX_CSPI2_SS0__CSPI2_SS0_B); |
| 45 | mx31_gpio_mux(MUX_CSPI2_SS1__CSPI2_SS1_B); |
| 46 | |
| 47 | /* start SPI2 clock */ |
| 48 | __REG(CCM_CGR2) = __REG(CCM_CGR2) | (3 << 4); |
| 49 | } |
| 50 | #endif |