blob: 810b1941db9d052321e79bd9987d48d1ad143661 [file] [log] [blame]
Lokesh Vutlafaa680f2013-07-30 11:36:27 +05301/*
2 * mux.c
3 *
4 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9#include <common.h>
10#include <asm/arch/sys_proto.h>
11#include <asm/arch/mux.h>
12#include "board.h"
13
14static struct module_pin_mux uart0_pin_mux[] = {
Lokesh Vutlae6bd05e2013-12-10 15:02:19 +053015 {OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE | SLEWCTRL)},
16 {OFFSET(uart0_txd), (MODE(0) | PULLUDDIS | PULLUP_EN | SLEWCTRL)},
Lokesh Vutlafaa680f2013-07-30 11:36:27 +053017 {-1},
18};
19
Lokesh Vutlae6bd05e2013-12-10 15:02:19 +053020static struct module_pin_mux mmc0_pin_mux[] = {
21 {OFFSET(mmc0_clk), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* MMC0_CLK */
22 {OFFSET(mmc0_cmd), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* MMC0_CMD */
23 {OFFSET(mmc0_dat0), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* MMC0_DAT0 */
24 {OFFSET(mmc0_dat1), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* MMC0_DAT1 */
25 {OFFSET(mmc0_dat2), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* MMC0_DAT2 */
26 {OFFSET(mmc0_dat3), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* MMC0_DAT3 */
27 {-1},
28};
29
30static struct module_pin_mux i2c0_pin_mux[] = {
31 {OFFSET(i2c0_sda), (MODE(0) | PULLUP_EN | RXACTIVE | SLEWCTRL)},
32 {OFFSET(i2c0_scl), (MODE(0) | PULLUP_EN | RXACTIVE | SLEWCTRL)},
33 {-1},
34};
35
Lokesh Vutladd0037a2013-12-10 15:02:23 +053036static struct module_pin_mux gpio0_22_pin_mux[] = {
37 {OFFSET(ddr_ba2), (MODE(9) | PULLUP_EN)}, /* GPIO0_22 */
38 {-1},
39};
40
Lokesh Vutlafaa680f2013-07-30 11:36:27 +053041void enable_uart0_pin_mux(void)
42{
43 configure_module_pin_mux(uart0_pin_mux);
44}
45
46void enable_board_pin_mux(void)
47{
Lokesh Vutlae6bd05e2013-12-10 15:02:19 +053048 configure_module_pin_mux(mmc0_pin_mux);
49 configure_module_pin_mux(i2c0_pin_mux);
Lokesh Vutladd0037a2013-12-10 15:02:23 +053050
51 if (board_is_gpevm())
52 configure_module_pin_mux(gpio0_22_pin_mux);
Lokesh Vutlafaa680f2013-07-30 11:36:27 +053053}
Lokesh Vutla42c213a2013-12-10 15:02:20 +053054
55void enable_i2c0_pin_mux(void)
56{
57 configure_module_pin_mux(i2c0_pin_mux);
58}