public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch V4] MinPlatformPkg: console redirect after the shell is loaded
@ 2020-11-04  8:05 Heng Luo
  2020-11-05  0:54 ` 回复: [edk2-devel] " gaoliming
  0 siblings, 1 reply; 7+ messages in thread
From: Heng Luo @ 2020-11-04  8:05 UTC (permalink / raw)
  To: devel; +Cc: Eric Dong, Chasel Chiu, Nate DeSimone

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3014

Use SerialPortTerminalLib to get console redirect after the shell is
loaded:
1. Add SerialPortTerminalLib to MinPlatformPkg/Library, add PCDs to
 configure serial port.
2. Add SerialPortTerminalLib to BdsDxe driver, to add the serial device to
 ConIn and ConOut variables
3. Include SerialDxe and TerminalDxe to CoreDxeInclude.dsc and
 CoreUefiBootInclude.fdf.
4. Use PcdSerialTerminalEnable to enable/disable this feature.
5. Enable feature for UpXtreme, and disable it for other platform by default.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd.dsc                |   1 +
 Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc                    |   1 +
 Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc                  |   1 +
 Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc                          |  15 +++++++++++++--
 Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf                     |   8 +++++++-
 Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c   | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.h   |  48 ++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf |  40 ++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec                                      |  25 +++++++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                      |   3 ++-
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc                   |   1 +
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc                   |   1 +
 Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc            |   1 +
 13 files changed, 243 insertions(+), 4 deletions(-)

diff --git a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd.dsc b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd.dsc
index d611e99fc1..589b002d06 100644
--- a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd.dsc
@@ -131,6 +131,7 @@
   gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
 
 !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
   gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
index 352416a489..44dacdf082 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
@@ -130,6 +130,7 @@
   gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
 
 !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
   gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
index 9e8b148753..725596cbf7 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
@@ -168,6 +168,7 @@
   gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
 
 !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
   gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
index f0e578f8cc..2a4a574cdf 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
+++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  Platform description.
 #
-# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -46,7 +46,18 @@
 
   MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
 
-  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
+    <LibraryClasses>
+!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
+      NULL|SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf
+!endif
+  }
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
+  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
+  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+!endif
+
   MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
   MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
     <LibraryClasses>
diff --git a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
index 7859c0b1a5..ef4576eedf 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
+++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
@@ -1,7 +1,7 @@
 ## @file
 #  FDF file of Platform.
 #
-# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -26,6 +26,12 @@ INF  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
 INF  MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
 
 INF  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
+INF  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
+INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+!endif
+
 INF  MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
 INF  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
 INF  MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
diff --git a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c
new file mode 100644
index 0000000000..94de475173
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.c
@@ -0,0 +1,102 @@
+/** @file
+  Main file for NULL named library for Serial Port Terminal Redirection library.
+
+  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "SerialPortTerminalLib.h"
+
+GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH mSerialDevicePath = {
+  {
+    {
+      HARDWARE_DEVICE_PATH,
+      HW_VENDOR_DP,
+      {
+        (UINT8) sizeof (VENDOR_DEVICE_PATH),
+        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
+      }
+    },
+    EDKII_SERIAL_PORT_LIB_VENDOR_GUID
+  },
+  {
+    {
+      MESSAGING_DEVICE_PATH,
+      MSG_UART_DP,
+      {
+        (UINT8) sizeof (UART_DEVICE_PATH),
+        (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
+      }
+    },
+    0,                  // Reserved
+    0,                  // BaudRate
+    0,                  // DataBits
+    0,                  // Parity
+    0                   // StopBits
+  },
+  {
+    {
+      MESSAGING_DEVICE_PATH,
+      MSG_VENDOR_DP,
+      {
+        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
+        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
+      }
+    },
+    DEVICE_PATH_MESSAGING_PC_ANSI
+  },
+  gEndEntire
+};
+
+/**
+  Updates the ConOut, ConIn, ErrOut variables with the serial terminal device path
+  @param                        none
+  @retval                       none
+**/
+VOID
+AddSerialTerminal (
+  VOID
+  )
+{
+  DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n"));
+
+  //
+  // Append Serial Terminal into "ConIn"
+  //
+  EfiBootManagerUpdateConsoleVariable (ConOut, (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
+  EfiBootManagerUpdateConsoleVariable (ConIn, (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
+  EfiBootManagerUpdateConsoleVariable (ErrOut, (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
+}
+
+
+/**
+  Constructor for the Serial Port Device controller library.
+
+  @param ImageHandle    the image handle of the process
+  @param SystemTable    the EFI System Table pointer
+
+  @retval EFI_SUCCESS        the shell command handlers were installed sucessfully
+  @retval EFI_UNSUPPORTED    the shell level required was not found.
+**/
+EFI_STATUS
+EFIAPI
+SerialPortTerminalLibConstructor (
+  IN EFI_HANDLE        ImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  mSerialDevicePath.Uart.BaudRate = PcdGet64(PcdSerialTerminalBaudRate);
+  mSerialDevicePath.Uart.DataBits = PcdGet8(PcdSerialTerminalDataBits);
+  mSerialDevicePath.Uart.Parity   = PcdGet8(PcdSerialTerminalParity);
+  mSerialDevicePath.Uart.StopBits = PcdGet8(PcdSerialTerminalStopBits);
+  DEBUG ((DEBUG_INFO, "[SerialPortTerminalLibConstructor] [%d, %d, %d, %d]\n",
+      mSerialDevicePath.Uart.BaudRate,
+      mSerialDevicePath.Uart.DataBits,
+      mSerialDevicePath.Uart.Parity,
+      mSerialDevicePath.Uart.StopBits));
+
+  AddSerialTerminal();
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.h b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.h
new file mode 100644
index 0000000000..0a2eaae8b8
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.h
@@ -0,0 +1,48 @@
+/** @file
+  Header file for NULL named library for for Serial Port Terminal Redirection library.
+
+  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _SERIAL_PORT_TERMINAL_LIB_H_
+#define _SERIAL_PORT_TERMINAL_LIB_H_
+
+#include <Uefi.h>
+#include <Guid/SerialPortLibVendor.h>
+#include <Library/UefiLib.h>
+#include <Library/DevicePathLib.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiBootManagerLib.h>
+
+//
+// Below is the platform console device path
+//
+typedef struct {
+  VENDOR_DEVICE_PATH        Guid;
+  UART_DEVICE_PATH          Uart;
+  VENDOR_DEVICE_PATH        TerminalType;
+  EFI_DEVICE_PATH_PROTOCOL  End;
+} SERIAL_DEVICE_PATH;
+
+#define gPciRootBridge \
+  { \
+    { \
+      ACPI_DEVICE_PATH, \
+      ACPI_DP, \
+      { \
+        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
+        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
+      }, \
+    }, \
+    EISA_PNP_ID (0x0A03), \
+    0 \
+  }
+
+#define gEndEntire \
+  { \
+    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { END_DEVICE_PATH_LENGTH, 0 } \
+  }
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf
new file mode 100644
index 0000000000..b0a9326b1b
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerminalLib.inf
@@ -0,0 +1,40 @@
+## @file
+# Component information file for Serial Port Terminal Redirection Library
+#
+# INTEL CONFIDENTIAL
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+[Defines]
+  INF_VERSION                    = 0x00010006
+  BASE_NAME                      = SerialPortTerminalLib
+  FILE_GUID                      = E12BFA46-95F2-4ADC-9774-7E38DE78741E
+  MODULE_TYPE                    = UEFI_DRIVER
+  VERSION_STRING                 = 1.2
+  LIBRARY_CLASS                  = NULL|UEFI_DRIVER DXE_DRIVER DXE_RUNTIME_DRIVER
+  CONSTRUCTOR                    = SerialPortTerminalLibConstructor
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  BoardModulePkg/BoardModulePkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[Sources]
+  SerialPortTerminalLib.c
+  SerialPortTerminalLib.h
+
+[LibraryClasses]
+  DevicePathLib
+  DebugLib
+  UefiDriverEntryPoint
+  UefiBootManagerLib
+  UefiLib
+
+[Pcd]
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits
\ No newline at end of file
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
index 7ef189dac8..36050aa1a8 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
@@ -205,6 +205,30 @@
 [PcdsDynamic, PcdsDynamicEx]
   gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicEnable|0x0|UINT32|0x90000019
 
+  # The baud rate setting for the UART style device. A value of 0
+  # means that the device's default baud rate will be used.
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate|115200|UINT64|0x9000001A
+
+  # The number of data bits for the UART style device. A value
+  # of 0 means that the device's default number of data bits will be used.
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits|0x8|UINT8|0x9000001B
+
+  # The parity setting for the UART style device.
+  # Parity 0x00 - Default Parity.
+  # Parity 0x01 - No Parity.
+  # Parity 0x02 - Even Parity.
+  # Parity 0x03 - Odd Parity.
+  # Parity 0x04 - Mark Parity.
+  # Parity 0x05 - Space Parity.
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity|0x1|UINT8|0x9000001C
+
+  # The number of stop bits for the UART style device.
+  # Stop Bits 0x00 - Default Stop Bits.
+  # Stop Bits 0x01 - 1 Stop Bit.
+  # Stop Bits 0x02 - 1.5 Stop Bits.
+  # Stop Bits 0x03 - 2 Stop Bits.
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits|0x1|UINT8|0x9000001D
+
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
 
   ##
@@ -318,3 +342,4 @@
   gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable             |FALSE|BOOLEAN|0xF00000A5
   gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE|BOOLEAN|0xF00000A6
   gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable      |FALSE|BOOLEAN|0xF00000A7
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable   |FALSE|BOOLEAN|0xF00000B0
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index 112ddff7d9..d0b5593817 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  Platform description.
 #
-# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -44,6 +44,7 @@
     gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
     gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
     gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
+    gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
 
 ################################################################################
 #
diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
index 52cdf9ec0f..251f46f812 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
@@ -50,6 +50,7 @@
   gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
 
 !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
   gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
index d797ae9d94..e161bf06f4 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
@@ -127,6 +127,7 @@
   gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE
 
 !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
   gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
index 5d769e8153..83ada3c95c 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
@@ -127,6 +127,7 @@
   gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
 
 !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
   gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* 回复: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after the shell is loaded
  2020-11-04  8:05 [Patch V4] MinPlatformPkg: console redirect after the shell is loaded Heng Luo
@ 2020-11-05  0:54 ` gaoliming
  2020-11-05  1:08   ` Heng Luo
  0 siblings, 1 reply; 7+ messages in thread
From: gaoliming @ 2020-11-05  0:54 UTC (permalink / raw)
  To: devel, heng.luo
  Cc: 'Eric Dong', 'Chasel Chiu',
	'Nate DeSimone'

Heng:
 Can you separate the patch for the different packages? If so, it will be
easily to be reviewed. 

Thanks
Liming
> -----邮件原件-----
> 发件人: bounce+27952+66973+4905953+8761045@groups.io
> <bounce+27952+66973+4905953+8761045@groups.io> 代表 Heng Luo
> 发送时间: 2020年11月4日 16:06
> 收件人: devel@edk2.groups.io
> 抄送: Eric Dong <eric.dong@intel.com>; Chasel Chiu
> <chasel.chiu@intel.com>; Nate DeSimone <nathaniel.l.desimone@intel.com>
> 主题: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after the
> shell is loaded
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3014
> 
> Use SerialPortTerminalLib to get console redirect after the shell is
> loaded:
> 1. Add SerialPortTerminalLib to MinPlatformPkg/Library, add PCDs to
>  configure serial port.
> 2. Add SerialPortTerminalLib to BdsDxe driver, to add the serial device to
>  ConIn and ConOut variables
> 3. Include SerialDxe and TerminalDxe to CoreDxeInclude.dsc and
>  CoreUefiBootInclude.fdf.
> 4. Use PcdSerialTerminalEnable to enable/disable this feature.
> 5. Enable feature for UpXtreme, and disable it for other platform by
default.
> 
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Signed-off-by: Heng Luo <heng.luo@intel.com>
> ---
> 
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd
> .dsc                |   1 +
>  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> |   1 +
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
> |   1 +
>  Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> |  15 +++++++++++++--
>  Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> |   8 +++++++-
> 
>
Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTermi
> nalLib.c   | 102
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++++++++++++++++++++++++++++++++++
> 
>
Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTermi
> nalLib.h   |  48
> ++++++++++++++++++++++++++++++++++++++++++++++++
> 
>
Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTermi
> nalLib.inf |  40 ++++++++++++++++++++++++++++++++++++++++
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> |  25 +++++++++++++++++++++++++
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> |   3 ++-
>  Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
> |   1 +
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
> |   1 +
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg
> Pcd.dsc            |   1 +
>  13 files changed, 243 insertions(+), 4 deletions(-)
> 
> diff --git
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> cd.dsc
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> cd.dsc
> index d611e99fc1..589b002d06 100644
> ---
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> cd.dsc
> +++
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> cd.dsc
> @@ -131,6 +131,7 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> 
> 
> 
>  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> index 352416a489..44dacdf082 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> @@ -130,6 +130,7 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> 
> 
> 
>  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> sc
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> sc
> index 9e8b148753..725596cbf7 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> sc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> sc
> @@ -168,6 +168,7 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> 
> 
> 
>  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> index f0e578f8cc..2a4a574cdf 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> @@ -1,7 +1,7 @@
>  ## @file
> 
>  #  Platform description.
> 
>  #
> 
> -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
> 
> +# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
> 
>  #
> 
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #
> 
> @@ -46,7 +46,18 @@
> 
> 
> 
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounte
> rRuntimeDxe.inf
> 
> 
> 
> -  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> 
> +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> 
> +    <LibraryClasses>
> 
> +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> 
> +
> NULL|SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/SerialPortTerm
> inalLib.inf
> 
> +!endif
> 
> +  }
> 
> +
> 
> +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> 
> +  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> 
> +  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> 
> +!endif
> 
> +
> 
> 
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> xe.inf
> 
>    MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
> 
>      <LibraryClasses>
> 
> diff --git
> a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> index 7859c0b1a5..ef4576eedf 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> +++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> @@ -1,7 +1,7 @@
>  ## @file
> 
>  #  FDF file of Platform.
> 
>  #
> 
> -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
> 
> +# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
> 
>  #
> 
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #
> 
> @@ -26,6 +26,12 @@ INF
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
>  INF
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounte
> rRuntimeDxe.inf
> 
> 
> 
>  INF  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> 
> +
> 
> +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> 
> +INF  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> 
> +INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> 
> +!endif
> 
> +
> 
>  INF
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> xe.inf
> 
>  INF  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> 
>  INF
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> 
> diff --git
>
a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> minalLib.c
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> minalLib.c
> new file mode 100644
> index 0000000000..94de475173
> --- /dev/null
> +++
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> minalLib.c
> @@ -0,0 +1,102 @@
> +/** @file
> 
> +  Main file for NULL named library for Serial Port Terminal Redirection
> library.
> 
> +
> 
> +  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +
> 
> +**/
> 
> +
> 
> +#include "SerialPortTerminalLib.h"
> 
> +
> 
> +GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH
> mSerialDevicePath = {
> 
> +  {
> 
> +    {
> 
> +      HARDWARE_DEVICE_PATH,
> 
> +      HW_VENDOR_DP,
> 
> +      {
> 
> +        (UINT8) sizeof (VENDOR_DEVICE_PATH),
> 
> +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
> 
> +      }
> 
> +    },
> 
> +    EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> 
> +  },
> 
> +  {
> 
> +    {
> 
> +      MESSAGING_DEVICE_PATH,
> 
> +      MSG_UART_DP,
> 
> +      {
> 
> +        (UINT8) sizeof (UART_DEVICE_PATH),
> 
> +        (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
> 
> +      }
> 
> +    },
> 
> +    0,                  // Reserved
> 
> +    0,                  // BaudRate
> 
> +    0,                  // DataBits
> 
> +    0,                  // Parity
> 
> +    0                   // StopBits
> 
> +  },
> 
> +  {
> 
> +    {
> 
> +      MESSAGING_DEVICE_PATH,
> 
> +      MSG_VENDOR_DP,
> 
> +      {
> 
> +        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
> 
> +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
> 
> +      }
> 
> +    },
> 
> +    DEVICE_PATH_MESSAGING_PC_ANSI
> 
> +  },
> 
> +  gEndEntire
> 
> +};
> 
> +
> 
> +/**
> 
> +  Updates the ConOut, ConIn, ErrOut variables with the serial terminal
> device path
> 
> +  @param                        none
> 
> +  @retval                       none
> 
> +**/
> 
> +VOID
> 
> +AddSerialTerminal (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n"));
> 
> +
> 
> +  //
> 
> +  // Append Serial Terminal into "ConIn"
> 
> +  //
> 
> +  EfiBootManagerUpdateConsoleVariable (ConOut,
> (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> 
> +  EfiBootManagerUpdateConsoleVariable (ConIn,
> (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> 
> +  EfiBootManagerUpdateConsoleVariable (ErrOut,
> (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> 
> +}
> 
> +
> 
> +
> 
> +/**
> 
> +  Constructor for the Serial Port Device controller library.
> 
> +
> 
> +  @param ImageHandle    the image handle of the process
> 
> +  @param SystemTable    the EFI System Table pointer
> 
> +
> 
> +  @retval EFI_SUCCESS        the shell command handlers were
> installed sucessfully
> 
> +  @retval EFI_UNSUPPORTED    the shell level required was not found.
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +SerialPortTerminalLibConstructor (
> 
> +  IN EFI_HANDLE        ImageHandle,
> 
> +  IN EFI_SYSTEM_TABLE  *SystemTable
> 
> +  )
> 
> +{
> 
> +  mSerialDevicePath.Uart.BaudRate =
> PcdGet64(PcdSerialTerminalBaudRate);
> 
> +  mSerialDevicePath.Uart.DataBits = PcdGet8(PcdSerialTerminalDataBits);
> 
> +  mSerialDevicePath.Uart.Parity   = PcdGet8(PcdSerialTerminalParity);
> 
> +  mSerialDevicePath.Uart.StopBits = PcdGet8(PcdSerialTerminalStopBits);
> 
> +  DEBUG ((DEBUG_INFO, "[SerialPortTerminalLibConstructor]
> [%d, %d, %d, %d]\n",
> 
> +      mSerialDevicePath.Uart.BaudRate,
> 
> +      mSerialDevicePath.Uart.DataBits,
> 
> +      mSerialDevicePath.Uart.Parity,
> 
> +      mSerialDevicePath.Uart.StopBits));
> 
> +
> 
> +  AddSerialTerminal();
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> diff --git
>
a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> minalLib.h
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> minalLib.h
> new file mode 100644
> index 0000000000..0a2eaae8b8
> --- /dev/null
> +++
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> minalLib.h
> @@ -0,0 +1,48 @@
> +/** @file
> 
> +  Header file for NULL named library for for Serial Port Terminal
Redirection
> library.
> 
> +
> 
> +  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +
> 
> +**/
> 
> +
> 
> +#ifndef _SERIAL_PORT_TERMINAL_LIB_H_
> 
> +#define _SERIAL_PORT_TERMINAL_LIB_H_
> 
> +
> 
> +#include <Uefi.h>
> 
> +#include <Guid/SerialPortLibVendor.h>
> 
> +#include <Library/UefiLib.h>
> 
> +#include <Library/DevicePathLib.h>
> 
> +#include <Library/DebugLib.h>
> 
> +#include <Library/UefiBootManagerLib.h>
> 
> +
> 
> +//
> 
> +// Below is the platform console device path
> 
> +//
> 
> +typedef struct {
> 
> +  VENDOR_DEVICE_PATH        Guid;
> 
> +  UART_DEVICE_PATH          Uart;
> 
> +  VENDOR_DEVICE_PATH        TerminalType;
> 
> +  EFI_DEVICE_PATH_PROTOCOL  End;
> 
> +} SERIAL_DEVICE_PATH;
> 
> +
> 
> +#define gPciRootBridge \
> 
> +  { \
> 
> +    { \
> 
> +      ACPI_DEVICE_PATH, \
> 
> +      ACPI_DP, \
> 
> +      { \
> 
> +        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
> 
> +        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
> 
> +      }, \
> 
> +    }, \
> 
> +    EISA_PNP_ID (0x0A03), \
> 
> +    0 \
> 
> +  }
> 
> +
> 
> +#define gEndEntire \
> 
> +  { \
> 
> +    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
> { END_DEVICE_PATH_LENGTH, 0 } \
> 
> +  }
> 
> +
> 
> +#endif
> 
> diff --git
>
a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> minalLib.inf
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> minalLib.inf
> new file mode 100644
> index 0000000000..b0a9326b1b
> --- /dev/null
> +++
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> minalLib.inf
> @@ -0,0 +1,40 @@
> +## @file
> 
> +# Component information file for Serial Port Terminal Redirection Library
> 
> +#
> 
> +# INTEL CONFIDENTIAL
> 
> +# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> 
> +#
> 
> +# SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +#
> 
> +##
> 
> +[Defines]
> 
> +  INF_VERSION                    = 0x00010006
> 
> +  BASE_NAME                      = SerialPortTerminalLib
> 
> +  FILE_GUID                      =
> E12BFA46-95F2-4ADC-9774-7E38DE78741E
> 
> +  MODULE_TYPE                    = UEFI_DRIVER
> 
> +  VERSION_STRING                 = 1.2
> 
> +  LIBRARY_CLASS                  = NULL|UEFI_DRIVER DXE_DRIVER
> DXE_RUNTIME_DRIVER
> 
> +  CONSTRUCTOR                    =
> SerialPortTerminalLibConstructor
> 
> +
> 
> +[Packages]
> 
> +  MdePkg/MdePkg.dec
> 
> +  MdeModulePkg/MdeModulePkg.dec
> 
> +  BoardModulePkg/BoardModulePkg.dec
> 
> +  MinPlatformPkg/MinPlatformPkg.dec
> 
> +
> 
> +[Sources]
> 
> +  SerialPortTerminalLib.c
> 
> +  SerialPortTerminalLib.h
> 
> +
> 
> +[LibraryClasses]
> 
> +  DevicePathLib
> 
> +  DebugLib
> 
> +  UefiDriverEntryPoint
> 
> +  UefiBootManagerLib
> 
> +  UefiLib
> 
> +
> 
> +[Pcd]
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits
> \ No newline at end of file
> diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> index 7ef189dac8..36050aa1a8 100644
> --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> @@ -205,6 +205,30 @@
>  [PcdsDynamic, PcdsDynamicEx]
> 
> 
> gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicEnable|0x0|UINT32|0x900000
> 19
> 
> 
> 
> +  # The baud rate setting for the UART style device. A value of 0
> 
> +  # means that the device's default baud rate will be used.
> 
> +
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate|115200|UINT6
> 4|0x9000001A
> 
> +
> 
> +  # The number of data bits for the UART style device. A value
> 
> +  # of 0 means that the device's default number of data bits will be
used.
> 
> +
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits|0x8|UINT8|0x9
> 000001B
> 
> +
> 
> +  # The parity setting for the UART style device.
> 
> +  # Parity 0x00 - Default Parity.
> 
> +  # Parity 0x01 - No Parity.
> 
> +  # Parity 0x02 - Even Parity.
> 
> +  # Parity 0x03 - Odd Parity.
> 
> +  # Parity 0x04 - Mark Parity.
> 
> +  # Parity 0x05 - Space Parity.
> 
> +
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity|0x1|UINT8|0x900
> 0001C
> 
> +
> 
> +  # The number of stop bits for the UART style device.
> 
> +  # Stop Bits 0x00 - Default Stop Bits.
> 
> +  # Stop Bits 0x01 - 1 Stop Bit.
> 
> +  # Stop Bits 0x02 - 1.5 Stop Bits.
> 
> +  # Stop Bits 0x03 - 2 Stop Bits.
> 
> +
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits|0x1|UINT8|0x9
> 000001D
> 
> +
> 
>  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
> 
> 
> 
>    ##
> 
> @@ -318,3 +342,4 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable
> |FALSE|BOOLEAN|0xF00000A5
> 
> 
> gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE|BOOLE
> AN|0xF00000A6
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable
> |FALSE|BOOLEAN|0xF00000A7
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable
> |FALSE|BOOLEAN|0xF00000B0
> 
> diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> index 112ddff7d9..d0b5593817 100644
> --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> @@ -1,7 +1,7 @@
>  ## @file
> 
>  #  Platform description.
> 
>  #
> 
> -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
> 
> +# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
> 
>  #
> 
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #
> 
> @@ -44,6 +44,7 @@
>      gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> 
>      gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> 
>      gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
> 
> +    gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> 
> 
> 
> 
> ##############################################################
> ##################
> 
>  #
> 
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> c
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> c
> index 52cdf9ec0f..251f46f812 100644
> ---
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> c
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> c
> @@ -50,6 +50,7 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> 
> 
> 
>  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> sc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> sc
> index d797ae9d94..e161bf06f4 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> sc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> sc
> @@ -127,6 +127,7 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE
> 
> 
> 
>  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kgPcd.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kgPcd.dsc
> index 5d769e8153..83ada3c95c 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kgPcd.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kgPcd.dsc
> @@ -127,6 +127,7 @@
>    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> 
> 
> 
>  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> 
>    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> 
> --
> 2.24.0.windows.2
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#66973): https://edk2.groups.io/g/devel/message/66973
> Mute This Topic: https://groups.io/mt/78024794/4905953
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaoliming@byosoft.com.cn]
> -=-=-=-=-=-=
> 




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after the shell is loaded
  2020-11-05  0:54 ` 回复: [edk2-devel] " gaoliming
