On 01/15/16 17:17, Leif Lindholm wrote: > Hi Ard, > > On Fri, Jan 15, 2016 at 04:42:25PM +0100, Ard Biesheuvel wrote: >> SerialDxe was migrated to MdeModulePkg from EmbeddedPkg, and all >> users of the latter were moved to the former. However, the new >> version is not quite identical to the original, in ways that break >> ARM platforms that use the PL011 driver. >> >> In SerialReset(), the serial port is reset to its default values, >> but the defaults used by the new version for ReceiveFifoDepth and >> Timeout deviate from the original values. So put them back. > > Many thanks for tracking this down. > >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Ard Biesheuvel <[email protected]> >> --- >> MdeModulePkg/Universal/SerialDxe/SerialIo.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c >> b/MdeModulePkg/Universal/SerialDxe/SerialIo.c >> index de928d1719e9..9e9db28ce5cc 100644 >> --- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c >> +++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c >> @@ -233,8 +233,8 @@ SerialReset ( >> // >> // Set the Serial I/O mode >> // >> - This->Mode->ReceiveFifoDepth = 1; >> - This->Mode->Timeout = 0; >> + This->Mode->ReceiveFifoDepth = 0; >> + This->Mode->Timeout = 1000000; > > Actually, I'd be happy for Timeout to be left at 0 (use the platform's > default timeout).
I disagree, the UEFI spec is clear on this. Plus, the TerminalDxe driver (= the Serial IO protocol client) already calculates a Timeout value, and sets it with SetAttributes(). > It's the hard coded ReceiveFifoDepth != 0 that breaks > things. > >> This->Mode->BaudRate = PcdGet64 (PcdUartDefaultBaudRate); >> This->Mode->DataBits = (UINT32) PcdGet8 (PcdUartDefaultDataBits); >> This->Mode->Parity = (UINT32) PcdGet8 (PcdUartDefaultParity); >> -- >> 2.5.0 > > Could you also update the mSerialIoMode struct initialisation in the > same file to be consistent? Agreed, Reset() and mSerialIoMode should be consistent. (One could argue the former should CopyMem() from the latter...) Thanks Laszlo > > / > Leif > _______________________________________________ > edk2-devel mailing list > [email protected] > https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

