Revision: 19700
          http://sourceforge.net/p/edk2/code/19700
Author:   lersek
Date:     2016-01-21 00:29:07 +0000 (Thu, 21 Jan 2016)
Log Message:
-----------
MdeModulePkg: SerialDxe: sync EFI_SERIAL_IO_MODE.Timeout with the spec

In "11.8 Serial I/O Protocol", UEFI 2.5 requires:

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

It also says, about the EFI_SERIAL_IO_MODE.ControlMask member:

  (g) A mask of the Control bits that the device supports. The device must
      always support the Input Buffer Empty control bit.

SerialDxe complies with requirement (b) via hard-coded constants. It
complies with requirements (a), (d), (e) and (f) through PCD defaults (see
MdePkg/MdePkg.dec):

(a) 115,200 baud:
  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200|UINT64|0x00000020

(d) no parity:
  # 1 - No Parity.<BR>
  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1|UINT8|0x00000022

(e) 8 data bits:
  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8|UINT8|0x00000021

(f) 1 stop bit:
  # 1 - One Stop Bit.<BR>
  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1|UINT8|0x00000023

SerialDxe does not comply with requirements (c) and (g). In this patch, we
fix (c), and leave (g) for later.

Cc: Ard Biesheuvel <[email protected]>
Cc: Ryan Harkin <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Star Zeng <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Tested-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
Tested-by: Ryan Harkin <[email protected]>
Reviewed-by: Star Zeng <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/SerialDxe/SerialIo.c

Modified: trunk/edk2/MdeModulePkg/Universal/SerialDxe/SerialIo.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/SerialDxe/SerialIo.c      2016-01-21 
00:29:03 UTC (rev 19699)
+++ trunk/edk2/MdeModulePkg/Universal/SerialDxe/SerialIo.c      2016-01-21 
00:29:07 UTC (rev 19700)
@@ -185,7 +185,7 @@
   //    value  field                set in SerialDxeInitialize()?
   //---------  -------------------  -----------------------------
             0, // ControlMask
-            0, // Timeout
+  1000 * 1000, // Timeout
             0, // BaudRate          yes
             1, // ReceiveFifoDepth
             0, // DataBits          yes
@@ -237,7 +237,7 @@
   // Set the Serial I/O mode
   //
   This->Mode->ReceiveFifoDepth  = 1;
-  This->Mode->Timeout           = 0;
+  This->Mode->Timeout           = 1000 * 1000;
   This->Mode->BaudRate          = PcdGet64 (PcdUartDefaultBaudRate);
   This->Mode->DataBits          = (UINT32) PcdGet8 (PcdUartDefaultDataBits);
   This->Mode->Parity            = (UINT32) PcdGet8 (PcdUartDefaultParity);


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to