@ 2020-11-05  1:08   ` Heng Luo
  2020-11-05  1:35     ` 回复: " gaoliming
  2020-11-10  2:13     ` Heng Luo
  0 siblings, 2 replies; 7+ messages in thread
From: Heng Luo @ 2020-11-05  1:08 UTC (permalink / raw)
  To: devel@edk2.groups.io, gaoliming@byosoft.com.cn
  Cc: Dong, Eric, Chiu, Chasel, Desimone, Nathaniel L

Hi Liming,

I think not, if I separate it into 2 patch for MinPlatformPkg and OpenBoardPkgPcd, it will cause OpenBoard platform build error if it applys MinPlatformPkg patch only because PcdSerialTerminalEnable is  not defined.


Thanks,
Heng

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> gaoliming
> Sent: Thursday, November 5, 2020 8:55 AM
> To: devel@edk2.groups.io; Luo, Heng <heng.luo@intel.com>
> Cc: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>;
> Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> Subject: 回复: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after
> the shell is loaded
> 
> Heng:
>  Can you separate the patch for the different packages? If so, it will be easily
> to be reviewed.
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: bounce+27952+66973+4905953+8761045@groups.io
> > <bounce+27952+66973+4905953+8761045@groups.io> 代表 Heng Luo
> > 发送时间: 2020年11月4日 16:06
> > 收件人: devel@edk2.groups.io
> > 抄送: Eric Dong <eric.dong@intel.com>; Chasel Chiu
> > <chasel.chiu@intel.com>; Nate DeSimone
> > <nathaniel.l.desimone@intel.com>
> > 主题: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after the
> > shell is loaded
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3014
> >
> > Use SerialPortTerminalLib to get console redirect after the shell is
> > loaded:
> > 1. Add SerialPortTerminalLib to MinPlatformPkg/Library, add PCDs to
> > configure serial port.
> > 2. Add SerialPortTerminalLib to BdsDxe driver, to add the serial
> > device to  ConIn and ConOut variables 3. Include SerialDxe and
> > TerminalDxe to CoreDxeInclude.dsc and  CoreUefiBootInclude.fdf.
> > 4. Use PcdSerialTerminalEnable to enable/disable this feature.
> > 5. Enable feature for UpXtreme, and disable it for other platform by
> default.
> >
> > Cc: Eric Dong <eric.dong@intel.com>
> > Cc: Chasel Chiu <chasel.chiu@intel.com>
> > Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> > Signed-off-by: Heng Luo <heng.luo@intel.com>
> > ---
> >
> >
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd
> > .dsc                |   1 +
> >  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > |   1 +
> >
> >
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
> > |   1 +
> >  Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > |  15 +++++++++++++--
> >  Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > |   8 +++++++-
> >
> >
> Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerm
> i
> > nalLib.c   | 102
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > ++++++++++++++++++++++++++++++++++++++++
> >
> >
> Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerm
> i
> > nalLib.h   |  48
> > ++++++++++++++++++++++++++++++++++++++++++++++++
> >
> >
> Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerm
> i
> > nalLib.inf |  40 ++++++++++++++++++++++++++++++++++++++++
> >  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > |  25 +++++++++++++++++++++++++
> >  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > |   3 ++-
> >  Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
> > |   1 +
> >
> >
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
> > |   1 +
> >
> >
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg
> > Pcd.dsc            |   1 +
> >  13 files changed, 243 insertions(+), 4 deletions(-)
> >
> > diff --git
> >
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > cd.dsc
> >
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > cd.dsc
> > index d611e99fc1..589b002d06 100644
> > ---
> >
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > cd.dsc
> > +++
> >
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > cd.dsc
> > @@ -131,6 +131,7 @@
> >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> >
> >
> >
> >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> >
> > diff --git
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > index 352416a489..44dacdf082 100644
> > ---
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > +++
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > @@ -130,6 +130,7 @@
> >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> >
> >
> >
> >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> >
> > diff --git
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > sc
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > sc
> > index 9e8b148753..725596cbf7 100644
> > ---
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > sc
> > +++
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > sc
> > @@ -168,6 +168,7 @@
> >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> >
> >
> >
> >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> >
> > diff --git
> > a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > index f0e578f8cc..2a4a574cdf 100644
> > --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > @@ -1,7 +1,7 @@
> >  ## @file
> >
> >  #  Platform description.
> >
> >  #
> >
> > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > reserved.<BR>
> >
> > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > +reserved.<BR>
> >
> >  #
> >
> >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  #
> >
> > @@ -46,7 +46,18 @@
> >
> >
> >
> >
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCount
> e
> > rRuntimeDxe.inf
> >
> >
> >
> > -  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> >
> > +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> >
> > +    <LibraryClasses>
> >
> > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> >
> > +
> > NULL|SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/SerialPort
> > NULL|Term
> > inalLib.inf
> >
> > +!endif
> >
> > +  }
> >
> > +
> >
> > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> >
> > +  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> >
> > +  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> >
> > +!endif
> >
> > +
> >
> >
> >
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> > xe.inf
> >
> >    MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
> >
> >      <LibraryClasses>
> >
> > diff --git
> > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > index 7859c0b1a5..ef4576eedf 100644
> > ---
> > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > +++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fd
> > +++ f
> > @@ -1,7 +1,7 @@
> >  ## @file
> >
> >  #  FDF file of Platform.
> >
> >  #
> >
> > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > reserved.<BR>
> >
> > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > +reserved.<BR>
> >
> >  #
> >
> >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  #
> >
> > @@ -26,6 +26,12 @@ INF
> > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> >  INF
> >
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCount
> e
> > rRuntimeDxe.inf
> >
> >
> >
> >  INF  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> >
> > +
> >
> > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> >
> > +INF  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> >
> > +INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> >
> > +!endif
> >
> > +
> >
> >  INF
> >
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> > xe.inf
> >
> >  INF  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> >
> >  INF
> > MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> >
> > diff --git
> >
> a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.c
> >
> b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.c
> > new file mode 100644
> > index 0000000000..94de475173
> > --- /dev/null
> > +++
> >
> b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.c
> > @@ -0,0 +1,102 @@
> > +/** @file
> >
> > +  Main file for NULL named library for Serial Port Terminal
> > + Redirection
> > library.
> >
> > +
> >
> > +  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> >
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > +
> >
> > +**/
> >
> > +
> >
> > +#include "SerialPortTerminalLib.h"
> >
> > +
> >
> > +GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH
> > mSerialDevicePath = {
> >
> > +  {
> >
> > +    {
> >
> > +      HARDWARE_DEVICE_PATH,
> >
> > +      HW_VENDOR_DP,
> >
> > +      {
> >
> > +        (UINT8) sizeof (VENDOR_DEVICE_PATH),
> >
> > +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
> >
> > +      }
> >
> > +    },
> >
> > +    EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> >
> > +  },
> >
> > +  {
> >
> > +    {
> >
> > +      MESSAGING_DEVICE_PATH,
> >
> > +      MSG_UART_DP,
> >
> > +      {
> >
> > +        (UINT8) sizeof (UART_DEVICE_PATH),
> >
> > +        (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
> >
> > +      }
> >
> > +    },
> >
> > +    0,                  // Reserved
> >
> > +    0,                  // BaudRate
> >
> > +    0,                  // DataBits
> >
> > +    0,                  // Parity
> >
> > +    0                   // StopBits
> >
> > +  },
> >
> > +  {
> >
> > +    {
> >
> > +      MESSAGING_DEVICE_PATH,
> >
> > +      MSG_VENDOR_DP,
> >
> > +      {
> >
> > +        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
> >
> > +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
> >
> > +      }
> >
> > +    },
> >
> > +    DEVICE_PATH_MESSAGING_PC_ANSI
> >
> > +  },
> >
> > +  gEndEntire
> >
> > +};
> >
> > +
> >
> > +/**
> >
> > +  Updates the ConOut, ConIn, ErrOut variables with the serial
> > + terminal
> > device path
> >
> > +  @param                        none
> >
> > +  @retval                       none
> >
> > +**/
> >
> > +VOID
> >
> > +AddSerialTerminal (
> >
> > +  VOID
> >
> > +  )
> >
> > +{
> >
> > +  DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n"));
> >
> > +
> >
> > +  //
> >
> > +  // Append Serial Terminal into "ConIn"
> >
> > +  //
> >
> > +  EfiBootManagerUpdateConsoleVariable (ConOut,
> > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> >
> > +  EfiBootManagerUpdateConsoleVariable (ConIn,
> > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> >
> > +  EfiBootManagerUpdateConsoleVariable (ErrOut,
> > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> >
> > +}
> >
> > +
> >
> > +
> >
> > +/**
> >
> > +  Constructor for the Serial Port Device controller library.
> >
> > +
> >
> > +  @param ImageHandle    the image handle of the process
> >
> > +  @param SystemTable    the EFI System Table pointer
> >
> > +
> >
> > +  @retval EFI_SUCCESS        the shell command handlers were
> > installed sucessfully
> >
> > +  @retval EFI_UNSUPPORTED    the shell level required was not found.
> >
> > +**/
> >
> > +EFI_STATUS
> >
> > +EFIAPI
> >
> > +SerialPortTerminalLibConstructor (
> >
> > +  IN EFI_HANDLE        ImageHandle,
> >
> > +  IN EFI_SYSTEM_TABLE  *SystemTable
> >
> > +  )
> >
> > +{
> >
> > +  mSerialDevicePath.Uart.BaudRate =
> > PcdGet64(PcdSerialTerminalBaudRate);
> >
> > +  mSerialDevicePath.Uart.DataBits =
> > + PcdGet8(PcdSerialTerminalDataBits);
> >
> > +  mSerialDevicePath.Uart.Parity   = PcdGet8(PcdSerialTerminalParity);
> >
> > +  mSerialDevicePath.Uart.StopBits =
> > + PcdGet8(PcdSerialTerminalStopBits);
> >
> > +  DEBUG ((DEBUG_INFO, "[SerialPortTerminalLibConstructor]
> > [%d, %d, %d, %d]\n",
> >
> > +      mSerialDevicePath.Uart.BaudRate,
> >
> > +      mSerialDevicePath.Uart.DataBits,
> >
> > +      mSerialDevicePath.Uart.Parity,
> >
> > +      mSerialDevicePath.Uart.StopBits));
> >
> > +
> >
> > +  AddSerialTerminal();
> >
> > +
> >
> > +  return EFI_SUCCESS;
> >
> > +}
> >
> > diff --git
> >
> a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.h
> >
> b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.h
> > new file mode 100644
> > index 0000000000..0a2eaae8b8
> > --- /dev/null
> > +++
> >
> b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.h
> > @@ -0,0 +1,48 @@
> > +/** @file
> >
> > +  Header file for NULL named library for for Serial Port Terminal
> Redirection
> > library.
> >
> > +
> >
> > +  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> >
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > +
> >
> > +**/
> >
> > +
> >
> > +#ifndef _SERIAL_PORT_TERMINAL_LIB_H_
> >
> > +#define _SERIAL_PORT_TERMINAL_LIB_H_
> >
> > +
> >
> > +#include <Uefi.h>
> >
> > +#include <Guid/SerialPortLibVendor.h>
> >
> > +#include <Library/UefiLib.h>
> >
> > +#include <Library/DevicePathLib.h>
> >
> > +#include <Library/DebugLib.h>
> >
> > +#include <Library/UefiBootManagerLib.h>
> >
> > +
> >
> > +//
> >
> > +// Below is the platform console device path
> >
> > +//
> >
> > +typedef struct {
> >
> > +  VENDOR_DEVICE_PATH        Guid;
> >
> > +  UART_DEVICE_PATH          Uart;
> >
> > +  VENDOR_DEVICE_PATH        TerminalType;
> >
> > +  EFI_DEVICE_PATH_PROTOCOL  End;
> >
> > +} SERIAL_DEVICE_PATH;
> >
> > +
> >
> > +#define gPciRootBridge \
> >
> > +  { \
> >
> > +    { \
> >
> > +      ACPI_DEVICE_PATH, \
> >
> > +      ACPI_DP, \
> >
> > +      { \
> >
> > +        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
> >
> > +        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
> >
> > +      }, \
> >
> > +    }, \
> >
> > +    EISA_PNP_ID (0x0A03), \
> >
> > +    0 \
> >
> > +  }
> >
> > +
> >
> > +#define gEndEntire \
> >
> > +  { \
> >
> > +    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
> > { END_DEVICE_PATH_LENGTH, 0 } \
> >
> > +  }
> >
> > +
> >
> > +#endif
> >
> > diff --git
> >
> a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.inf
> >
> b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.inf
> > new file mode 100644
> > index 0000000000..b0a9326b1b
> > --- /dev/null
> > +++
> >
> b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > minalLib.inf
> > @@ -0,0 +1,40 @@
> > +## @file
> >
> > +# Component information file for Serial Port Terminal Redirection
> > +Library
> >
> > +#
> >
> > +# INTEL CONFIDENTIAL
> >
> > +# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> >
> > +#
> >
> > +# SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > +#
> >
> > +##
> >
> > +[Defines]
> >
> > +  INF_VERSION                    = 0x00010006
> >
> > +  BASE_NAME                      = SerialPortTerminalLib
> >
> > +  FILE_GUID                      =
> > E12BFA46-95F2-4ADC-9774-7E38DE78741E
> >
> > +  MODULE_TYPE                    = UEFI_DRIVER
> >
> > +  VERSION_STRING                 = 1.2
> >
> > +  LIBRARY_CLASS                  = NULL|UEFI_DRIVER DXE_DRIVER
> > DXE_RUNTIME_DRIVER
> >
> > +  CONSTRUCTOR                    =
> > SerialPortTerminalLibConstructor
> >
> > +
> >
> > +[Packages]
> >
> > +  MdePkg/MdePkg.dec
> >
> > +  MdeModulePkg/MdeModulePkg.dec
> >
> > +  BoardModulePkg/BoardModulePkg.dec
> >
> > +  MinPlatformPkg/MinPlatformPkg.dec
> >
> > +
> >
> > +[Sources]
> >
> > +  SerialPortTerminalLib.c
> >
> > +  SerialPortTerminalLib.h
> >
> > +
> >
> > +[LibraryClasses]
> >
> > +  DevicePathLib
> >
> > +  DebugLib
> >
> > +  UefiDriverEntryPoint
> >
> > +  UefiBootManagerLib
> >
> > +  UefiLib
> >
> > +
> >
> > +[Pcd]
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits
> > \ No newline at end of file
> > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > index 7ef189dac8..36050aa1a8 100644
> > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > @@ -205,6 +205,30 @@
> >  [PcdsDynamic, PcdsDynamicEx]
> >
> >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicEnable|0x0|UINT32|0x900000
> > 19
> >
> >
> >
> > +  # The baud rate setting for the UART style device. A value of 0
> >
> > +  # means that the device's default baud rate will be used.
> >
> > +
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate|115200|UINT6
> > 4|0x9000001A
> >
> > +
> >
> > +  # The number of data bits for the UART style device. A value
> >
> > +  # of 0 means that the device's default number of data bits will be
> used.
> >
> > +
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits|0x8|UINT8|0x9
> > 000001B
> >
> > +
> >
> > +  # The parity setting for the UART style device.
> >
> > +  # Parity 0x00 - Default Parity.
> >
> > +  # Parity 0x01 - No Parity.
> >
> > +  # Parity 0x02 - Even Parity.
> >
> > +  # Parity 0x03 - Odd Parity.
> >
> > +  # Parity 0x04 - Mark Parity.
> >
> > +  # Parity 0x05 - Space Parity.
> >
> > +
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity|0x1|UINT8|0x900
> > 0001C
> >
> > +
> >
> > +  # The number of stop bits for the UART style device.
> >
> > +  # Stop Bits 0x00 - Default Stop Bits.
> >
> > +  # Stop Bits 0x01 - 1 Stop Bit.
> >
> > +  # Stop Bits 0x02 - 1.5 Stop Bits.
> >
> > +  # Stop Bits 0x03 - 2 Stop Bits.
> >
> > +
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits|0x1|UINT8|0x9
> > 000001D
> >
> > +
> >
> >  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
> >
> >
> >
> >    ##
> >
> > @@ -318,3 +342,4 @@
> >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable
> > |FALSE|BOOLEAN|0xF00000A5
> >
> >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE|BOOLE
> > AN|0xF00000A6
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable
> > |FALSE|BOOLEAN|0xF00000A7
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable
> > |FALSE|BOOLEAN|0xF00000B0
> >
> > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > index 112ddff7d9..d0b5593817 100644
> > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > @@ -1,7 +1,7 @@
> >  ## @file
> >
> >  #  Platform description.
> >
> >  #
> >
> > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > reserved.<BR>
> >
> > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > +reserved.<BR>
> >
> >  #
> >
> >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  #
> >
> > @@ -44,6 +44,7 @@
> >      gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> >
> >      gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> >
> >      gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
> >
> > +    gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> >
> >
> >
> >
> > ##############################################################
> > ##################
> >
> >  #
> >
> > diff --git
> >
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > c
> >
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > c
> > index 52cdf9ec0f..251f46f812 100644
> > ---
> >
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > c
> > +++
> >
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > c
> > @@ -50,6 +50,7 @@
> >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> >
> >
> >
> >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> >
> > diff --git
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > sc
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > sc
> > index d797ae9d94..e161bf06f4 100644
> > ---
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > sc
> > +++
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > sc
> > @@ -127,6 +127,7 @@
> >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE
> >
> >
> >
> >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> >
> > diff --git
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > kgPcd.dsc
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > kgPcd.dsc
> > index 5d769e8153..83ada3c95c 100644
> > ---
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > kgPcd.dsc
> > +++
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > kgPcd.dsc
> > @@ -127,6 +127,7 @@
> >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> >
> > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> >
> >
> >
> >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> >
> >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> >
> > --
> > 2.24.0.windows.2
> >
> >
> >
> > -=-=-=-=-=-=
> > Groups.io Links: You receive all messages sent to this group.
> > View/Reply Online (#66973):
> > https://edk2.groups.io/g/devel/message/66973
> > Mute This Topic: https://groups.io/mt/78024794/4905953
> > Group Owner: devel+owner@edk2.groups.io
> > Unsubscribe: https://edk2.groups.io/g/devel/unsub
> > [gaoliming@byosoft.com.cn]
> > -=-=-=-=-=-=
> >
> 
> 
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* 回复: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after the shell is loaded
  2020-11-05  1:08   ` Heng Luo
