meta-facebook: harma: obmc-console: setup host uart routing
In harma system, the host console diagram as below.
```
┌──────────────┐
│ Host Console │
└┬─────────────┘
│
┌─┼──────────────────────────┐
│ │ │
│ │ ┌───────┐ ┌───────┐ │ ┌──────────────┐
│ ├─┤ UART1 ├─────┤ UART4 ├──┼──┤ obmc-console │
│ │ └───────┘ │(ttyS2)│ │ │ (SOL) │
│ │ └───────┘ │ └──────────────┘
│ │ │
│ │ ┌───────┐ ┌───────┐ │ ┌───────────────┐
│ └─┤ UART2 ├─────┤ IO1 ├──┼──┤ Debug Console │
│ └───────┘ └───────┘ │ └───────────────┘
│ │
└────────────────────────────┘
```
Add an extra config for setting uart routing of host console.
- uart1 <--> uart4
- io1 <--> uart2
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I3b99b6b834d4ec1c4152c018c5a0e39230eec415
diff --git a/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console/setup-uart-routing b/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console/setup-uart-routing
new file mode 100644
index 0000000..9df066b
--- /dev/null
+++ b/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console/setup-uart-routing
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+connect_uart_route() {
+ echo -ne "$1" > /sys/devices/platform/ahb/ahb:apb/1e789000.lpc/1e789098.uart-routing/"$2"
+ echo -ne "$2" > /sys/devices/platform/ahb/ahb:apb/1e789000.lpc/1e789098.uart-routing/"$1"
+}
+
+connect_uart_route "uart1" "uart4"
+connect_uart_route "io1" "uart2"