AnsweredAssumed Answered

Setting Data/Stop/Parity Bits on Serial Port in Guest OS

Question asked by Kevin Sikorski on Jun 4, 2019

I'm working on a T1040 based system, and I'm exposing a hardware serial port to a Guest OS (through the hardware hypervisor).  The serial port appears as /dev/tty/EHV1, and I can send and receive data through it.  But I can't seem to set the baud rate, data bits, stop bits, or parity on that port.  If I run my OS bare metal, I can set the data bits, stop bits, and parity, but I still can't set the baud rate without altering the device tree and setting the "current-speed" property to set the default baud rate. I'm testing this with:

   stty -F /dev/ttyHV1 cs5      or

   stty -F /dev/ttyHV1 9600

 

This is actually my second serial port.  My first is set up as the console mux.  This also sends and receives data correctly, but suffers from the same inability to set connection parameters on it. 

 

My best guess is that something is wrong in my device tree, but I don't see any clear causes.

 

My non-mux serial port is set up in the guest device tree like:

hv: hypervisor-config {

...

serial1: serial1 {
device = "serial1";
};

...

}

part1: part1 {

compatible = "partition";

...

byte-channel0 {

compatible = "byte-channel";
endpoint = <&serial1>;

};

serial1 {
device = "serial1";

};

}

 

Where I have an alias set up in the host hardware device tree like:
aliases {

serial1 = "/soc@ffe000000/serial@11c600";

}

 

Does anyone have any suggestions on what could be wrong, either in my device tree or elsewhere?  Or, would anyone have an example device tree where they have given a guest OS full access to a serial port (ie, can both send/receive data and change connection parameters)?

 

Thanks

Outcomes