| commit | 9598b866d8e2189b0f426e8a384f2e20dc4d732c | [log] [tgz] |
|---|---|---|
| author | Jonathan Doman <jonathan.doman@intel.com> | Thu Jun 01 10:21:25 2023 -0700 |
| committer | Jonathan Doman <jonathan.doman@intel.com> | Fri Jun 02 12:28:32 2023 -0700 |
| tree | 4e4b7b494785c59509f6fb7ee0297e8d98d3d50f | |
| parent | bd992c9f62dbf127a21de26714662f92eabd0156 [diff] |
Add new D-Bus UART interface New interface xyz.openbmc_project.Console.UART was added to P-D-I: https://github.com/openbmc/phosphor-dbus-interfaces/blob/3826910ef8f91c05562a716929221745c92dd9d7/yaml/xyz/openbmc_project/Console/UART.interface.yaml Tested: With obmc-console@ttyS2: bmc# alias xyz=xyz.openbmc_project; alias XYZ=/xyz/openbmc_project bmc# stty -F /dev/ttyS2 speed 921600 bmc# busctl introspect $xyz.Console.default $XYZ/console/default $xyz.Console.UART NAME TYPE SIGNATURE RESULT/VALUE FLAGS .Baud property t 921600 writable bmc# busctl set-property $xyz.Console.default $XYZ/console/default \ $xyz.Console.UART Baud t 57600 bmc# stty -F /dev/ttyS2 speed 57600 bmc# busctl set-property $xyz.Console.default $XYZ/console/default \ $xyz.Console.UART Baud t 57601 Failed to set property Baud on interface xyz.openbmc_project.Console.UART: Invalid argument Change-Id: I055f2a95c515636b38a694bf565b71aa648fe7b7 Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
To build this project, run the following shell commands:
meson setup build meson compile -C build
To test:
meson test -C build
Running the server requires a serial port (e.g. /dev/ttyS0):
touch obmc-console.conf ./obmc-console-server --config obmc-console.conf ttyS0
To connect to the server, simply run the client:
./obmc-console-client
To disconnect the client, use the standard ~. combination.
This shows how the host UART connection is abstracted within the BMC as a Unix domain socket.
+---------------------------------------------------------------------------------------------+
| |
| obmc-console-client unix domain socket obmc-console-server |
| |
| +----------------------+ +------------------------+ |
| | client.2200.conf | +---------------------+ | server.ttyVUART0.conf | |
+---+--+ +----------------------+ | | +------------------------+ +--------+-------+
Network | 2200 +--> +->+ @obmc-console.host0 +<-+ <--+ /dev/ttyVUART0 | UARTs
+---+--+ | console-id = "host0" | | | | console-id = "host0" | +--------+-------+
| | | +---------------------+ | | |
| +----------------------+ +------------------------+ |
| |
| |
| |
+---------------------------------------------------------------------------------------------+
This supports multiple independent consoles. The console-id is a unique portion for the unix domain socket created by the obmc-console-server instance. The server needs to know this because it needs to know what to name the pipe; the client needs to know it as it needs to form the abstract socket name to which to connect.