[...]


The above analysis is very clear, thanks. I am a little concern about if
the code changes below follow the comments in the code.

In Terminal.c:
     //
     // Set the timeout value of serial buffer for
     // keystroke response performance issue
     //
In TerminalConIn.c:
   //
   //  if current timeout value for serial device is not identical with
   //  the value saved in TERMINAL_DEV structure, then recalculate the
   //  timeout value again and set serial attribute according to this value.
   //

Any comments about above concern?


And I also checked the
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c although ARM
platforms do not use it, the SERIAL_PORT_DEFAULT_RECEIVE_FIFO_DEPTH
value is 1. if SetAttributes() is called with ReceiveFifoDepth = 0, then
SERIAL_PORT_DEFAULT_RECEIVE_FIFO_DEPTH is selected as the description of
the functions is "A ReceiveFifoDepth value of 0 will use the device's
default FIFO depth", so what's the device's default FIFO depth?

Well, that's exactly what SerialDxe delegates to SerialPortLib :)
SerialDxe need not be aware of the device-specific value; the platform
will provide a device-specific library instance.

I have a thought that updates SerialDxe to call SerialSetAttributes(with
0, 0, 0, DefaultParity, 0 and DefaultStopBits) in SerialDxeInitialize()
and SerialReset() to get the real default values of the device, then the
driver can also eliminate the use of PcdUartDefault####.

What's your opinion?

I don't think this is a good idea -- the UEFI spec is very clear on
this. Under "11.8 Serial I/O Protocol", in the general description part,
you find:

     The default attributes for all UART-style serial device interfaces
     are: 115,200 baud, a 1 byte receive FIFO, a 1,000,000 microsecond
     timeout per character, no parity, 8 data bits, and 1 stop bit. [...]

So this is what must be in effect right after initialization, and --
with all likelihood -- after re-set as well.

If a Serial IO protocol client is not content with these settings, then
it must explicitly change them, with the SetAttributes() call.

So TerminalDxe could know it is not content with the settings?
Should platform BDS code to explicitly change them with the SetAttributes() call?

Thanks,
Star


Thanks
Laszlo

[...]

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to