diff options
author | Potin Lai <potin.lai@quantatw.com> | 2023-12-13 14:17:12 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2023-12-15 22:03:17 +0300 |
commit | 1a30877a4ea25bc23d2e07f9cba8d1650ce7134a (patch) | |
tree | b6dd2dfa2a74d33b99c4c24b98ddf301e1bdceed /meta-facebook/meta-harma | |
parent | 4a8493b53a82424b1cf16c024bf71c29cbab9381 (diff) | |
download | openbmc-1a30877a4ea25bc23d2e07f9cba8d1650ce7134a.tar.xz |
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
Diffstat (limited to 'meta-facebook/meta-harma')
3 files changed, 27 insertions, 0 deletions
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 0000000000..9df066b72c --- /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" 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 new file mode 100644 index 0000000000..c91a0b1bcd --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console/setup-uart-routing.conf @@ -0,0 +1,2 @@ +[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 new file mode 100644 index 0000000000..2278e97083 --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/console/obmc-console_%.bbappend @@ -0,0 +1,16 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +inherit obmc-phosphor-systemd + +SRC_URI:append = " \ + file://setup-uart-routing \ + file://setup-uart-routing.conf \ + " + +do_install:append() { + install -d ${D}${libexecdir}/${PN} + install -m 0755 ${WORKDIR}/setup-uart-routing ${D}${libexecdir}/${PN} +} + +SYSTEMD_OVERRIDE:${PN}:append = " setup-uart-routing.conf:obmc-console@ttyS2.service.d/setup-uart-routing.conf" +RDEPENDS:${PN}:append = " bash" |