1 // SPDX-License-Identifier: GPL-2.0+
5 * Copyright (C) 2018 EETS GmbH - http://www.eets.ch/
7 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
11 #include <asm/arch/sys_proto.h>
12 #include <asm/arch/hardware.h>
13 #include <asm/arch/mux.h>
18 static struct module_pin_mux uart0_pin_mux
[] = {
19 {OFFSET(uart0_rxd
), (MODE(0) | PULLUP_EN
| RXACTIVE
)}, /* UART0_RXD */
20 {OFFSET(uart0_txd
), (MODE(0) | PULLUDEN
)}, /* UART0_TXD */
24 static struct module_pin_mux uart1_pin_mux
[] = {
25 {OFFSET(uart1_rxd
), (MODE(0) | PULLUP_EN
| RXACTIVE
)}, /* UART1_RXD */
26 {OFFSET(uart1_txd
), (MODE(0) | PULLUDEN
)}, /* UART1_TXD */
30 static struct module_pin_mux uart2_pin_mux
[] = {
31 {OFFSET(spi0_sclk
), (MODE(1) | PULLUP_EN
| RXACTIVE
)}, /* UART2_RXD */
32 {OFFSET(spi0_d0
), (MODE(1) | PULLUDEN
)}, /* UART2_TXD */
36 static struct module_pin_mux uart3_pin_mux
[] = {
37 {OFFSET(spi0_cs1
), (MODE(1) | PULLUP_EN
| RXACTIVE
)}, /* UART3_RXD */
38 {OFFSET(ecap0_in_pwm0_out
), (MODE(1) | PULLUDEN
)}, /* UART3_TXD */
42 static struct module_pin_mux uart4_pin_mux
[] = {
43 {OFFSET(gpmc_wait0
), (MODE(6) | PULLUP_EN
| RXACTIVE
)}, /* UART4_RXD */
44 {OFFSET(gpmc_wpn
), (MODE(6) | PULLUDEN
)}, /* UART4_TXD */
48 static struct module_pin_mux uart5_pin_mux
[] = {
49 {OFFSET(lcd_data9
), (MODE(4) | PULLUP_EN
| RXACTIVE
)}, /* UART5_RXD */
50 {OFFSET(lcd_data8
), (MODE(4) | PULLUDEN
)}, /* UART5_TXD */
54 static struct module_pin_mux i2c0_pin_mux
[] = {
55 {OFFSET(i2c0_sda
), (MODE(0) | RXACTIVE
|
56 PULLUDEN
| SLEWCTRL
)}, /* I2C_DATA */
57 {OFFSET(i2c0_scl
), (MODE(0) | RXACTIVE
|
58 PULLUDEN
| SLEWCTRL
)}, /* I2C_SCLK */
62 void enable_uart0_pin_mux(void)
64 configure_module_pin_mux(uart0_pin_mux
);
67 void enable_uart1_pin_mux(void)
69 configure_module_pin_mux(uart1_pin_mux
);
72 void enable_uart2_pin_mux(void)
74 configure_module_pin_mux(uart2_pin_mux
);
77 void enable_uart3_pin_mux(void)
79 configure_module_pin_mux(uart3_pin_mux
);
82 void enable_uart4_pin_mux(void)
84 configure_module_pin_mux(uart4_pin_mux
);
87 void enable_uart5_pin_mux(void)
89 configure_module_pin_mux(uart5_pin_mux
);
92 void enable_uart_pin_mux(u32 addr
)
95 case CONFIG_SYS_NS16550_COM1
:
96 enable_uart0_pin_mux();
98 case CONFIG_SYS_NS16550_COM2
:
99 enable_uart1_pin_mux();
101 case CONFIG_SYS_NS16550_COM3
:
102 enable_uart2_pin_mux();
104 case CONFIG_SYS_NS16550_COM4
:
105 enable_uart3_pin_mux();
107 case CONFIG_SYS_NS16550_COM5
:
108 enable_uart4_pin_mux();
110 case CONFIG_SYS_NS16550_COM6
:
111 enable_uart5_pin_mux();
116 void enable_i2c0_pin_mux(void)
118 configure_module_pin_mux(i2c0_pin_mux
);