meta-facebook: console: add single host uart routing

Add uart1 to uart4 and io1 to uart2 routing for single host

Change-Id: I708df01583a7974b039b99e2dda84ca22add6c3a
Signed-off-by: Peter Yin <peter.yin@quantatw.com>
diff --git a/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console/setup-uart-routing.conf b/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console/setup-uart-routing.conf
deleted file mode 100644
index c91a0b1..0000000
--- a/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console/setup-uart-routing.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-[Service]
-ExecStartPre=/usr/libexec/obmc-console/setup-uart-routing
diff --git a/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console_%.bbappend b/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console_%.bbappend
index e500001..f85aac0 100644
--- a/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console_%.bbappend
+++ b/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console_%.bbappend
@@ -4,22 +4,13 @@
 inherit obmc-phosphor-systemd
 
 SRC_URI:append = " \
-    file://setup-uart-routing \
-    file://setup-uart-routing.conf \
     file://server.ttyUSB1.conf \
     file://plat-80-obmc-console-uart.rules \
     "
 
-do_install:append() {
-    install -d ${D}${libexecdir}/${PN}
-    install -m 0755 ${WORKDIR}/setup-uart-routing ${D}${libexecdir}/${PN}
-}
-
 OBMC_CONSOLE_TTYS:append = " ttyUSB1"
-
-SYSTEMD_OVERRIDE:${PN}:append = " setup-uart-routing.conf:obmc-console@ttyS2.service.d/setup-uart-routing.conf"
+OBMC_SOL_ROUTING = "uart1:uart4 uart4:uart1 io1:uart2 uart2:io1"
 
 do_install:append() {
         install -d ${D}${base_libdir}/udev/rules.d/
-        install -m 0644 ${WORKDIR}/plat-80-obmc-console-uart.rules ${D}${base_libdir}/udev/rules.d/80-obmc-console-uart.rules
 }
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-singlehost/server.ttyS2.conf b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-singlehost/server.ttyS2.conf
index f9326c8..c5b591b 100644
--- a/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-singlehost/server.ttyS2.conf
+++ b/meta-facebook/recipes-phosphor/console/obmc-console/fb-compute-singlehost/server.ttyS2.conf
@@ -1,3 +1,4 @@
 baud = 57600
 console-id = host0
 logfile = /var/log/obmc-console-host0.log
+aspeed-uart-routing = "OBMC_SOL_ROUTING"
diff --git a/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend b/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend
index 44701c8..9ba6523 100644
--- a/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend
+++ b/meta-facebook/recipes-phosphor/console/obmc-console_%.bbappend
@@ -13,6 +13,14 @@
 SRC_URI:append = " ${SERVER_CONFS}"
 SRC_URI:append = " file://client.conf "
 
+OBMC_SOL_ROUTING ?= ""
+
 do_install:append() {
   install -m 0644 ${WORKDIR}/client.conf ${D}${sysconfdir}/${BPN}/client.conf
 }
+
+do_install:prepend() {
+    if [ -f "${WORKDIR}/server.${OBMC_CONSOLE_HOST_TTY}.conf" ]; then
+        sed -i "s/\"OBMC_SOL_ROUTING\"/${OBMC_SOL_ROUTING}/g" ${WORKDIR}/server.${OBMC_CONSOLE_HOST_TTY}.conf
+    fi
+}