1
2
3
4
5
6
7
8#include <common.h>
9#include <asm/arch/sys_proto.h>
10#include <asm/arch/hardware.h>
11#include <asm/arch/mux.h>
12#include <asm/io.h>
13#include <i2c.h>
14#include "board.h"
15
16static struct module_pin_mux uart0_pin_mux[] = {
17 {OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},
18 {OFFSET(uart0_txd), (MODE(0) | PULLUDEN)},
19 {-1},
20};
21
22static struct module_pin_mux uart1_pin_mux[] = {
23 {OFFSET(uart1_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},
24 {OFFSET(uart1_txd), (MODE(0) | PULLUDEN)},
25 {-1},
26};
27
28static struct module_pin_mux uart2_pin_mux[] = {
29 {OFFSET(spi0_sclk), (MODE(1) | PULLUP_EN | RXACTIVE)},
30 {OFFSET(spi0_d0), (MODE(1) | PULLUDEN)},
31 {-1},
32};
33
34static struct module_pin_mux uart3_pin_mux[] = {
35 {OFFSET(spi0_cs1), (MODE(1) | PULLUP_EN | RXACTIVE)},
36 {OFFSET(ecap0_in_pwm0_out), (MODE(1) | PULLUDEN)},
37 {-1},
38};
39
40static struct module_pin_mux uart4_pin_mux[] = {
41 {OFFSET(gpmc_wait0), (MODE(6) | PULLUP_EN | RXACTIVE)},
42 {OFFSET(gpmc_wpn), (MODE(6) | PULLUDEN)},
43 {-1},
44};
45
46static struct module_pin_mux uart5_pin_mux[] = {
47 {OFFSET(lcd_data9), (MODE(4) | PULLUP_EN | RXACTIVE)},
48 {OFFSET(lcd_data8), (MODE(4) | PULLUDEN)},
49 {-1},
50};
51
52static struct module_pin_mux mmc0_pin_mux[] = {
53 {OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)},
54 {OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)},
55 {OFFSET(mmc0_dat1), (MODE(0) | RXACTIVE | PULLUP_EN)},
56 {OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)},
57 {OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)},
58 {OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)},
59 {OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)},
60 {OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)},
61 {-1},
62};
63
64static struct module_pin_mux mmc1_pin_mux[] = {
65 {OFFSET(gpmc_ad3), (MODE(1) | RXACTIVE | PULLUP_EN)},
66 {OFFSET(gpmc_ad2), (MODE(1) | RXACTIVE | PULLUP_EN)},
67 {OFFSET(gpmc_ad1), (MODE(1) | RXACTIVE | PULLUP_EN)},
68 {OFFSET(gpmc_ad0), (MODE(1) | RXACTIVE | PULLUP_EN)},
69 {OFFSET(gpmc_csn1), (MODE(2) | RXACTIVE | PULLUP_EN)},
70 {OFFSET(gpmc_csn2), (MODE(2) | RXACTIVE | PULLUP_EN)},
71 {OFFSET(gpmc_csn0), (MODE(7) | RXACTIVE | PULLUP_EN)},
72 {OFFSET(gpmc_advn_ale), (MODE(7) | RXACTIVE | PULLUP_EN)},
73 {-1},
74};
75
76static struct module_pin_mux i2c0_pin_mux[] = {
77 {OFFSET(i2c0_sda), (MODE(0) | RXACTIVE |
78 PULLUDEN | SLEWCTRL)},
79 {OFFSET(i2c0_scl), (MODE(0) | RXACTIVE |
80 PULLUDEN | SLEWCTRL)},
81 {-1},
82};
83
84static struct module_pin_mux i2c1_pin_mux[] = {
85 {OFFSET(spi0_d1), (MODE(2) | RXACTIVE |
86 PULLUDEN | SLEWCTRL)},
87 {OFFSET(spi0_cs0), (MODE(2) | RXACTIVE |
88 PULLUDEN | SLEWCTRL)},
89 {-1},
90};
91
92static struct module_pin_mux mii1_pin_mux[] = {
93 {OFFSET(mii1_rxerr), MODE(0) | RXACTIVE},
94 {OFFSET(mii1_txen), MODE(0)},
95 {OFFSET(mii1_rxdv), MODE(0) | RXACTIVE},
96 {OFFSET(mii1_txd3), MODE(0)},
97 {OFFSET(mii1_txd2), MODE(0)},
98 {OFFSET(mii1_txd1), MODE(0)},
99 {OFFSET(mii1_txd0), MODE(0)},
100 {OFFSET(mii1_txclk), MODE(0) | RXACTIVE},
101 {OFFSET(mii1_rxclk), MODE(0) | RXACTIVE},
102 {OFFSET(mii1_rxd3), MODE(0) | RXACTIVE},
103 {OFFSET(mii1_rxd2), MODE(0) | RXACTIVE},
104 {OFFSET(mii1_rxd1), MODE(0) | RXACTIVE},
105 {OFFSET(mii1_rxd0), MODE(0) | RXACTIVE},
106 {OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN},
107 {OFFSET(mdio_clk), MODE(0) | PULLUP_EN},
108 {-1},
109};
110
111
112void enable_uart0_pin_mux(void)
113{
114 configure_module_pin_mux(uart0_pin_mux);
115}
116
117void enable_uart1_pin_mux(void)
118{
119 configure_module_pin_mux(uart1_pin_mux);
120}
121
122void enable_uart2_pin_mux(void)
123{
124 configure_module_pin_mux(uart2_pin_mux);
125}
126
127void enable_uart3_pin_mux(void)
128{
129 configure_module_pin_mux(uart3_pin_mux);
130}
131
132void enable_uart4_pin_mux(void)
133{
134 configure_module_pin_mux(uart4_pin_mux);
135}
136
137void enable_uart5_pin_mux(void)
138{
139 configure_module_pin_mux(uart5_pin_mux);
140}
141
142void enable_i2c0_pin_mux(void)
143{
144 configure_module_pin_mux(i2c0_pin_mux);
145}
146
147void enable_board_pin_mux(void)
148{
149 configure_module_pin_mux(i2c1_pin_mux);
150 configure_module_pin_mux(mii1_pin_mux);
151 configure_module_pin_mux(mmc0_pin_mux);
152 configure_module_pin_mux(mmc1_pin_mux);
153}
154