blob: 28fad3037ee1d9ab0de67b6bde4b1b5858e6772b [file] [log] [blame]
Andrei Kartashevc12c3972021-11-28 22:41:06 +03001#!/bin/bash -eu
2
3function usage()
4{
5 echo "Usage: $(basename "$0") init|reset"
6}
7
8if [ "$#" -ne "1" ] ; then
9 usage
10 exit 1;
11fi
12
13cmd="${1}"
14UART_ROUTING_PATH="/sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart-routing"
15
16case "${cmd}" in
17 init)
18 echo -n "uart3" > ${UART_ROUTING_PATH}/uart1
19 echo -n "uart1" > ${UART_ROUTING_PATH}/uart3
20 echo -n "io1" > ${UART_ROUTING_PATH}/uart4
21 echo -n "uart4" > ${UART_ROUTING_PATH}/io1
22 ;;
23 reset)
24 echo -n "io1" > ${UART_ROUTING_PATH}/uart1
25 echo -n "io3" > ${UART_ROUTING_PATH}/uart3
26 echo -n "io4" > ${UART_ROUTING_PATH}/uart4
27 echo -n "uart1" > ${UART_ROUTING_PATH}/io1
28 ;;
29 *)
30 usage
31 exit 1;
32 ;;
33esac