-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathuart-mux
executable file
·86 lines (68 loc) · 1.77 KB
/
uart-mux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#! /bin/sh
### BEGIN INIT INFO
# Provides: uart-mux
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Muxes some uart pins for uart use
# Description:
### END INIT INFO
# Comment out or assign a value other then "yes" to the
# MUX_UARTx lines for the UARTs you don't want to configure.
# UART1 P9 pins 24(TX), 26(RX)
MUX_UART1=yes
UART1_TXD=/sys/kernel/debug/omap_mux/uart1_txd
UART1_TX_MUX=0
UART1_RXD=/sys/kernel/debug/omap_mux/uart1_rxd
UART1_RX_MUX=20
# UART2 P9 pins 21(TX), 22(RX)
MUX_UART2=yes
UART2_TXD=/sys/kernel/debug/omap_mux/spi0_d0
UART2_TX_MUX=1
UART2_RXD=/sys/kernel/debug/omap_mux/spi0_sclk
UART2_RX_MUX=21
# UART4 P9 pins 13(TX), 11(RX)
MUX_UART4=yes
UART4_TXD=/sys/kernel/debug/omap_mux/gpmc_wpn
UART4_TX_MUX=6
UART4_RXD=/sys/kernel/debug/omap_mux/gpmc_wait0
UART4_RX_MUX=26
# UART5 P8 pins 37(TX), 38(RX)
MUX_UART5=yes
UART5_TXD=/sys/kernel/debug/omap_mux/lcd_data8
UART5_TX_MUX=4
UART5_RXD=/sys/kernel/debug/omap_mux/lcd_data9
UART5_RX_MUX=24
if [ "$MUX_UART1"x = "yesx" ]; then
if [ -f $UART1_TXD ]; then
echo $UART1_TX_MUX > $UART1_TXD
fi
if [ -f $UART1_RXD ]; then
echo $UART1_RX_MUX > $UART1_RXD
fi
fi
if [ "$MUX_UART2"x = "yesx" ]; then
if [ -f $UART2_TXD ]; then
echo $UART2_TX_MUX > $UART2_TXD
fi
if [ -f $UART2_RXD ]; then
echo $UART2_RX_MUX > $UART2_RXD
fi
fi
if [ "$MUX_UART4"x = "yesx" ]; then
if [ -f $UART4_TXD ]; then
echo $UART4_TX_MUX > $UART4_TXD
fi
if [ -f $UART4_RXD ]; then
echo $UART4_RX_MUX > $UART4_RXD
fi
fi
if [ "$MUX_UART5"x = "yesx" ]; then
if [ -f $UART5_TXD ]; then
echo $UART5_TX_MUX > $UART5_TXD
fi
if [ -f $UART5_RXD ]; then
echo $UART5_RX_MUX > $UART5_RXD
fi
fi