@ 2020-11-05  1:35     ` gaoliming
  2020-11-10  2:13     ` Heng Luo
  1 sibling, 0 replies; 7+ messages in thread
From: gaoliming @ 2020-11-05  1:35 UTC (permalink / raw)
  To: devel, heng.luo
  Cc: 'Dong, Eric', 'Chiu, Chasel',
	'Desimone, Nathaniel L'

Heng:
  I mean to separate them into three patches. The first patch is to update
MinPlatformPkg.dec and MinPlatformPkg.dsc, the second patch is to configure
PCD in the board dsc, the last one is to add SerialPortTerminalLib and
update the include DSC/FDF file.
	
Thanks
Liming
> -----邮件原件-----
> 发件人: bounce+27952+67012+4905953+8761045@groups.io
> <bounce+27952+67012+4905953+8761045@groups.io> 代表 Heng Luo
> 发送时间: 2020年11月5日 9:08
> 收件人: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> 抄送: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> 主题: Re: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after
the
> shell is loaded
> 
> Hi Liming,
> 
> I think not, if I separate it into 2 patch for MinPlatformPkg and
> OpenBoardPkgPcd, it will cause OpenBoard platform build error if it applys
> MinPlatformPkg patch only because PcdSerialTerminalEnable is  not defined.
> 
> 
> Thanks,
> Heng
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > gaoliming
> > Sent: Thursday, November 5, 2020 8:55 AM
> > To: devel@edk2.groups.io; Luo, Heng <heng.luo@intel.com>
> > Cc: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>;
> > Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> > Subject: 回复: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect
> after
> > the shell is loaded
> >
> > Heng:
> >  Can you separate the patch for the different packages? If so, it will
be
> easily
> > to be reviewed.
> >
> > Thanks
> > Liming
> > > -----邮件原件-----
> > > 发件人: bounce+27952+66973+4905953+8761045@groups.io
> > > <bounce+27952+66973+4905953+8761045@groups.io> 代表 Heng Luo
> > > 发送时间: 2020年11月4日 16:06
> > > 收件人: devel@edk2.groups.io
> > > 抄送: Eric Dong <eric.dong@intel.com>; Chasel Chiu
> > > <chasel.chiu@intel.com>; Nate DeSimone
> > > <nathaniel.l.desimone@intel.com>
> > > 主题: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after
the
> > > shell is loaded
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3014
> > >
> > > Use SerialPortTerminalLib to get console redirect after the shell is
> > > loaded:
> > > 1. Add SerialPortTerminalLib to MinPlatformPkg/Library, add PCDs to
> > > configure serial port.
> > > 2. Add SerialPortTerminalLib to BdsDxe driver, to add the serial
> > > device to  ConIn and ConOut variables 3. Include SerialDxe and
> > > TerminalDxe to CoreDxeInclude.dsc and  CoreUefiBootInclude.fdf.
> > > 4. Use PcdSerialTerminalEnable to enable/disable this feature.
> > > 5. Enable feature for UpXtreme, and disable it for other platform by
> > default.
> > >
> > > Cc: Eric Dong <eric.dong@intel.com>
> > > Cc: Chasel Chiu <chasel.chiu@intel.com>
> > > Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> > > Signed-off-by: Heng Luo <heng.luo@intel.com>
> > > ---
> > >
> > >
> >
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd
> > > .dsc                |   1 +
> > >
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > |   1 +
> > >
> > >
> >
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
> > > |   1 +
> > >  Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > |  15 +++++++++++++--
> > >  Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > |   8 +++++++-
> > >
> > >
> >
> Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerm
> > i
> > > nalLib.c   | 102
> > >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > ++++++++++++++++++++++++++++++++++++++++
> > >
> > >
> >
> Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerm
> > i
> > > nalLib.h   |  48
> > > ++++++++++++++++++++++++++++++++++++++++++++++++
> > >
> > >
> >
> Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTerm
> > i
> > > nalLib.inf |  40 ++++++++++++++++++++++++++++++++++++++++
> > >  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > |  25 +++++++++++++++++++++++++
> > >  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > |   3 ++-
> > >
> Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
> > > |   1 +
> > >
> > >
> >
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
> > > |   1 +
> > >
> > >
> >
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg
> > > Pcd.dsc            |   1 +
> > >  13 files changed, 243 insertions(+), 4 deletions(-)
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > cd.dsc
> > >
> >
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > cd.dsc
> > > index d611e99fc1..589b002d06 100644
> > > ---
> > >
> >
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > cd.dsc
> > > +++
> > >
> >
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > cd.dsc
> > > @@ -131,6 +131,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > index 352416a489..44dacdf082 100644
> > > ---
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > +++
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > @@ -130,6 +130,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > sc
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > sc
> > > index 9e8b148753..725596cbf7 100644
> > > ---
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > sc
> > > +++
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > sc
> > > @@ -168,6 +168,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > diff --git
> > > a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > index f0e578f8cc..2a4a574cdf 100644
> > > --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > @@ -1,7 +1,7 @@
> > >  ## @file
> > >
> > >  #  Platform description.
> > >
> > >  #
> > >
> > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > reserved.<BR>
> > >
> > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > +reserved.<BR>
> > >
> > >  #
> > >
> > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  #
> > >
> > > @@ -46,7 +46,18 @@
> > >
> > >
> > >
> > >
> > MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCount
> > e
> > > rRuntimeDxe.inf
> > >
> > >
> > >
> > > -  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > >
> > > +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> > >
> > > +    <LibraryClasses>
> > >
> > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> > >
> > > +
> > > NULL|SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/SerialPort
> > > NULL|Term
> > > inalLib.inf
> > >
> > > +!endif
> > >
> > > +  }
> > >
> > > +
> > >
> > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> > >
> > > +  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> > >
> > > +  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> > >
> > > +!endif
> > >
> > > +
> > >
> > >
> > >
> >
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> > > xe.inf
> > >
> > >    MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
> > >
> > >      <LibraryClasses>
> > >
> > > diff --git
> > > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > index 7859c0b1a5..ef4576eedf 100644
> > > ---
> > > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > +++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fd
> > > +++ f
> > > @@ -1,7 +1,7 @@
> > >  ## @file
> > >
> > >  #  FDF file of Platform.
> > >
> > >  #
> > >
> > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > reserved.<BR>
> > >
> > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > +reserved.<BR>
> > >
> > >  #
> > >
> > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  #
> > >
> > > @@ -26,6 +26,12 @@ INF
> > > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > >  INF
> > >
> > MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCount
> > e
> > > rRuntimeDxe.inf
> > >
> > >
> > >
> > >  INF  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > >
> > > +
> > >
> > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> > >
> > > +INF  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> > >
> > > +INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> > >
> > > +!endif
> > >
> > > +
> > >
> > >  INF
> > >
> >
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> > > xe.inf
> > >
> > >  INF  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> > >
> > >  INF
> > > MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> > >
> > > diff --git
> > >
> >
>
a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > > minalLib.c
> > >
> >
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > > minalLib.c
> > > new file mode 100644
> > > index 0000000000..94de475173
> > > --- /dev/null
> > > +++
> > >
> >
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > > minalLib.c
> > > @@ -0,0 +1,102 @@
> > > +/** @file
> > >
> > > +  Main file for NULL named library for Serial Port Terminal
> > > + Redirection
> > > library.
> > >
> > > +
> > >
> > > +  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > >
> > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > +
> > >
> > > +**/
> > >
> > > +
> > >
> > > +#include "SerialPortTerminalLib.h"
> > >
> > > +
> > >
> > > +GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH
> > > mSerialDevicePath = {
> > >
> > > +  {
> > >
> > > +    {
> > >
> > > +      HARDWARE_DEVICE_PATH,
> > >
> > > +      HW_VENDOR_DP,
> > >
> > > +      {
> > >
> > > +        (UINT8) sizeof (VENDOR_DEVICE_PATH),
> > >
> > > +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
> > >
> > > +      }
> > >
> > > +    },
> > >
> > > +    EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> > >
> > > +  },
> > >
> > > +  {
> > >
> > > +    {
> > >
> > > +      MESSAGING_DEVICE_PATH,
> > >
> > > +      MSG_UART_DP,
> > >
> > > +      {
> > >
> > > +        (UINT8) sizeof (UART_DEVICE_PATH),
> > >
> > > +        (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
> > >
> > > +      }
> > >
> > > +    },
> > >
> > > +    0,                  // Reserved
> > >
> > > +    0,                  // BaudRate
> > >
> > > +    0,                  // DataBits
> > >
> > > +    0,                  // Parity
> > >
> > > +    0                   // StopBits
> > >
> > > +  },
> > >
> > > +  {
> > >
> > > +    {
> > >
> > > +      MESSAGING_DEVICE_PATH,
> > >
> > > +      MSG_VENDOR_DP,
> > >
> > > +      {
> > >
> > > +        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
> > >
> > > +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
> > >
> > > +      }
> > >
> > > +    },
> > >
> > > +    DEVICE_PATH_MESSAGING_PC_ANSI
> > >
> > > +  },
> > >
> > > +  gEndEntire
> > >
> > > +};
> > >
> > > +
> > >
> > > +/**
> > >
> > > +  Updates the ConOut, ConIn, ErrOut variables with the serial
> > > + terminal
> > > device path
> > >
> > > +  @param                        none
> > >
> > > +  @retval                       none
> > >
> > > +**/
> > >
> > > +VOID
> > >
> > > +AddSerialTerminal (
> > >
> > > +  VOID
> > >
> > > +  )
> > >
> > > +{
> > >
> > > +  DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n"));
> > >
> > > +
> > >
> > > +  //
> > >
> > > +  // Append Serial Terminal into "ConIn"
> > >
> > > +  //
> > >
> > > +  EfiBootManagerUpdateConsoleVariable (ConOut,
> > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > >
> > > +  EfiBootManagerUpdateConsoleVariable (ConIn,
> > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > >
> > > +  EfiBootManagerUpdateConsoleVariable (ErrOut,
> > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > >
> > > +}
> > >
> > > +
> > >
> > > +
> > >
> > > +/**
> > >
> > > +  Constructor for the Serial Port Device controller library.
> > >
> > > +
> > >
> > > +  @param ImageHandle    the image handle of the process
> > >
> > > +  @param SystemTable    the EFI System Table pointer
> > >
> > > +
> > >
> > > +  @retval EFI_SUCCESS        the shell command handlers were
> > > installed sucessfully
> > >
> > > +  @retval EFI_UNSUPPORTED    the shell level required was not
> found.
> > >
> > > +**/
> > >
> > > +EFI_STATUS
> > >
> > > +EFIAPI
> > >
> > > +SerialPortTerminalLibConstructor (
> > >
> > > +  IN EFI_HANDLE        ImageHandle,
> > >
> > > +  IN EFI_SYSTEM_TABLE  *SystemTable
> > >
> > > +  )
> > >
> > > +{
> > >
> > > +  mSerialDevicePath.Uart.BaudRate =
> > > PcdGet64(PcdSerialTerminalBaudRate);
> > >
> > > +  mSerialDevicePath.Uart.DataBits =
> > > + PcdGet8(PcdSerialTerminalDataBits);
> > >
> > > +  mSerialDevicePath.Uart.Parity   = PcdGet8(PcdSerialTerminalParity);
> > >
> > > +  mSerialDevicePath.Uart.StopBits =
> > > + PcdGet8(PcdSerialTerminalStopBits);
> > >
> > > +  DEBUG ((DEBUG_INFO, "[SerialPortTerminalLibConstructor]
> > > [%d, %d, %d, %d]\n",
> > >
> > > +      mSerialDevicePath.Uart.BaudRate,
> > >
> > > +      mSerialDevicePath.Uart.DataBits,
> > >
> > > +      mSerialDevicePath.Uart.Parity,
> > >
> > > +      mSerialDevicePath.Uart.StopBits));
> > >
> > > +
> > >
> > > +  AddSerialTerminal();
> > >
> > > +
> > >
> > > +  return EFI_SUCCESS;
> > >
> > > +}
> > >
> > > diff --git
> > >
> >
>
a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > > minalLib.h
> > >
> >
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > > minalLib.h
> > > new file mode 100644
> > > index 0000000000..0a2eaae8b8
> > > --- /dev/null
> > > +++
> > >
> >
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > > minalLib.h
> > > @@ -0,0 +1,48 @@
> > > +/** @file
> > >
> > > +  Header file for NULL named library for for Serial Port Terminal
> > Redirection
> > > library.
> > >
> > > +
> > >
> > > +  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > >
> > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > +
> > >
> > > +**/
> > >
> > > +
> > >
> > > +#ifndef _SERIAL_PORT_TERMINAL_LIB_H_
> > >
> > > +#define _SERIAL_PORT_TERMINAL_LIB_H_
> > >
> > > +
> > >
> > > +#include <Uefi.h>
> > >
> > > +#include <Guid/SerialPortLibVendor.h>
> > >
> > > +#include <Library/UefiLib.h>
> > >
> > > +#include <Library/DevicePathLib.h>
> > >
> > > +#include <Library/DebugLib.h>
> > >
> > > +#include <Library/UefiBootManagerLib.h>
> > >
> > > +
> > >
> > > +//
> > >
> > > +// Below is the platform console device path
> > >
> > > +//
> > >
> > > +typedef struct {
> > >
> > > +  VENDOR_DEVICE_PATH        Guid;
> > >
> > > +  UART_DEVICE_PATH          Uart;
> > >
> > > +  VENDOR_DEVICE_PATH        TerminalType;
> > >
> > > +  EFI_DEVICE_PATH_PROTOCOL  End;
> > >
> > > +} SERIAL_DEVICE_PATH;
> > >
> > > +
> > >
> > > +#define gPciRootBridge \
> > >
> > > +  { \
> > >
> > > +    { \
> > >
> > > +      ACPI_DEVICE_PATH, \
> > >
> > > +      ACPI_DP, \
> > >
> > > +      { \
> > >
> > > +        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
> > >
> > > +        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
> > >
> > > +      }, \
> > >
> > > +    }, \
> > >
> > > +    EISA_PNP_ID (0x0A03), \
> > >
> > > +    0 \
> > >
> > > +  }
> > >
> > > +
> > >
> > > +#define gEndEntire \
> > >
> > > +  { \
> > >
> > > +    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
> > > { END_DEVICE_PATH_LENGTH, 0 } \
> > >
> > > +  }
> > >
> > > +
> > >
> > > +#endif
> > >
> > > diff --git
> > >
> >
>
a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > > minalLib.inf
> > >
> >
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > > minalLib.inf
> > > new file mode 100644
> > > index 0000000000..b0a9326b1b
> > > --- /dev/null
> > > +++
> > >
> >
>
b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPortTer
> > > minalLib.inf
> > > @@ -0,0 +1,40 @@
> > > +## @file
> > >
> > > +# Component information file for Serial Port Terminal Redirection
> > > +Library
> > >
> > > +#
> > >
> > > +# INTEL CONFIDENTIAL
> > >
> > > +# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > >
> > > +#
> > >
> > > +# SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > +#
> > >
> > > +##
> > >
> > > +[Defines]
> > >
> > > +  INF_VERSION                    = 0x00010006
> > >
> > > +  BASE_NAME                      = SerialPortTerminalLib
> > >
> > > +  FILE_GUID                      =
> > > E12BFA46-95F2-4ADC-9774-7E38DE78741E
> > >
> > > +  MODULE_TYPE                    = UEFI_DRIVER
> > >
> > > +  VERSION_STRING                 = 1.2
> > >
> > > +  LIBRARY_CLASS                  = NULL|UEFI_DRIVER
> DXE_DRIVER
> > > DXE_RUNTIME_DRIVER
> > >
> > > +  CONSTRUCTOR                    =
> > > SerialPortTerminalLibConstructor
> > >
> > > +
> > >
> > > +[Packages]
> > >
> > > +  MdePkg/MdePkg.dec
> > >
> > > +  MdeModulePkg/MdeModulePkg.dec
> > >
> > > +  BoardModulePkg/BoardModulePkg.dec
> > >
> > > +  MinPlatformPkg/MinPlatformPkg.dec
> > >
> > > +
> > >
> > > +[Sources]
> > >
> > > +  SerialPortTerminalLib.c
> > >
> > > +  SerialPortTerminalLib.h
> > >
> > > +
> > >
> > > +[LibraryClasses]
> > >
> > > +  DevicePathLib
> > >
> > > +  DebugLib
> > >
> > > +  UefiDriverEntryPoint
> > >
> > > +  UefiBootManagerLib
> > >
> > > +  UefiLib
> > >
> > > +
> > >
> > > +[Pcd]
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits
> > > \ No newline at end of file
> > > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > index 7ef189dac8..36050aa1a8 100644
> > > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > @@ -205,6 +205,30 @@
> > >  [PcdsDynamic, PcdsDynamicEx]
> > >
> > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicEnable|0x0|UINT32|0x900000
> > > 19
> > >
> > >
> > >
> > > +  # The baud rate setting for the UART style device. A value of 0
> > >
> > > +  # means that the device's default baud rate will be used.
> > >
> > > +
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate|115200|UINT6
> > > 4|0x9000001A
> > >
> > > +
> > >
> > > +  # The number of data bits for the UART style device. A value
> > >
> > > +  # of 0 means that the device's default number of data bits will be
> > used.
> > >
> > > +
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits|0x8|UINT8|0x9
> > > 000001B
> > >
> > > +
> > >
> > > +  # The parity setting for the UART style device.
> > >
> > > +  # Parity 0x00 - Default Parity.
> > >
> > > +  # Parity 0x01 - No Parity.
> > >
> > > +  # Parity 0x02 - Even Parity.
> > >
> > > +  # Parity 0x03 - Odd Parity.
> > >
> > > +  # Parity 0x04 - Mark Parity.
> > >
> > > +  # Parity 0x05 - Space Parity.
> > >
> > > +
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity|0x1|UINT8|0x900
> > > 0001C
> > >
> > > +
> > >
> > > +  # The number of stop bits for the UART style device.
> > >
> > > +  # Stop Bits 0x00 - Default Stop Bits.
> > >
> > > +  # Stop Bits 0x01 - 1 Stop Bit.
> > >
> > > +  # Stop Bits 0x02 - 1.5 Stop Bits.
> > >
> > > +  # Stop Bits 0x03 - 2 Stop Bits.
> > >
> > > +
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits|0x1|UINT8|0x9
> > > 000001D
> > >
> > > +
> > >
> > >  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic,
> PcdsDynamicEx]
> > >
> > >
> > >
> > >    ##
> > >
> > > @@ -318,3 +342,4 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable
> > > |FALSE|BOOLEAN|0xF00000A5
> > >
> > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE|BOOLE
> > > AN|0xF00000A6
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable
> > > |FALSE|BOOLEAN|0xF00000A7
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable
> > > |FALSE|BOOLEAN|0xF00000B0
> > >
> > > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > index 112ddff7d9..d0b5593817 100644
> > > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > @@ -1,7 +1,7 @@
> > >  ## @file
> > >
> > >  #  Platform description.
> > >
> > >  #
> > >
> > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > reserved.<BR>
> > >
> > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > +reserved.<BR>
> > >
> > >  #
> > >
> > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  #
> > >
> > > @@ -44,6 +44,7 @@
> > >      gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >      gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >
> gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
> > >
> > > +    gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >
> > >
> ##############################################################
> > > ##################
> > >
> > >  #
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > c
> > >
> >
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > c
> > > index 52cdf9ec0f..251f46f812 100644
> > > ---
> > >
> >
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > c
> > > +++
> > >
> >
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > c
> > > @@ -50,6 +50,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > sc
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > sc
> > > index d797ae9d94..e161bf06f4 100644
> > > ---
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > sc
> > > +++
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > sc
> > > @@ -127,6 +127,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > kgPcd.dsc
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > kgPcd.dsc
> > > index 5d769e8153..83ada3c95c 100644
> > > ---
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > kgPcd.dsc
> > > +++
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > kgPcd.dsc
> > > @@ -127,6 +127,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > --
> > > 2.24.0.windows.2
> > >
> > >
> > >
> > > -=-=-=-=-=-=
> > > Groups.io Links: You receive all messages sent to this group.
> > > View/Reply Online (#66973):
> > > https://edk2.groups.io/g/devel/message/66973
> > > Mute This Topic: https://groups.io/mt/78024794/4905953
> > > Group Owner: devel+owner@edk2.groups.io
> > > Unsubscribe: https://edk2.groups.io/g/devel/unsub
> > > [gaoliming@byosoft.com.cn]
> > > -=-=-=-=-=-=
> > >
> >
> >
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after the shell is loaded
  2020-11-05  1:08   ` Heng Luo
  2020-11-05  1:35     ` 回复: " gaoliming
@ 2020-11-10  2:13     ` Heng Luo
  2020-11-10 14:15       ` 回复: " gaoliming
  1 sibling, 1 reply; 7+ messages in thread
From: Heng Luo @ 2020-11-10  2:13 UTC (permalink / raw)
  To: devel@edk2.groups.io, gaoliming@byosoft.com.cn
  Cc: Dong, Eric, Chiu, Chasel, Desimone, Nathaniel L

Dear all,
Any comments about Patch V4?

Thanks,
Heng

> -----Original Message-----
> From: Luo, Heng
> Sent: Thursday, November 5, 2020 9:08 AM
> To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> Cc: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>;
> Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> Subject: RE: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after
> the shell is loaded
> 
> Hi Liming,
> 
> I think not, if I separate it into 2 patch for MinPlatformPkg and
> OpenBoardPkgPcd, it will cause OpenBoard platform build error if it applys
> MinPlatformPkg patch only because PcdSerialTerminalEnable is  not defined.
> 
> 
> Thanks,
> Heng
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > gaoliming
> > Sent: Thursday, November 5, 2020 8:55 AM
> > To: devel@edk2.groups.io; Luo, Heng <heng.luo@intel.com>
> > Cc: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel
> > <chasel.chiu@intel.com>; Desimone, Nathaniel L
> > <nathaniel.l.desimone@intel.com>
> > Subject: 回复: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect
> > after the shell is loaded
> >
> > Heng:
> >  Can you separate the patch for the different packages? If so, it will
> > be easily to be reviewed.
> >
> > Thanks
> > Liming
> > > -----邮件原件-----
> > > 发件人: bounce+27952+66973+4905953+8761045@groups.io
> > > <bounce+27952+66973+4905953+8761045@groups.io> 代表 Heng Luo
> > > 发送时间: 2020年11月4日 16:06
> > > 收件人: devel@edk2.groups.io
> > > 抄送: Eric Dong <eric.dong@intel.com>; Chasel Chiu
> > > <chasel.chiu@intel.com>; Nate DeSimone
> > > <nathaniel.l.desimone@intel.com>
> > > 主题: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after
> > > the shell is loaded
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3014
> > >
> > > Use SerialPortTerminalLib to get console redirect after the shell is
> > > loaded:
> > > 1. Add SerialPortTerminalLib to MinPlatformPkg/Library, add PCDs to
> > > configure serial port.
> > > 2. Add SerialPortTerminalLib to BdsDxe driver, to add the serial
> > > device to  ConIn and ConOut variables 3. Include SerialDxe and
> > > TerminalDxe to CoreDxeInclude.dsc and  CoreUefiBootInclude.fdf.
> > > 4. Use PcdSerialTerminalEnable to enable/disable this feature.
> > > 5. Enable feature for UpXtreme, and disable it for other platform by
> > default.
> > >
> > > Cc: Eric Dong <eric.dong@intel.com>
> > > Cc: Chasel Chiu <chasel.chiu@intel.com>
> > > Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> > > Signed-off-by: Heng Luo <heng.luo@intel.com>
> > > ---
> > >
> > >
> >
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd
> > > .dsc                |   1 +
> > >
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > |   1 +
> > >
> > >
> >
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
> > > |   1 +
> > >  Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > |  15 +++++++++++++--
> > >  Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > |   8 +++++++-
> > >
> > >
> > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPort
> > Term
> > i
> > > nalLib.c   | 102
> > >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > ++++++++++++++++++++++++++++++++++++++++
> > >
> > >
> > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPort
> > Term
> > i
> > > nalLib.h   |  48
> > > ++++++++++++++++++++++++++++++++++++++++++++++++
> > >
> > >
> > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPort
> > Term
> > i
> > > nalLib.inf |  40 ++++++++++++++++++++++++++++++++++++++++
> > >  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > |  25 +++++++++++++++++++++++++
> > >  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > |   3 ++-
> > >
> Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
> > > |   1 +
> > >
> > >
> >
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
> > > |   1 +
> > >
> > >
> >
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg
> > > Pcd.dsc            |   1 +
> > >  13 files changed, 243 insertions(+), 4 deletions(-)
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > cd.dsc
> > >
> >
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > cd.dsc
> > > index d611e99fc1..589b002d06 100644
> > > ---
> > >
> >
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > cd.dsc
> > > +++
> > >
> >
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > cd.dsc
> > > @@ -131,6 +131,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > index 352416a489..44dacdf082 100644
> > > ---
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > +++
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > @@ -130,6 +130,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > sc
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > sc
> > > index 9e8b148753..725596cbf7 100644
> > > ---
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > sc
> > > +++
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > sc
> > > @@ -168,6 +168,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > diff --git
> > > a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > index f0e578f8cc..2a4a574cdf 100644
> > > --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > @@ -1,7 +1,7 @@
> > >  ## @file
> > >
> > >  #  Platform description.
> > >
> > >  #
> > >
> > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > reserved.<BR>
> > >
> > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > +reserved.<BR>
> > >
> > >  #
> > >
> > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  #
> > >
> > > @@ -46,7 +46,18 @@
> > >
> > >
> > >
> > >
> >
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCount
> > e
> > > rRuntimeDxe.inf
> > >
> > >
> > >
> > > -  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > >
> > > +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> > >
> > > +    <LibraryClasses>
> > >
> > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> > >
> > > +
> > > NULL|SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/SerialPo
> > > NULL|rt
> > > NULL|Term
> > > inalLib.inf
> > >
> > > +!endif
> > >
> > > +  }
> > >
> > > +
> > >
> > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> > >
> > > +  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> > >
> > > +  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> > >
> > > +!endif
> > >
> > > +
> > >
> > >
> > >
> >
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> > > xe.inf
> > >
> > >    MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
> > >
> > >      <LibraryClasses>
> > >
> > > diff --git
> > > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > index 7859c0b1a5..ef4576eedf 100644
> > > ---
> > > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > +++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.
> > > +++ fd
> > > +++ f
> > > @@ -1,7 +1,7 @@
> > >  ## @file
> > >
> > >  #  FDF file of Platform.
> > >
> > >  #
> > >
> > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > reserved.<BR>
> > >
> > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > +reserved.<BR>
> > >
> > >  #
> > >
> > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  #
> > >
> > > @@ -26,6 +26,12 @@ INF
> > > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > >  INF
> > >
> >
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCount
> > e
> > > rRuntimeDxe.inf
> > >
> > >
> > >
> > >  INF  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > >
> > > +
> > >
> > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> > >
> > > +INF  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> > >
> > > +INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> > >
> > > +!endif
> > >
> > > +
> > >
> > >  INF
> > >
> >
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> > > xe.inf
> > >
> > >  INF  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> > >
> > >  INF
> > > MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> > >
> > > diff --git
> > >
> > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTer
> > > minalLib.c
> > >
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTer
> > > minalLib.c
> > > new file mode 100644
> > > index 0000000000..94de475173
> > > --- /dev/null
> > > +++
> > >
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTer
> > > minalLib.c
> > > @@ -0,0 +1,102 @@
> > > +/** @file
> > >
> > > +  Main file for NULL named library for Serial Port Terminal
> > > + Redirection
> > > library.
> > >
> > > +
> > >
> > > +  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > >
> > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > +
> > >
> > > +**/
> > >
> > > +
> > >
> > > +#include "SerialPortTerminalLib.h"
> > >
> > > +
> > >
> > > +GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH
> > > mSerialDevicePath = {
> > >
> > > +  {
> > >
> > > +    {
> > >
> > > +      HARDWARE_DEVICE_PATH,
> > >
> > > +      HW_VENDOR_DP,
> > >
> > > +      {
> > >
> > > +        (UINT8) sizeof (VENDOR_DEVICE_PATH),
> > >
> > > +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
> > >
> > > +      }
> > >
> > > +    },
> > >
> > > +    EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> > >
> > > +  },
> > >
> > > +  {
> > >
> > > +    {
> > >
> > > +      MESSAGING_DEVICE_PATH,
> > >
> > > +      MSG_UART_DP,
> > >
> > > +      {
> > >
> > > +        (UINT8) sizeof (UART_DEVICE_PATH),
> > >
> > > +        (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
> > >
> > > +      }
> > >
> > > +    },
> > >
> > > +    0,                  // Reserved
> > >
> > > +    0,                  // BaudRate
> > >
> > > +    0,                  // DataBits
> > >
> > > +    0,                  // Parity
> > >
> > > +    0                   // StopBits
> > >
> > > +  },
> > >
> > > +  {
> > >
> > > +    {
> > >
> > > +      MESSAGING_DEVICE_PATH,
> > >
> > > +      MSG_VENDOR_DP,
> > >
> > > +      {
> > >
> > > +        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
> > >
> > > +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
> > >
> > > +      }
> > >
> > > +    },
> > >
> > > +    DEVICE_PATH_MESSAGING_PC_ANSI
> > >
> > > +  },
> > >
> > > +  gEndEntire
> > >
> > > +};
> > >
> > > +
> > >
> > > +/**
> > >
> > > +  Updates the ConOut, ConIn, ErrOut variables with the serial
> > > + terminal
> > > device path
> > >
> > > +  @param                        none
> > >
> > > +  @retval                       none
> > >
> > > +**/
> > >
> > > +VOID
> > >
> > > +AddSerialTerminal (
> > >
> > > +  VOID
> > >
> > > +  )
> > >
> > > +{
> > >
> > > +  DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n"));
> > >
> > > +
> > >
> > > +  //
> > >
> > > +  // Append Serial Terminal into "ConIn"
> > >
> > > +  //
> > >
> > > +  EfiBootManagerUpdateConsoleVariable (ConOut,
> > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > >
> > > +  EfiBootManagerUpdateConsoleVariable (ConIn,
> > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > >
> > > +  EfiBootManagerUpdateConsoleVariable (ErrOut,
> > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > >
> > > +}
> > >
> > > +
> > >
> > > +
> > >
> > > +/**
> > >
> > > +  Constructor for the Serial Port Device controller library.
> > >
> > > +
> > >
> > > +  @param ImageHandle    the image handle of the process
> > >
> > > +  @param SystemTable    the EFI System Table pointer
> > >
> > > +
> > >
> > > +  @retval EFI_SUCCESS        the shell command handlers were
> > > installed sucessfully
> > >
> > > +  @retval EFI_UNSUPPORTED    the shell level required was not found.
> > >
> > > +**/
> > >
> > > +EFI_STATUS
> > >
> > > +EFIAPI
> > >
> > > +SerialPortTerminalLibConstructor (
> > >
> > > +  IN EFI_HANDLE        ImageHandle,
> > >
> > > +  IN EFI_SYSTEM_TABLE  *SystemTable
> > >
> > > +  )
> > >
> > > +{
> > >
> > > +  mSerialDevicePath.Uart.BaudRate =
> > > PcdGet64(PcdSerialTerminalBaudRate);
> > >
> > > +  mSerialDevicePath.Uart.DataBits =
> > > + PcdGet8(PcdSerialTerminalDataBits);
> > >
> > > +  mSerialDevicePath.Uart.Parity   = PcdGet8(PcdSerialTerminalParity);
> > >
> > > +  mSerialDevicePath.Uart.StopBits =
> > > + PcdGet8(PcdSerialTerminalStopBits);
> > >
> > > +  DEBUG ((DEBUG_INFO, "[SerialPortTerminalLibConstructor]
> > > [%d, %d, %d, %d]\n",
> > >
> > > +      mSerialDevicePath.Uart.BaudRate,
> > >
> > > +      mSerialDevicePath.Uart.DataBits,
> > >
> > > +      mSerialDevicePath.Uart.Parity,
> > >
> > > +      mSerialDevicePath.Uart.StopBits));
> > >
> > > +
> > >
> > > +  AddSerialTerminal();
> > >
> > > +
> > >
> > > +  return EFI_SUCCESS;
> > >
> > > +}
> > >
> > > diff --git
> > >
> > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTer
> > > minalLib.h
> > >
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTer
> > > minalLib.h
> > > new file mode 100644
> > > index 0000000000..0a2eaae8b8
> > > --- /dev/null
> > > +++
> > >
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTer
> > > minalLib.h
> > > @@ -0,0 +1,48 @@
> > > +/** @file
> > >
> > > +  Header file for NULL named library for for Serial Port Terminal
> > Redirection
> > > library.
> > >
> > > +
> > >
> > > +  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > >
> > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > +
> > >
> > > +**/
> > >
> > > +
> > >
> > > +#ifndef _SERIAL_PORT_TERMINAL_LIB_H_
> > >
> > > +#define _SERIAL_PORT_TERMINAL_LIB_H_
> > >
> > > +
> > >
> > > +#include <Uefi.h>
> > >
> > > +#include <Guid/SerialPortLibVendor.h>
> > >
> > > +#include <Library/UefiLib.h>
> > >
> > > +#include <Library/DevicePathLib.h>
> > >
> > > +#include <Library/DebugLib.h>
> > >
> > > +#include <Library/UefiBootManagerLib.h>
> > >
> > > +
> > >
> > > +//
> > >
> > > +// Below is the platform console device path
> > >
> > > +//
> > >
> > > +typedef struct {
> > >
> > > +  VENDOR_DEVICE_PATH        Guid;
> > >
> > > +  UART_DEVICE_PATH          Uart;
> > >
> > > +  VENDOR_DEVICE_PATH        TerminalType;
> > >
> > > +  EFI_DEVICE_PATH_PROTOCOL  End;
> > >
> > > +} SERIAL_DEVICE_PATH;
> > >
> > > +
> > >
> > > +#define gPciRootBridge \
> > >
> > > +  { \
> > >
> > > +    { \
> > >
> > > +      ACPI_DEVICE_PATH, \
> > >
> > > +      ACPI_DP, \
> > >
> > > +      { \
> > >
> > > +        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
> > >
> > > +        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
> > >
> > > +      }, \
> > >
> > > +    }, \
> > >
> > > +    EISA_PNP_ID (0x0A03), \
> > >
> > > +    0 \
> > >
> > > +  }
> > >
> > > +
> > >
> > > +#define gEndEntire \
> > >
> > > +  { \
> > >
> > > +    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
> > > { END_DEVICE_PATH_LENGTH, 0 } \
> > >
> > > +  }
> > >
> > > +
> > >
> > > +#endif
> > >
> > > diff --git
> > >
> > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTer
> > > minalLib.inf
> > >
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTer
> > > minalLib.inf
> > > new file mode 100644
> > > index 0000000000..b0a9326b1b
> > > --- /dev/null
> > > +++
> > >
> > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > rtTer
> > > minalLib.inf
> > > @@ -0,0 +1,40 @@
> > > +## @file
> > >
> > > +# Component information file for Serial Port Terminal Redirection
> > > +Library
> > >
> > > +#
> > >
> > > +# INTEL CONFIDENTIAL
> > >
> > > +# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > >
> > > +#
> > >
> > > +# SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > +#
> > >
> > > +##
> > >
> > > +[Defines]
> > >
> > > +  INF_VERSION                    = 0x00010006
> > >
> > > +  BASE_NAME                      = SerialPortTerminalLib
> > >
> > > +  FILE_GUID                      =
> > > E12BFA46-95F2-4ADC-9774-7E38DE78741E
> > >
> > > +  MODULE_TYPE                    = UEFI_DRIVER
> > >
> > > +  VERSION_STRING                 = 1.2
> > >
> > > +  LIBRARY_CLASS                  = NULL|UEFI_DRIVER DXE_DRIVER
> > > DXE_RUNTIME_DRIVER
> > >
> > > +  CONSTRUCTOR                    =
> > > SerialPortTerminalLibConstructor
> > >
> > > +
> > >
> > > +[Packages]
> > >
> > > +  MdePkg/MdePkg.dec
> > >
> > > +  MdeModulePkg/MdeModulePkg.dec
> > >
> > > +  BoardModulePkg/BoardModulePkg.dec
> > >
> > > +  MinPlatformPkg/MinPlatformPkg.dec
> > >
> > > +
> > >
> > > +[Sources]
> > >
> > > +  SerialPortTerminalLib.c
> > >
> > > +  SerialPortTerminalLib.h
> > >
> > > +
> > >
> > > +[LibraryClasses]
> > >
> > > +  DevicePathLib
> > >
> > > +  DebugLib
> > >
> > > +  UefiDriverEntryPoint
> > >
> > > +  UefiBootManagerLib
> > >
> > > +  UefiLib
> > >
> > > +
> > >
> > > +[Pcd]
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits
> > > \ No newline at end of file
> > > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > index 7ef189dac8..36050aa1a8 100644
> > > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > @@ -205,6 +205,30 @@
> > >  [PcdsDynamic, PcdsDynamicEx]
> > >
> > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicEnable|0x0|UINT32|0x900000
> > > 19
> > >
> > >
> > >
> > > +  # The baud rate setting for the UART style device. A value of 0
> > >
> > > +  # means that the device's default baud rate will be used.
> > >
> > > +
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate|115200|UINT6
> > > 4|0x9000001A
> > >
> > > +
> > >
> > > +  # The number of data bits for the UART style device. A value
> > >
> > > +  # of 0 means that the device's default number of data bits will
> > > + be
> > used.
> > >
> > > +
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits|0x8|UINT8|0x9
> > > 000001B
> > >
> > > +
> > >
> > > +  # The parity setting for the UART style device.
> > >
> > > +  # Parity 0x00 - Default Parity.
> > >
> > > +  # Parity 0x01 - No Parity.
> > >
> > > +  # Parity 0x02 - Even Parity.
> > >
> > > +  # Parity 0x03 - Odd Parity.
> > >
> > > +  # Parity 0x04 - Mark Parity.
> > >
> > > +  # Parity 0x05 - Space Parity.
> > >
> > > +
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity|0x1|UINT8|0x900
> > > 0001C
> > >
> > > +
> > >
> > > +  # The number of stop bits for the UART style device.
> > >
> > > +  # Stop Bits 0x00 - Default Stop Bits.
> > >
> > > +  # Stop Bits 0x01 - 1 Stop Bit.
> > >
> > > +  # Stop Bits 0x02 - 1.5 Stop Bits.
> > >
> > > +  # Stop Bits 0x03 - 2 Stop Bits.
> > >
> > > +
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits|0x1|UINT8|0x9
> > > 000001D
> > >
> > > +
> > >
> > >  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic,
> > > PcdsDynamicEx]
> > >
> > >
> > >
> > >    ##
> > >
> > > @@ -318,3 +342,4 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable
> > > |FALSE|BOOLEAN|0xF00000A5
> > >
> > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE|BOOLE
> > > AN|0xF00000A6
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable
> > > |FALSE|BOOLEAN|0xF00000A7
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable
> > > |FALSE|BOOLEAN|0xF00000B0
> > >
> > > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > index 112ddff7d9..d0b5593817 100644
> > > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > @@ -1,7 +1,7 @@
> > >  ## @file
> > >
> > >  #  Platform description.
> > >
> > >  #
> > >
> > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > reserved.<BR>
> > >
> > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > +reserved.<BR>
> > >
> > >  #
> > >
> > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > >  #
> > >
> > > @@ -44,6 +44,7 @@
> > >      gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >      gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >      gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
> > >
> > > +    gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >
> > >
> ##############################################################
> > > ##################
> > >
> > >  #
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > c
> > >
> >
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > c
> > > index 52cdf9ec0f..251f46f812 100644
> > > ---
> > >
> >
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > c
> > > +++
> > >
> >
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > c
> > > @@ -50,6 +50,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > sc
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > sc
> > > index d797ae9d94..e161bf06f4 100644
> > > ---
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > sc
> > > +++
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > sc
> > > @@ -127,6 +127,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > diff --git
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > kgPcd.dsc
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > kgPcd.dsc
> > > index 5d769e8153..83ada3c95c 100644
> > > ---
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > kgPcd.dsc
> > > +++
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > kgPcd.dsc
> > > @@ -127,6 +127,7 @@
> > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > >
> > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > >
> > >
> > >
> > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > >
> > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > >
> > > --
> > > 2.24.0.windows.2
> > >
> > >
> > >
> > > -=-=-=-=-=-=
> > > Groups.io Links: You receive all messages sent to this group.
> > > View/Reply Online (#66973):
> > > https://edk2.groups.io/g/devel/message/66973
> > > Mute This Topic: https://groups.io/mt/78024794/4905953
> > > Group Owner: devel+owner@edk2.groups.io
> > > Unsubscribe: https://edk2.groups.io/g/devel/unsub
> > > [gaoliming@byosoft.com.cn]
> > > -=-=-=-=-=-=
> > >
> >
> >
> >
> >
> >
> > 
> >


^ permalink raw reply	[flat|nested] 7+ messages in thread

* 回复: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after the shell is loaded
  2020-11-10  2:13     ` Heng Luo
@ 2020-11-10 14:15       ` gaoliming
  2020-11-11  5:57         ` Heng Luo
  0 siblings, 1 reply; 7+ messages in thread
From: gaoliming @ 2020-11-10 14:15 UTC (permalink / raw)
  To: 'Luo, Heng', devel
  Cc: 'Dong, Eric', 'Chiu, Chasel',
	'Desimone, Nathaniel L'

Heng:
  I gave my comments on https://edk2.groups.io/g/devel/message/67016. Do you
check it?

Liming
> -----邮件原件-----
> 发件人: Luo, Heng <heng.luo@intel.com>
> 发送时间: 2020年11月10日 10:14
> 收件人: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> 抄送: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> 主题: RE: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after
the
> shell is loaded
> 
> Dear all,
> Any comments about Patch V4?
> 
> Thanks,
> Heng
> 
> > -----Original Message-----
> > From: Luo, Heng
> > Sent: Thursday, November 5, 2020 9:08 AM
> > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > Cc: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>;
> > Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> > Subject: RE: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect
after
> > the shell is loaded
> >
> > Hi Liming,
> >
> > I think not, if I separate it into 2 patch for MinPlatformPkg and
> > OpenBoardPkgPcd, it will cause OpenBoard platform build error if it
applys
> > MinPlatformPkg patch only because PcdSerialTerminalEnable is  not
> defined.
> >
> >
> > Thanks,
> > Heng
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > > gaoliming
> > > Sent: Thursday, November 5, 2020 8:55 AM
> > > To: devel@edk2.groups.io; Luo, Heng <heng.luo@intel.com>
> > > Cc: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel
> > > <chasel.chiu@intel.com>; Desimone, Nathaniel L
> > > <nathaniel.l.desimone@intel.com>
> > > Subject: 回复: [edk2-devel] [Patch V4] MinPlatformPkg: console
redirect
> > > after the shell is loaded
> > >
> > > Heng:
> > >  Can you separate the patch for the different packages? If so, it will
> > > be easily to be reviewed.
> > >
> > > Thanks
> > > Liming
> > > > -----邮件原件-----
> > > > 发件人: bounce+27952+66973+4905953+8761045@groups.io
> > > > <bounce+27952+66973+4905953+8761045@groups.io> 代表 Heng
> Luo
> > > > 发送时间: 2020年11月4日 16:06
> > > > 收件人: devel@edk2.groups.io
> > > > 抄送: Eric Dong <eric.dong@intel.com>; Chasel Chiu
> > > > <chasel.chiu@intel.com>; Nate DeSimone
> > > > <nathaniel.l.desimone@intel.com>
> > > > 主题: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after
> > > > the shell is loaded
> > > >
> > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3014
> > > >
> > > > Use SerialPortTerminalLib to get console redirect after the shell is
> > > > loaded:
> > > > 1. Add SerialPortTerminalLib to MinPlatformPkg/Library, add PCDs to
> > > > configure serial port.
> > > > 2. Add SerialPortTerminalLib to BdsDxe driver, to add the serial
> > > > device to  ConIn and ConOut variables 3. Include SerialDxe and
> > > > TerminalDxe to CoreDxeInclude.dsc and  CoreUefiBootInclude.fdf.
> > > > 4. Use PcdSerialTerminalEnable to enable/disable this feature.
> > > > 5. Enable feature for UpXtreme, and disable it for other platform by
> > > default.
> > > >
> > > > Cc: Eric Dong <eric.dong@intel.com>
> > > > Cc: Chasel Chiu <chasel.chiu@intel.com>
> > > > Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> > > > Signed-off-by: Heng Luo <heng.luo@intel.com>
> > > > ---
> > > >
> > > >
> > >
> >
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd
> > > > .dsc                |   1 +
> > > >
> > Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > > |   1 +
> > > >
> > > >
> > >
> >
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
> > > > |   1 +
> > > >  Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > > |  15 +++++++++++++--
> > > >  Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > > |   8 +++++++-
> > > >
> > > >
> > > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPort
> > > Term
> > > i
> > > > nalLib.c   | 102
> > > >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > > ++++++++++++++++++++++++++++++++++++++++
> > > >
> > > >
> > > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPort
> > > Term
> > > i
> > > > nalLib.h   |  48
> > > > ++++++++++++++++++++++++++++++++++++++++++++++++
> > > >
> > > >
> > > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPort
> > > Term
> > > i
> > > > nalLib.inf |  40 ++++++++++++++++++++++++++++++++++++++++
> > > >  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > > |  25 +++++++++++++++++++++++++
> > > >  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > > |   3 ++-
> > > >
> > Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
> > > > |   1 +
> > > >
> > > >
> > >
> >
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
> > > > |   1 +
> > > >
> > > >
> > >
> >
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg
> > > > Pcd.dsc            |   1 +
> > > >  13 files changed, 243 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git
> > > >
> > >
> >
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > > cd.dsc
> > > >
> > >
> >
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > > cd.dsc
> > > > index d611e99fc1..589b002d06 100644
> > > > ---
> > > >
> > >
> >
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > > cd.dsc
> > > > +++
> > > >
> > >
> >
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > > cd.dsc
> > > > @@ -131,6 +131,7 @@
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > >
> > > >
> > > >
> > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > >
> > > > diff --git
> > > >
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > >
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > > index 352416a489..44dacdf082 100644
> > > > ---
> > > >
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > > +++
> > > >
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > > @@ -130,6 +130,7 @@
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > >
> > > >
> > > >
> > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > >
> > > > diff --git
> > > >
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > > sc
> > > >
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > > sc
> > > > index 9e8b148753..725596cbf7 100644
> > > > ---
> > > >
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > > sc
> > > > +++
> > > >
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > > sc
> > > > @@ -168,6 +168,7 @@
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > >
> > > >
> > > >
> > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > >
> > > > diff --git
> > > > a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > > b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > > index f0e578f8cc..2a4a574cdf 100644
> > > > --- a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > > +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > > @@ -1,7 +1,7 @@
> > > >  ## @file
> > > >
> > > >  #  Platform description.
> > > >
> > > >  #
> > > >
> > > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > > reserved.<BR>
> > > >
> > > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > > +reserved.<BR>
> > > >
> > > >  #
> > > >
> > > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > > >
> > > >  #
> > > >
> > > > @@ -46,7 +46,18 @@
> > > >
> > > >
> > > >
> > > >
> > >
> > MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCount
> > > e
> > > > rRuntimeDxe.inf
> > > >
> > > >
> > > >
> > > > -  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > > >
> > > > +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> > > >
> > > > +    <LibraryClasses>
> > > >
> > > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> > > >
> > > > +
> > > > NULL|SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/SerialPo
> > > > NULL|rt
> > > > NULL|Term
> > > > inalLib.inf
> > > >
> > > > +!endif
> > > >
> > > > +  }
> > > >
> > > > +
> > > >
> > > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> > > >
> > > > +  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> > > >
> > > > +  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> > > >
> > > > +!endif
> > > >
> > > > +
> > > >
> > > >
> > > >
> > >
> >
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> > > > xe.inf
> > > >
> > > >    MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
> > > >
> > > >      <LibraryClasses>
> > > >
> > > > diff --git
> > > > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > > b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > > index 7859c0b1a5..ef4576eedf 100644
> > > > ---
> > > > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fdf
> > > > +++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.
> > > > +++ fd
> > > > +++ f
> > > > @@ -1,7 +1,7 @@
> > > >  ## @file
> > > >
> > > >  #  FDF file of Platform.
> > > >
> > > >  #
> > > >
> > > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > > reserved.<BR>
> > > >
> > > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > > +reserved.<BR>
> > > >
> > > >  #
> > > >
> > > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > > >
> > > >  #
> > > >
> > > > @@ -26,6 +26,12 @@ INF
> > > >
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > > >  INF
> > > >
> > >
> > MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCount
> > > e
> > > > rRuntimeDxe.inf
> > > >
> > > >
> > > >
> > > >  INF  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > > >
> > > > +
> > > >
> > > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable == TRUE
> > > >
> > > > +INF  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> > > >
> > > > +INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> > > >
> > > > +!endif
> > > >
> > > > +
> > > >
> > > >  INF
> > > >
> > >
> >
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> > > > xe.inf
> > > >
> > > >  INF  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> > > >
> > > >  INF
> > > > MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> > > >
> > > > diff --git
> > > >
> > > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > > rtTer
> > > > minalLib.c
> > > >
> > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > > rtTer
> > > > minalLib.c
> > > > new file mode 100644
> > > > index 0000000000..94de475173
> > > > --- /dev/null
> > > > +++
> > > >
> > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > > rtTer
> > > > minalLib.c
> > > > @@ -0,0 +1,102 @@
> > > > +/** @file
> > > >
> > > > +  Main file for NULL named library for Serial Port Terminal
> > > > + Redirection
> > > > library.
> > > >
> > > > +
> > > >
> > > > +  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > > >
> > > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > > >
> > > > +
> > > >
> > > > +**/
> > > >
> > > > +
> > > >
> > > > +#include "SerialPortTerminalLib.h"
> > > >
> > > > +
> > > >
> > > > +GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH
> > > > mSerialDevicePath = {
> > > >
> > > > +  {
> > > >
> > > > +    {
> > > >
> > > > +      HARDWARE_DEVICE_PATH,
> > > >
> > > > +      HW_VENDOR_DP,
> > > >
> > > > +      {
> > > >
> > > > +        (UINT8) sizeof (VENDOR_DEVICE_PATH),
> > > >
> > > > +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
> > > >
> > > > +      }
> > > >
> > > > +    },
> > > >
> > > > +    EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> > > >
> > > > +  },
> > > >
> > > > +  {
> > > >
> > > > +    {
> > > >
> > > > +      MESSAGING_DEVICE_PATH,
> > > >
> > > > +      MSG_UART_DP,
> > > >
> > > > +      {
> > > >
> > > > +        (UINT8) sizeof (UART_DEVICE_PATH),
> > > >
> > > > +        (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
> > > >
> > > > +      }
> > > >
> > > > +    },
> > > >
> > > > +    0,                  // Reserved
> > > >
> > > > +    0,                  // BaudRate
> > > >
> > > > +    0,                  // DataBits
> > > >
> > > > +    0,                  // Parity
> > > >
> > > > +    0                   // StopBits
> > > >
> > > > +  },
> > > >
> > > > +  {
> > > >
> > > > +    {
> > > >
> > > > +      MESSAGING_DEVICE_PATH,
> > > >
> > > > +      MSG_VENDOR_DP,
> > > >
> > > > +      {
> > > >
> > > > +        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
> > > >
> > > > +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
> > > >
> > > > +      }
> > > >
> > > > +    },
> > > >
> > > > +    DEVICE_PATH_MESSAGING_PC_ANSI
> > > >
> > > > +  },
> > > >
> > > > +  gEndEntire
> > > >
> > > > +};
> > > >
> > > > +
> > > >
> > > > +/**
> > > >
> > > > +  Updates the ConOut, ConIn, ErrOut variables with the serial
> > > > + terminal
> > > > device path
> > > >
> > > > +  @param                        none
> > > >
> > > > +  @retval                       none
> > > >
> > > > +**/
> > > >
> > > > +VOID
> > > >
> > > > +AddSerialTerminal (
> > > >
> > > > +  VOID
> > > >
> > > > +  )
> > > >
> > > > +{
> > > >
> > > > +  DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n"));
> > > >
> > > > +
> > > >
> > > > +  //
> > > >
> > > > +  // Append Serial Terminal into "ConIn"
> > > >
> > > > +  //
> > > >
> > > > +  EfiBootManagerUpdateConsoleVariable (ConOut,
> > > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > > >
> > > > +  EfiBootManagerUpdateConsoleVariable (ConIn,
> > > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > > >
> > > > +  EfiBootManagerUpdateConsoleVariable (ErrOut,
> > > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > > >
> > > > +}
> > > >
> > > > +
> > > >
> > > > +
> > > >
> > > > +/**
> > > >
> > > > +  Constructor for the Serial Port Device controller library.
> > > >
> > > > +
> > > >
> > > > +  @param ImageHandle    the image handle of the process
> > > >
> > > > +  @param SystemTable    the EFI System Table pointer
> > > >
> > > > +
> > > >
> > > > +  @retval EFI_SUCCESS        the shell command handlers were
> > > > installed sucessfully
> > > >
> > > > +  @retval EFI_UNSUPPORTED    the shell level required was not
> found.
> > > >
> > > > +**/
> > > >
> > > > +EFI_STATUS
> > > >
> > > > +EFIAPI
> > > >
> > > > +SerialPortTerminalLibConstructor (
> > > >
> > > > +  IN EFI_HANDLE        ImageHandle,
> > > >
> > > > +  IN EFI_SYSTEM_TABLE  *SystemTable
> > > >
> > > > +  )
> > > >
> > > > +{
> > > >
> > > > +  mSerialDevicePath.Uart.BaudRate =
> > > > PcdGet64(PcdSerialTerminalBaudRate);
> > > >
> > > > +  mSerialDevicePath.Uart.DataBits =
> > > > + PcdGet8(PcdSerialTerminalDataBits);
> > > >
> > > > +  mSerialDevicePath.Uart.Parity   =
> PcdGet8(PcdSerialTerminalParity);
> > > >
> > > > +  mSerialDevicePath.Uart.StopBits =
> > > > + PcdGet8(PcdSerialTerminalStopBits);
> > > >
> > > > +  DEBUG ((DEBUG_INFO, "[SerialPortTerminalLibConstructor]
> > > > [%d, %d, %d, %d]\n",
> > > >
> > > > +      mSerialDevicePath.Uart.BaudRate,
> > > >
> > > > +      mSerialDevicePath.Uart.DataBits,
> > > >
> > > > +      mSerialDevicePath.Uart.Parity,
> > > >
> > > > +      mSerialDevicePath.Uart.StopBits));
> > > >
> > > > +
> > > >
> > > > +  AddSerialTerminal();
> > > >
> > > > +
> > > >
> > > > +  return EFI_SUCCESS;
> > > >
> > > > +}
> > > >
> > > > diff --git
> > > >
> > > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > > rtTer
> > > > minalLib.h
> > > >
> > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > > rtTer
> > > > minalLib.h
> > > > new file mode 100644
> > > > index 0000000000..0a2eaae8b8
> > > > --- /dev/null
> > > > +++
> > > >
> > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > > rtTer
> > > > minalLib.h
> > > > @@ -0,0 +1,48 @@
> > > > +/** @file
> > > >
> > > > +  Header file for NULL named library for for Serial Port Terminal
> > > Redirection
> > > > library.
> > > >
> > > > +
> > > >
> > > > +  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > > >
> > > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > > >
> > > > +
> > > >
> > > > +**/
> > > >
> > > > +
> > > >
> > > > +#ifndef _SERIAL_PORT_TERMINAL_LIB_H_
> > > >
> > > > +#define _SERIAL_PORT_TERMINAL_LIB_H_
> > > >
> > > > +
> > > >
> > > > +#include <Uefi.h>
> > > >
> > > > +#include <Guid/SerialPortLibVendor.h>
> > > >
> > > > +#include <Library/UefiLib.h>
> > > >
> > > > +#include <Library/DevicePathLib.h>
> > > >
> > > > +#include <Library/DebugLib.h>
> > > >
> > > > +#include <Library/UefiBootManagerLib.h>
> > > >
> > > > +
> > > >
> > > > +//
> > > >
> > > > +// Below is the platform console device path
> > > >
> > > > +//
> > > >
> > > > +typedef struct {
> > > >
> > > > +  VENDOR_DEVICE_PATH        Guid;
> > > >
> > > > +  UART_DEVICE_PATH          Uart;
> > > >
> > > > +  VENDOR_DEVICE_PATH        TerminalType;
> > > >
> > > > +  EFI_DEVICE_PATH_PROTOCOL  End;
> > > >
> > > > +} SERIAL_DEVICE_PATH;
> > > >
> > > > +
> > > >
> > > > +#define gPciRootBridge \
> > > >
> > > > +  { \
> > > >
> > > > +    { \
> > > >
> > > > +      ACPI_DEVICE_PATH, \
> > > >
> > > > +      ACPI_DP, \
> > > >
> > > > +      { \
> > > >
> > > > +        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
> > > >
> > > > +        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
> > > >
> > > > +      }, \
> > > >
> > > > +    }, \
> > > >
> > > > +    EISA_PNP_ID (0x0A03), \
> > > >
> > > > +    0 \
> > > >
> > > > +  }
> > > >
> > > > +
> > > >
> > > > +#define gEndEntire \
> > > >
> > > > +  { \
> > > >
> > > > +    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
> > > > { END_DEVICE_PATH_LENGTH, 0 } \
> > > >
> > > > +  }
> > > >
> > > > +
> > > >
> > > > +#endif
> > > >
> > > > diff --git
> > > >
> > > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > > rtTer
> > > > minalLib.inf
> > > >
> > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > > rtTer
> > > > minalLib.inf
> > > > new file mode 100644
> > > > index 0000000000..b0a9326b1b
> > > > --- /dev/null
> > > > +++
> > > >
> > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/SerialPo
> > > rtTer
> > > > minalLib.inf
> > > > @@ -0,0 +1,40 @@
> > > > +## @file
> > > >
> > > > +# Component information file for Serial Port Terminal Redirection
> > > > +Library
> > > >
> > > > +#
> > > >
> > > > +# INTEL CONFIDENTIAL
> > > >
> > > > +# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > > >
> > > > +#
> > > >
> > > > +# SPDX-License-Identifier: BSD-2-Clause-Patent
> > > >
> > > > +#
> > > >
> > > > +##
> > > >
> > > > +[Defines]
> > > >
> > > > +  INF_VERSION                    = 0x00010006
> > > >
> > > > +  BASE_NAME                      = SerialPortTerminalLib
> > > >
> > > > +  FILE_GUID                      =
> > > > E12BFA46-95F2-4ADC-9774-7E38DE78741E
> > > >
> > > > +  MODULE_TYPE                    = UEFI_DRIVER
> > > >
> > > > +  VERSION_STRING                 = 1.2
> > > >
> > > > +  LIBRARY_CLASS                  = NULL|UEFI_DRIVER
> DXE_DRIVER
> > > > DXE_RUNTIME_DRIVER
> > > >
> > > > +  CONSTRUCTOR                    =
> > > > SerialPortTerminalLibConstructor
> > > >
> > > > +
> > > >
> > > > +[Packages]
> > > >
> > > > +  MdePkg/MdePkg.dec
> > > >
> > > > +  MdeModulePkg/MdeModulePkg.dec
> > > >
> > > > +  BoardModulePkg/BoardModulePkg.dec
> > > >
> > > > +  MinPlatformPkg/MinPlatformPkg.dec
> > > >
> > > > +
> > > >
> > > > +[Sources]
> > > >
> > > > +  SerialPortTerminalLib.c
> > > >
> > > > +  SerialPortTerminalLib.h
> > > >
> > > > +
> > > >
> > > > +[LibraryClasses]
> > > >
> > > > +  DevicePathLib
> > > >
> > > > +  DebugLib
> > > >
> > > > +  UefiDriverEntryPoint
> > > >
> > > > +  UefiBootManagerLib
> > > >
> > > > +  UefiLib
> > > >
> > > > +
> > > >
> > > > +[Pcd]
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits
> > > > \ No newline at end of file
> > > > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > > index 7ef189dac8..36050aa1a8 100644
> > > > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > > @@ -205,6 +205,30 @@
> > > >  [PcdsDynamic, PcdsDynamicEx]
> > > >
> > > >
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicEnable|0x0|UINT32|0x900000
> > > > 19
> > > >
> > > >
> > > >
> > > > +  # The baud rate setting for the UART style device. A value of 0
> > > >
> > > > +  # means that the device's default baud rate will be used.
> > > >
> > > > +
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate|115200|UINT6
> > > > 4|0x9000001A
> > > >
> > > > +
> > > >
> > > > +  # The number of data bits for the UART style device. A value
> > > >
> > > > +  # of 0 means that the device's default number of data bits will
> > > > + be
> > > used.
> > > >
> > > > +
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits|0x8|UINT8|0x9
> > > > 000001B
> > > >
> > > > +
> > > >
> > > > +  # The parity setting for the UART style device.
> > > >
> > > > +  # Parity 0x00 - Default Parity.
> > > >
> > > > +  # Parity 0x01 - No Parity.
> > > >
> > > > +  # Parity 0x02 - Even Parity.
> > > >
> > > > +  # Parity 0x03 - Odd Parity.
> > > >
> > > > +  # Parity 0x04 - Mark Parity.
> > > >
> > > > +  # Parity 0x05 - Space Parity.
> > > >
> > > > +
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity|0x1|UINT8|0x900
> > > > 0001C
> > > >
> > > > +
> > > >
> > > > +  # The number of stop bits for the UART style device.
> > > >
> > > > +  # Stop Bits 0x00 - Default Stop Bits.
> > > >
> > > > +  # Stop Bits 0x01 - 1 Stop Bit.
> > > >
> > > > +  # Stop Bits 0x02 - 1.5 Stop Bits.
> > > >
> > > > +  # Stop Bits 0x03 - 2 Stop Bits.
> > > >
> > > > +
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits|0x1|UINT8|0x9
> > > > 000001D
> > > >
> > > > +
> > > >
> > > >  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic,
> > > > PcdsDynamicEx]
> > > >
> > > >
> > > >
> > > >    ##
> > > >
> > > > @@ -318,3 +342,4 @@
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable
> > > > |FALSE|BOOLEAN|0xF00000A5
> > > >
> > > >
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE|BOOLE
> > > > AN|0xF00000A6
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable
> > > > |FALSE|BOOLEAN|0xF00000A7
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable
> > > > |FALSE|BOOLEAN|0xF00000B0
> > > >
> > > > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > > index 112ddff7d9..d0b5593817 100644
> > > > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > > @@ -1,7 +1,7 @@
> > > >  ## @file
> > > >
> > > >  #  Platform description.
> > > >
> > > >  #
> > > >
> > > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > > reserved.<BR>
> > > >
> > > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > > +reserved.<BR>
> > > >
> > > >  #
> > > >
> > > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > > >
> > > >  #
> > > >
> > > > @@ -44,6 +44,7 @@
> > > >      gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > >
> > > >      gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > >
> > > >
> gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
> > > >
> > > > +    gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > >
> > > >
> > > >
> > > >
> > > >
> >
> ##############################################################
> > > > ##################
> > > >
> > > >  #
> > > >
> > > > diff --git
> > > >
> > >
> >
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > > c
> > > >
> > >
> >
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > > c
> > > > index 52cdf9ec0f..251f46f812 100644
> > > > ---
> > > >
> > >
> >
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > > c
> > > > +++
> > > >
> > >
> >
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > > c
> > > > @@ -50,6 +50,7 @@
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > >
> > > >
> > > >
> > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > >
> > > > diff --git
> > > >
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > > sc
> > > >
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > > sc
> > > > index d797ae9d94..e161bf06f4 100644
> > > > ---
> > > >
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > > sc
> > > > +++
> > > >
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > > sc
> > > > @@ -127,6 +127,7 @@
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE
> > > >
> > > >
> > > >
> > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > >
> > > > diff --git
> > > >
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > > kgPcd.dsc
> > > >
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > > kgPcd.dsc
> > > > index 5d769e8153..83ada3c95c 100644
> > > > ---
> > > >
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > > kgPcd.dsc
> > > > +++
> > > >
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > > kgPcd.dsc
> > > > @@ -127,6 +127,7 @@
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > >
> > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > >
> > > >
> > > >
> > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > >
> > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > >
> > > > --
> > > > 2.24.0.windows.2
> > > >
> > > >
> > > >
> > > > -=-=-=-=-=-=
> > > > Groups.io Links: You receive all messages sent to this group.
> > > > View/Reply Online (#66973):
> > > > https://edk2.groups.io/g/devel/message/66973
> > > > Mute This Topic: https://groups.io/mt/78024794/4905953
> > > > Group Owner: devel+owner@edk2.groups.io
> > > > Unsubscribe: https://edk2.groups.io/g/devel/unsub
> > > > [gaoliming@byosoft.com.cn]
> > > > -=-=-=-=-=-=
> > > >
> > >
> > >
> > >
> > >
> > >
> > > 
> > >




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after the shell is loaded
  2020-11-10 14:15       ` 回复: " gaoliming
@ 2020-11-11  5:57         ` Heng Luo
  0 siblings, 0 replies; 7+ messages in thread
From: Heng Luo @ 2020-11-11  5:57 UTC (permalink / raw)
  To: gaoliming, devel@edk2.groups.io
  Cc: Dong, Eric, Chiu, Chasel, Desimone, Nathaniel L

Hi Liming,
Sorry, I missed your comments, I will send out Patch V5.
Thank you for your review.

Thanks,
Heng

> -----Original Message-----
> From: gaoliming <gaoliming@byosoft.com.cn>
> Sent: Tuesday, November 10, 2020 10:16 PM
> To: Luo, Heng <heng.luo@intel.com>; devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>;
> Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> Subject: 回复: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after
> the shell is loaded
> 
> Heng:
>   I gave my comments on https://edk2.groups.io/g/devel/message/67016. Do
> you check it?
> 
> Liming
> > -----邮件原件-----
> > 发件人: Luo, Heng <heng.luo@intel.com>
> > 发送时间: 2020年11月10日 10:14
> > 收件人: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > 抄送: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel
> > <chasel.chiu@intel.com>; Desimone, Nathaniel L
> > <nathaniel.l.desimone@intel.com>
> > 主题: RE: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect after
> the
> > shell is loaded
> >
> > Dear all,
> > Any comments about Patch V4?
> >
> > Thanks,
> > Heng
> >
> > > -----Original Message-----
> > > From: Luo, Heng
> > > Sent: Thursday, November 5, 2020 9:08 AM
> > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn
> > > Cc: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel
> > <chasel.chiu@intel.com>;
> > > Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> > > Subject: RE: [edk2-devel] [Patch V4] MinPlatformPkg: console
> > > redirect
> after
> > > the shell is loaded
> > >
> > > Hi Liming,
> > >
> > > I think not, if I separate it into 2 patch for MinPlatformPkg and
> > > OpenBoardPkgPcd, it will cause OpenBoard platform build error if it
> applys
> > > MinPlatformPkg patch only because PcdSerialTerminalEnable is  not
> > defined.
> > >
> > >
> > > Thanks,
> > > Heng
> > >
> > > > -----Original Message-----
> > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> > > > gaoliming
> > > > Sent: Thursday, November 5, 2020 8:55 AM
> > > > To: devel@edk2.groups.io; Luo, Heng <heng.luo@intel.com>
> > > > Cc: Dong, Eric <eric.dong@intel.com>; Chiu, Chasel
> > > > <chasel.chiu@intel.com>; Desimone, Nathaniel L
> > > > <nathaniel.l.desimone@intel.com>
> > > > Subject: 回复: [edk2-devel] [Patch V4] MinPlatformPkg: console
> redirect
> > > > after the shell is loaded
> > > >
> > > > Heng:
> > > >  Can you separate the patch for the different packages? If so, it
> > > > will be easily to be reviewed.
> > > >
> > > > Thanks
> > > > Liming
> > > > > -----邮件原件-----
> > > > > 发件人: bounce+27952+66973+4905953+8761045@groups.io
> > > > > <bounce+27952+66973+4905953+8761045@groups.io> 代表 Heng
> > Luo
> > > > > 发送时间: 2020年11月4日 16:06
> > > > > 收件人: devel@edk2.groups.io
> > > > > 抄送: Eric Dong <eric.dong@intel.com>; Chasel Chiu
> > > > > <chasel.chiu@intel.com>; Nate DeSimone
> > > > > <nathaniel.l.desimone@intel.com>
> > > > > 主题: [edk2-devel] [Patch V4] MinPlatformPkg: console redirect
> > > > > after the shell is loaded
> > > > >
> > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3014
> > > > >
> > > > > Use SerialPortTerminalLib to get console redirect after the
> > > > > shell is
> > > > > loaded:
> > > > > 1. Add SerialPortTerminalLib to MinPlatformPkg/Library, add PCDs
> > > > > to configure serial port.
> > > > > 2. Add SerialPortTerminalLib to BdsDxe driver, to add the serial
> > > > > device to  ConIn and ConOut variables 3. Include SerialDxe and
> > > > > TerminalDxe to CoreDxeInclude.dsc and  CoreUefiBootInclude.fdf.
> > > > > 4. Use PcdSerialTerminalEnable to enable/disable this feature.
> > > > > 5. Enable feature for UpXtreme, and disable it for other
> > > > > platform by
> > > > default.
> > > > >
> > > > > Cc: Eric Dong <eric.dong@intel.com>
> > > > > Cc: Chasel Chiu <chasel.chiu@intel.com>
> > > > > Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> > > > > Signed-off-by: Heng Luo <heng.luo@intel.com>
> > > > > ---
> > > > >
> > > > >
> > > >
> > >
> >
> Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgPcd
> > > > > .dsc                |   1 +
> > > > >
> > >
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > > > |   1 +
> > > > >
> > > > >
> > > >
> > >
> >
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
> > > > > |   1 +
> > > > >  Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > > > |  15 +++++++++++++--
> > > > >
> > > > > Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.fd
> > > > > f
> > > > > |   8 +++++++-
> > > > >
> > > > >
> > > > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Serial
> > > > Port
> > > > Term
> > > > i
> > > > > nalLib.c   | 102
> > > > >
> > >
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > > > ++++++++++++++++++++++++++++++++++++++++
> > > > >
> > > > >
> > > > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Serial
> > > > Port
> > > > Term
> > > > i
> > > > > nalLib.h   |  48
> > > > > ++++++++++++++++++++++++++++++++++++++++++++++++
> > > > >
> > > > >
> > > > Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Serial
> > > > Port
> > > > Term
> > > > i
> > > > > nalLib.inf |  40 ++++++++++++++++++++++++++++++++++++++++
> > > > >  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > > > |  25 +++++++++++++++++++++++++
> > > > >  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > > > |   3 ++-
> > > > >
> > >
> Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
> > > > > |   1 +
> > > > >
> > > > >
> > > >
> > >
> >
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
> > > > > |   1 +
> > > > >
> > > > >
> > > >
> > >
> >
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg
> > > > > Pcd.dsc            |   1 +
> > > > >  13 files changed, 243 insertions(+), 4 deletions(-)
> > > > >
> > > > > diff --git
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > > > cd.dsc
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > > > cd.dsc
> > > > > index d611e99fc1..589b002d06 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > > > cd.dsc
> > > > > +++
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkgP
> > > > > cd.dsc
> > > > > @@ -131,6 +131,7 @@
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > > >
> > > > >
> > > > >
> > > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > > >
> > > > > diff --git
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > > > index 352416a489..44dacdf082 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > > > +++
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> > > > > @@ -130,6 +130,7 @@
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > > >
> > > > >
> > > > >
> > > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > > >
> > > > > diff --git
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > > > sc
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > > > sc
> > > > > index 9e8b148753..725596cbf7 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > > > sc
> > > > > +++
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d
> > > > > sc
> > > > > @@ -168,6 +168,7 @@
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > > >
> > > > >
> > > > >
> > > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > > >
> > > > > diff --git
> > > > > a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > > > b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > > > index f0e578f8cc..2a4a574cdf 100644
> > > > > ---
> > > > > a/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.dsc
> > > > > +++ b/Platform/Intel/MinPlatformPkg/Include/Dsc/CoreDxeInclude.d
> > > > > +++ sc
> > > > > @@ -1,7 +1,7 @@
> > > > >  ## @file
> > > > >
> > > > >  #  Platform description.
> > > > >
> > > > >  #
> > > > >
> > > > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > > > reserved.<BR>
> > > > >
> > > > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > > > +reserved.<BR>
> > > > >
> > > > >  #
> > > > >
> > > > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > > > >
> > > > >  #
> > > > >
> > > > > @@ -46,7 +46,18 @@
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCount
> > > > e
> > > > > rRuntimeDxe.inf
> > > > >
> > > > >
> > > > >
> > > > > -  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > > > >
> > > > > +  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{
> > > > >
> > > > > +    <LibraryClasses>
> > > > >
> > > > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable ==
> > > > > +TRUE
> > > > >
> > > > > +
> > > > > NULL|SerialTerminalFeaturePkg/Library/SerialPortTerminalLib/Seri
> > > > > NULL|alPo
> > > > > NULL|rt
> > > > > NULL|Term
> > > > > inalLib.inf
> > > > >
> > > > > +!endif
> > > > >
> > > > > +  }
> > > > >
> > > > > +
> > > > >
> > > > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable ==
> > > > > +TRUE
> > > > >
> > > > > +  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> > > > >
> > > > > +  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> > > > >
> > > > > +!endif
> > > > >
> > > > > +
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> > > > > xe.inf
> > > > >
> > > > >    MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
> > > > >
> > > > >      <LibraryClasses>
> > > > >
> > > > > diff --git
> > > > > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.
> > > > > fdf
> > > > > b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.
> > > > > fdf index 7859c0b1a5..ef4576eedf 100644
> > > > > ---
> > > > > a/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.
> > > > > fdf
> > > > > +++
> b/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreUefiBootInclude.
> > > > > +++ fd
> > > > > +++ f
> > > > > @@ -1,7 +1,7 @@
> > > > >  ## @file
> > > > >
> > > > >  #  FDF file of Platform.
> > > > >
> > > > >  #
> > > > >
> > > > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > > > reserved.<BR>
> > > > >
> > > > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > > > +reserved.<BR>
> > > > >
> > > > >  #
> > > > >
> > > > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > > > >
> > > > >  #
> > > > >
> > > > > @@ -26,6 +26,12 @@ INF
> > > > >
> > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > > > >  INF
> > > > >
> > > >
> > >
> MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCount
> > > > e
> > > > > rRuntimeDxe.inf
> > > > >
> > > > >
> > > > >
> > > > >  INF  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
> > > > >
> > > > > +
> > > > >
> > > > > +!if gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable ==
> > > > > +TRUE
> > > > >
> > > > > +INF  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> > > > >
> > > > > +INF
> MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> > > > >
> > > > > +!endif
> > > > >
> > > > > +
> > > > >
> > > > >  INF
> > > > >
> > > >
> > >
> >
> MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerD
> > > > > xe.inf
> > > > >
> > > > >  INF  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> > > > >
> > > > >  INF
> > > > >
> MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> > > > >
> > > > > diff --git
> > > > >
> > > > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Seri
> > > > alPo
> > > > rtTer
> > > > > minalLib.c
> > > > >
> > > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Seri
> > > > alPo
> > > > rtTer
> > > > > minalLib.c
> > > > > new file mode 100644
> > > > > index 0000000000..94de475173
> > > > > --- /dev/null
> > > > > +++
> > > > >
> > > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Seri
> > > > alPo
> > > > rtTer
> > > > > minalLib.c
> > > > > @@ -0,0 +1,102 @@
> > > > > +/** @file
> > > > >
> > > > > +  Main file for NULL named library for Serial Port Terminal
> > > > > + Redirection
> > > > > library.
> > > > >
> > > > > +
> > > > >
> > > > > +  Copyright (c) 2020, Intel Corporation. All rights
> > > > > + reserved.<BR>
> > > > >
> > > > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > > > >
> > > > > +
> > > > >
> > > > > +**/
> > > > >
> > > > > +
> > > > >
> > > > > +#include "SerialPortTerminalLib.h"
> > > > >
> > > > > +
> > > > >
> > > > > +GLOBAL_REMOVE_IF_UNREFERENCED SERIAL_DEVICE_PATH
> > > > > mSerialDevicePath = {
> > > > >
> > > > > +  {
> > > > >
> > > > > +    {
> > > > >
> > > > > +      HARDWARE_DEVICE_PATH,
> > > > >
> > > > > +      HW_VENDOR_DP,
> > > > >
> > > > > +      {
> > > > >
> > > > > +        (UINT8) sizeof (VENDOR_DEVICE_PATH),
> > > > >
> > > > > +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
> > > > >
> > > > > +      }
> > > > >
> > > > > +    },
> > > > >
> > > > > +    EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> > > > >
> > > > > +  },
> > > > >
> > > > > +  {
> > > > >
> > > > > +    {
> > > > >
> > > > > +      MESSAGING_DEVICE_PATH,
> > > > >
> > > > > +      MSG_UART_DP,
> > > > >
> > > > > +      {
> > > > >
> > > > > +        (UINT8) sizeof (UART_DEVICE_PATH),
> > > > >
> > > > > +        (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)
> > > > >
> > > > > +      }
> > > > >
> > > > > +    },
> > > > >
> > > > > +    0,                  // Reserved
> > > > >
> > > > > +    0,                  // BaudRate
> > > > >
> > > > > +    0,                  // DataBits
> > > > >
> > > > > +    0,                  // Parity
> > > > >
> > > > > +    0                   // StopBits
> > > > >
> > > > > +  },
> > > > >
> > > > > +  {
> > > > >
> > > > > +    {
> > > > >
> > > > > +      MESSAGING_DEVICE_PATH,
> > > > >
> > > > > +      MSG_VENDOR_DP,
> > > > >
> > > > > +      {
> > > > >
> > > > > +        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
> > > > >
> > > > > +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
> > > > >
> > > > > +      }
> > > > >
> > > > > +    },
> > > > >
> > > > > +    DEVICE_PATH_MESSAGING_PC_ANSI
> > > > >
> > > > > +  },
> > > > >
> > > > > +  gEndEntire
> > > > >
> > > > > +};
> > > > >
> > > > > +
> > > > >
> > > > > +/**
> > > > >
> > > > > +  Updates the ConOut, ConIn, ErrOut variables with the serial
> > > > > + terminal
> > > > > device path
> > > > >
> > > > > +  @param                        none
> > > > >
> > > > > +  @retval                       none
> > > > >
> > > > > +**/
> > > > >
> > > > > +VOID
> > > > >
> > > > > +AddSerialTerminal (
> > > > >
> > > > > +  VOID
> > > > >
> > > > > +  )
> > > > >
> > > > > +{
> > > > >
> > > > > +  DEBUG ((DEBUG_INFO, "[AddSerialPortTerminal]\n"));
> > > > >
> > > > > +
> > > > >
> > > > > +  //
> > > > >
> > > > > +  // Append Serial Terminal into "ConIn"
> > > > >
> > > > > +  //
> > > > >
> > > > > +  EfiBootManagerUpdateConsoleVariable (ConOut,
> > > > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > > > >
> > > > > +  EfiBootManagerUpdateConsoleVariable (ConIn,
> > > > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > > > >
> > > > > +  EfiBootManagerUpdateConsoleVariable (ErrOut,
> > > > > (EFI_DEVICE_PATH_PROTOCOL *) &mSerialDevicePath, NULL);
> > > > >
> > > > > +}
> > > > >
> > > > > +
> > > > >
> > > > > +
> > > > >
> > > > > +/**
> > > > >
> > > > > +  Constructor for the Serial Port Device controller library.
> > > > >
> > > > > +
> > > > >
> > > > > +  @param ImageHandle    the image handle of the process
> > > > >
> > > > > +  @param SystemTable    the EFI System Table pointer
> > > > >
> > > > > +
> > > > >
> > > > > +  @retval EFI_SUCCESS        the shell command handlers were
> > > > > installed sucessfully
> > > > >
> > > > > +  @retval EFI_UNSUPPORTED    the shell level required was not
> > found.
> > > > >
> > > > > +**/
> > > > >
> > > > > +EFI_STATUS
> > > > >
> > > > > +EFIAPI
> > > > >
> > > > > +SerialPortTerminalLibConstructor (
> > > > >
> > > > > +  IN EFI_HANDLE        ImageHandle,
> > > > >
> > > > > +  IN EFI_SYSTEM_TABLE  *SystemTable
> > > > >
> > > > > +  )
> > > > >
> > > > > +{
> > > > >
> > > > > +  mSerialDevicePath.Uart.BaudRate =
> > > > > PcdGet64(PcdSerialTerminalBaudRate);
> > > > >
> > > > > +  mSerialDevicePath.Uart.DataBits =
> > > > > + PcdGet8(PcdSerialTerminalDataBits);
> > > > >
> > > > > +  mSerialDevicePath.Uart.Parity   =
> > PcdGet8(PcdSerialTerminalParity);
> > > > >
> > > > > +  mSerialDevicePath.Uart.StopBits =
> > > > > + PcdGet8(PcdSerialTerminalStopBits);
> > > > >
> > > > > +  DEBUG ((DEBUG_INFO, "[SerialPortTerminalLibConstructor]
> > > > > [%d, %d, %d, %d]\n",
> > > > >
> > > > > +      mSerialDevicePath.Uart.BaudRate,
> > > > >
> > > > > +      mSerialDevicePath.Uart.DataBits,
> > > > >
> > > > > +      mSerialDevicePath.Uart.Parity,
> > > > >
> > > > > +      mSerialDevicePath.Uart.StopBits));
> > > > >
> > > > > +
> > > > >
> > > > > +  AddSerialTerminal();
> > > > >
> > > > > +
> > > > >
> > > > > +  return EFI_SUCCESS;
> > > > >
> > > > > +}
> > > > >
> > > > > diff --git
> > > > >
> > > > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Seri
> > > > alPo
> > > > rtTer
> > > > > minalLib.h
> > > > >
> > > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Seri
> > > > alPo
> > > > rtTer
> > > > > minalLib.h
> > > > > new file mode 100644
> > > > > index 0000000000..0a2eaae8b8
> > > > > --- /dev/null
> > > > > +++
> > > > >
> > > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Seri
> > > > alPo
> > > > rtTer
> > > > > minalLib.h
> > > > > @@ -0,0 +1,48 @@
> > > > > +/** @file
> > > > >
> > > > > +  Header file for NULL named library for for Serial Port
> > > > > + Terminal
> > > > Redirection
> > > > > library.
> > > > >
> > > > > +
> > > > >
> > > > > +  Copyright (c) 2020, Intel Corporation. All rights
> > > > > + reserved.<BR>
> > > > >
> > > > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > > > >
> > > > > +
> > > > >
> > > > > +**/
> > > > >
> > > > > +
> > > > >
> > > > > +#ifndef _SERIAL_PORT_TERMINAL_LIB_H_
> > > > >
> > > > > +#define _SERIAL_PORT_TERMINAL_LIB_H_
> > > > >
> > > > > +
> > > > >
> > > > > +#include <Uefi.h>
> > > > >
> > > > > +#include <Guid/SerialPortLibVendor.h>
> > > > >
> > > > > +#include <Library/UefiLib.h>
> > > > >
> > > > > +#include <Library/DevicePathLib.h>
> > > > >
> > > > > +#include <Library/DebugLib.h>
> > > > >
> > > > > +#include <Library/UefiBootManagerLib.h>
> > > > >
> > > > > +
> > > > >
> > > > > +//
> > > > >
> > > > > +// Below is the platform console device path
> > > > >
> > > > > +//
> > > > >
> > > > > +typedef struct {
> > > > >
> > > > > +  VENDOR_DEVICE_PATH        Guid;
> > > > >
> > > > > +  UART_DEVICE_PATH          Uart;
> > > > >
> > > > > +  VENDOR_DEVICE_PATH        TerminalType;
> > > > >
> > > > > +  EFI_DEVICE_PATH_PROTOCOL  End;
> > > > >
> > > > > +} SERIAL_DEVICE_PATH;
> > > > >
> > > > > +
> > > > >
> > > > > +#define gPciRootBridge \
> > > > >
> > > > > +  { \
> > > > >
> > > > > +    { \
> > > > >
> > > > > +      ACPI_DEVICE_PATH, \
> > > > >
> > > > > +      ACPI_DP, \
> > > > >
> > > > > +      { \
> > > > >
> > > > > +        (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \
> > > > >
> > > > > +        (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \
> > > > >
> > > > > +      }, \
> > > > >
> > > > > +    }, \
> > > > >
> > > > > +    EISA_PNP_ID (0x0A03), \
> > > > >
> > > > > +    0 \
> > > > >
> > > > > +  }
> > > > >
> > > > > +
> > > > >
> > > > > +#define gEndEntire \
> > > > >
> > > > > +  { \
> > > > >
> > > > > +    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
> > > > > { END_DEVICE_PATH_LENGTH, 0 } \
> > > > >
> > > > > +  }
> > > > >
> > > > > +
> > > > >
> > > > > +#endif
> > > > >
> > > > > diff --git
> > > > >
> > > > a/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Seri
> > > > alPo
> > > > rtTer
> > > > > minalLib.inf
> > > > >
> > > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Seri
> > > > alPo
> > > > rtTer
> > > > > minalLib.inf
> > > > > new file mode 100644
> > > > > index 0000000000..b0a9326b1b
> > > > > --- /dev/null
> > > > > +++
> > > > >
> > > > b/Platform/Intel/MinPlatformPkg/Library/SerialPortTerminalLib/Seri
> > > > alPo
> > > > rtTer
> > > > > minalLib.inf
> > > > > @@ -0,0 +1,40 @@
> > > > > +## @file
> > > > >
> > > > > +# Component information file for Serial Port Terminal
> > > > > +Redirection Library
> > > > >
> > > > > +#
> > > > >
> > > > > +# INTEL CONFIDENTIAL
> > > > >
> > > > > +# Copyright (c) 2020, Intel Corporation. All rights
> > > > > +reserved.<BR>
> > > > >
> > > > > +#
> > > > >
> > > > > +# SPDX-License-Identifier: BSD-2-Clause-Patent
> > > > >
> > > > > +#
> > > > >
> > > > > +##
> > > > >
> > > > > +[Defines]
> > > > >
> > > > > +  INF_VERSION                    = 0x00010006
> > > > >
> > > > > +  BASE_NAME                      = SerialPortTerminalLib
> > > > >
> > > > > +  FILE_GUID                      =
> > > > > E12BFA46-95F2-4ADC-9774-7E38DE78741E
> > > > >
> > > > > +  MODULE_TYPE                    = UEFI_DRIVER
> > > > >
> > > > > +  VERSION_STRING                 = 1.2
> > > > >
> > > > > +  LIBRARY_CLASS                  = NULL|UEFI_DRIVER
> > DXE_DRIVER
> > > > > DXE_RUNTIME_DRIVER
> > > > >
> > > > > +  CONSTRUCTOR                    =
> > > > > SerialPortTerminalLibConstructor
> > > > >
> > > > > +
> > > > >
> > > > > +[Packages]
> > > > >
> > > > > +  MdePkg/MdePkg.dec
> > > > >
> > > > > +  MdeModulePkg/MdeModulePkg.dec
> > > > >
> > > > > +  BoardModulePkg/BoardModulePkg.dec
> > > > >
> > > > > +  MinPlatformPkg/MinPlatformPkg.dec
> > > > >
> > > > > +
> > > > >
> > > > > +[Sources]
> > > > >
> > > > > +  SerialPortTerminalLib.c
> > > > >
> > > > > +  SerialPortTerminalLib.h
> > > > >
> > > > > +
> > > > >
> > > > > +[LibraryClasses]
> > > > >
> > > > > +  DevicePathLib
> > > > >
> > > > > +  DebugLib
> > > > >
> > > > > +  UefiDriverEntryPoint
> > > > >
> > > > > +  UefiBootManagerLib
> > > > >
> > > > > +  UefiLib
> > > > >
> > > > > +
> > > > >
> > > > > +[Pcd]
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits
> > > > > \ No newline at end of file
> > > > > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > > > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > > > index 7ef189dac8..36050aa1a8 100644
> > > > > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > > > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> > > > > @@ -205,6 +205,30 @@
> > > > >  [PcdsDynamic, PcdsDynamicEx]
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdPcIoApicEnable|0x0|UINT32|0x900000
> > > > > 19
> > > > >
> > > > >
> > > > >
> > > > > +  # The baud rate setting for the UART style device. A value of
> > > > > + 0
> > > > >
> > > > > +  # means that the device's default baud rate will be used.
> > > > >
> > > > > +
> > > > >
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalBaudRate|115200|UINT6
> > > > > 4|0x9000001A
> > > > >
> > > > > +
> > > > >
> > > > > +  # The number of data bits for the UART style device. A value
> > > > >
> > > > > +  # of 0 means that the device's default number of data bits
> > > > > + will be
> > > > used.
> > > > >
> > > > > +
> > > > >
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalDataBits|0x8|UINT8|0x9
> > > > > 000001B
> > > > >
> > > > > +
> > > > >
> > > > > +  # The parity setting for the UART style device.
> > > > >
> > > > > +  # Parity 0x00 - Default Parity.
> > > > >
> > > > > +  # Parity 0x01 - No Parity.
> > > > >
> > > > > +  # Parity 0x02 - Even Parity.
> > > > >
> > > > > +  # Parity 0x03 - Odd Parity.
> > > > >
> > > > > +  # Parity 0x04 - Mark Parity.
> > > > >
> > > > > +  # Parity 0x05 - Space Parity.
> > > > >
> > > > > +
> > > > >
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalParity|0x1|UINT8|0x900
> > > > > 0001C
> > > > >
> > > > > +
> > > > >
> > > > > +  # The number of stop bits for the UART style device.
> > > > >
> > > > > +  # Stop Bits 0x00 - Default Stop Bits.
> > > > >
> > > > > +  # Stop Bits 0x01 - 1 Stop Bit.
> > > > >
> > > > > +  # Stop Bits 0x02 - 1.5 Stop Bits.
> > > > >
> > > > > +  # Stop Bits 0x03 - 2 Stop Bits.
> > > > >
> > > > > +
> > > > >
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalStopBits|0x1|UINT8|0x9
> > > > > 000001D
> > > > >
> > > > > +
> > > > >
> > > > >  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic,
> > > > > PcdsDynamicEx]
> > > > >
> > > > >
> > > > >
> > > > >    ##
> > > > >
> > > > > @@ -318,3 +342,4 @@
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable
> > > > > |FALSE|BOOLEAN|0xF00000A5
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE|BOOLE
> > > > > AN|0xF00000A6
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable
> > > > > |FALSE|BOOLEAN|0xF00000A7
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable
> > > > > |FALSE|BOOLEAN|0xF00000B0
> > > > >
> > > > > diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > > > b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > > > index 112ddff7d9..d0b5593817 100644
> > > > > --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > > > +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> > > > > @@ -1,7 +1,7 @@
> > > > >  ## @file
> > > > >
> > > > >  #  Platform description.
> > > > >
> > > > >  #
> > > > >
> > > > > -# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> > > > > reserved.<BR>
> > > > >
> > > > > +# Copyright (c) 2017 - 2020, Intel Corporation. All rights
> > > > > +reserved.<BR>
> > > > >
> > > > >  #
> > > > >
> > > > >  # SPDX-License-Identifier: BSD-2-Clause-Patent
> > > > >
> > > > >  #
> > > > >
> > > > > @@ -44,6 +44,7 @@
> > > > >      gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > > >
> > > > >      gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > > >
> > > > >
> > gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
> > > > >
> > > > > +    gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> > ##############################################################
> > > > > ##################
> > > > >
> > > > >  #
> > > > >
> > > > > diff --git
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > > > c
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > > > c
> > > > > index 52cdf9ec0f..251f46f812 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > > > c
> > > > > +++
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
> > > > > c
> > > > > @@ -50,6 +50,7 @@
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > > >
> > > > >
> > > > >
> > > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > > >
> > > > > diff --git
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > > > sc
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > > > sc
> > > > > index d797ae9d94..e161bf06f4 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > > > sc
> > > > > +++
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.d
> > > > > sc
> > > > > @@ -127,6 +127,7 @@
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE
> > > > >
> > > > >
> > > > >
> > > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > > >
> > > > > diff --git
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > > > kgPcd.dsc
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > > > kgPcd.dsc
> > > > > index 5d769e8153..83ada3c95c 100644
> > > > > ---
> > > > >
> > > >
> > >
> >
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > > > kgPcd.dsc
> > > > > +++
> > > > >
> > > >
> > >
> >
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> > > > > kgPcd.dsc
> > > > > @@ -127,6 +127,7 @@
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> > > > >
> > > > > +  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|FALSE
> > > > >
> > > > >
> > > > >
> > > > >  !if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> > > > >
> > > > >    gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> > > > >
> > > > > --
> > > > > 2.24.0.windows.2
> > > > >
> > > > >
> > > > >
> > > > > -=-=-=-=-=-=
> > > > > Groups.io Links: You receive all messages sent to this group.
> > > > > View/Reply Online (#66973):
> > > > > https://edk2.groups.io/g/devel/message/66973
> > > > > Mute This Topic: https://groups.io/mt/78024794/4905953
> > > > > Group Owner: devel+owner@edk2.groups.io
> > > > > Unsubscribe: https://edk2.groups.io/g/devel/unsub
> > > > > [gaoliming@byosoft.com.cn]
> > > > > -=-=-=-=-=-=
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > 
> > > >
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-11  5:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-04  8:05 [Patch V4] MinPlatformPkg: console redirect after the shell is loaded Heng Luo
2020-11-05  0:54 ` 回复: [edk2-devel] " gaoliming
2020-11-05  1:08   ` Heng Luo
2020-11-05  1:35     ` 回复: " gaoliming
2020-11-10  2:13     ` Heng Luo
2020-11-10 14:15       ` 回复: " gaoliming
2020-11-11  5:57         ` Heng Luo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox