1#!/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 34