bytedance: g220a: Add sol config
Tested: ssh -p 2200, SOL works well.
(From meta-bytedance rev: 1f40f6da4fc2e00fc06128ae6ba7dd1f045c8a84)
Signed-off-by: John Wang <wangzhiqiang.bj@bytedance.com>
Change-Id: I2abd1e11c5158da887ac382bb2a98f94d85a4749
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-bytedance/meta-g220a/recipes-phosphor/console/obmc-console/obmc-console.conf b/meta-bytedance/meta-g220a/recipes-phosphor/console/obmc-console/obmc-console.conf
new file mode 100644
index 0000000..8491f53
--- /dev/null
+++ b/meta-bytedance/meta-g220a/recipes-phosphor/console/obmc-console/obmc-console.conf
@@ -0,0 +1,3 @@
+baud = 115200
+local-tty = ttyS3
+local-tty-baud = 115200
diff --git a/meta-bytedance/meta-g220a/recipes-phosphor/console/obmc-console/obmc-console@.service b/meta-bytedance/meta-g220a/recipes-phosphor/console/obmc-console/obmc-console@.service
new file mode 100644
index 0000000..1a1dfff
--- /dev/null
+++ b/meta-bytedance/meta-g220a/recipes-phosphor/console/obmc-console/obmc-console@.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Phosphor Console Muxer listening on device /dev/%I
+BindsTo=dev-%i.device
+After=dev-%i.device
+
+[Service]
+ExecStartPre=/bin/sh -c 'echo -n "uart3" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart1'
+ExecStartPre=/bin/sh -c 'echo -n "uart1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart3'
+ExecStartPre=/bin/sh -c 'echo -n "io1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart4'
+ExecStartPre=/bin/sh -c 'echo -n "uart4" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/io1'
+ExecStart=/usr/bin/env obmc-console-server --config {sysconfdir}/obmc-console.conf %i
+ExecStopPost=/bin/sh -c 'echo -n "io1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart1'
+ExecStopPost=/bin/sh -c 'echo -n "io3" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart3'
+ExecStopPost=/bin/sh -c 'echo -n "io4" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/uart4'
+ExecStopPost=/bin/sh -c 'echo -n "uart1" > /sys/bus/platform/drivers/aspeed-uart-routing/1e78909c.uart_routing/io1'
+SyslogIdentifier=obmc-console-server
+Restart=always
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}
diff --git a/meta-bytedance/meta-g220a/recipes-phosphor/console/obmc-console_%.bbappend b/meta-bytedance/meta-g220a/recipes-phosphor/console/obmc-console_%.bbappend
new file mode 100644
index 0000000..a5d722f
--- /dev/null
+++ b/meta-bytedance/meta-g220a/recipes-phosphor/console/obmc-console_%.bbappend
@@ -0,0 +1,14 @@
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+OBMC_CONSOLE_HOST_TTY = "ttyS2"
+SRC_URI += "file://obmc-console@.service \
+ "
+inherit obmc-phosphor-systemd
+
+SYSTEMD_SERVICE_${PN} += " \
+ ${PN}@${OBMC_CONSOLE_HOST_TTY}.service \
+ "
+
+do_install_append() {
+ rm -rf ${D}${base_libdir}/udev/rules.d/80-obmc-console-uart.rules
+ install -m 0644 ${WORKDIR}/${PN}@.service ${D}${systemd_system_unitdir}
+}