Vlv2TbltDevicePkg/PlatformBdsLib: Add DebugAgent Console
authorMichael Kinney <michael.d.kinney@intel.com>
Wed, 30 Nov 2016 00:53:42 +0000 (16:53 -0800)
committerMichael Kinney <michael.d.kinney@intel.com>
Mon, 5 Dec 2016 21:48:14 +0000 (13:48 -0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=276

Add the UART console produced by the DebugAgent when
SOURCE_DEBUG_ENABLE is TRUE.  Without this change, the
debugger connects but the Boot Manager and the UEFI
Shell do not have an active console because the Boot
Manager does not know about the DebugAgent UART
Console device path and the Debug Agent is using the
UART device.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: Mang Guo <mang.guo@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.h
Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf
Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformData.c

index d7572435eddf87a42c4e57fb287b2b5d53f9036f..807094fcde965d4b4134d10509ba053f56a455e0 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-  Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2004  - 2016, Intel Corporation. All rights reserved.<BR>\r
                                                                                    \r\r
   This program and the accompanying materials are licensed and made available under\r\r
   the terms and conditions of the BSD License that accompanies this distribution.  \r\r
@@ -46,6 +46,7 @@ Abstract:
 #include <Guid/CapsuleVendor.h>\r
 #include <Guid/MemoryTypeInformation.h>\r
 #include <Guid/GlobalVariable.h>\r
+#include <Guid/DebugAgentGuid.h>\r
 \r
 \r
 #include <Library/DebugLib.h>\r
@@ -280,6 +281,16 @@ typedef struct {
   EFI_DEVICE_PATH_PROTOCOL  End;\r
 } PLATFORM_USB_DEVICE_PATH;\r
 \r
+//\r
+// Debug Agent UART Console device path definition\r
+//\r
+typedef struct {\r
+  VENDOR_DEVICE_PATH        VendorHardware;\r
+  UART_DEVICE_PATH          Uart;\r
+  VENDOR_DEVICE_PATH        TerminalType;\r
+  EFI_DEVICE_PATH_PROTOCOL  End;\r
+} VENDOR_UART_DEVICE_PATH;\r
+\r
 //\r
 // Below is the platform PCI device path\r
 //\r
index 3e45a313ffacf74830b5945ae29548cdae5a626f..7512556bb7fe3bf69287a83d2488bee98d70d06a 100644 (file)
@@ -50,6 +50,7 @@
   CryptoPkg/CryptoPkg.dec\r
   SecurityPkg/SecurityPkg.dec\r
   SignedCapsulePkg/SignedCapsulePkg.dec\r
+  SourceLevelDebugPkg/SourceLevelDebugPkg.dec\r
 \r
 [LibraryClasses]\r
   DxeServicesTableLib\r
index 64e68d394194e5b83862baeb9a101f76eff7cd0f..45bd32d05d3ab395901a0412ed9075c9042c5173 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2004  - 2016, Intel Corporation. All rights reserved.<BR>\r
                                                                                    \r\r
   This program and the accompanying materials are licensed and made available under\r\r
   the terms and conditions of the BSD License that accompanies this distribution.  \r\r
@@ -118,6 +118,50 @@ USB_CLASS_FORMAT_DEVICE_PATH gUsbClassKeyboardDevicePath = {
   gEndEntire\r
 };\r
 \r
+//\r
+// Debug Agent UART Console device path \r
+//\r
+VENDOR_UART_DEVICE_PATH gDebugAgentUartDevicePath = {\r
+  {\r
+    {\r
+      HARDWARE_DEVICE_PATH,\r
+      HW_VENDOR_DP,\r
+      {\r
+        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r
+        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)\r
+      }\r
+    },\r
+    EFI_DEBUG_AGENT_GUID,\r
+  },\r
+  {\r
+    {\r
+      MESSAGING_DEVICE_PATH,\r
+      MSG_UART_DP,\r
+      {\r
+        (UINT8) (sizeof (UART_DEVICE_PATH)),\r
+        (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8)\r
+      }\r
+    },\r
+    0,  // Reserved\r
+    0,  // BaudRate - Default\r
+    0,  // DataBits - Default\r
+    0,  // Parity   - Default\r
+    0,  // StopBits - Default\r
+  },\r
+  {\r
+    {\r
+      MESSAGING_DEVICE_PATH,\r
+      MSG_VENDOR_DP,\r
+      {\r
+        (UINT8)(sizeof (VENDOR_DEVICE_PATH)),\r
+        (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)\r
+      }\r
+    },\r
+    DEVICE_PATH_MESSAGING_PC_ANSI\r
+  },\r
+  gEndEntire\r
+};\r
+\r
 //\r
 // Predefined platform default console device path\r
 //\r
@@ -125,6 +169,7 @@ BDS_CONSOLE_CONNECT_ENTRY gPlatformConsole [] = {
   {(EFI_DEVICE_PATH_PROTOCOL*)&gIsaSerialDevicePath, CONSOLE_ALL},\r
   {(EFI_DEVICE_PATH_PROTOCOL*)&gHiiVendorDevicePath0, CONSOLE_IN},\r
   {(EFI_DEVICE_PATH_PROTOCOL*)&gIsaKeyboardDevicePath, CONSOLE_IN},\r
+  {(EFI_DEVICE_PATH_PROTOCOL*)&gDebugAgentUartDevicePath, CONSOLE_ALL},\r
   {(EFI_DEVICE_PATH_PROTOCOL*)&gUsbClassKeyboardDevicePath, CONSOLE_IN},\r
   {NULL, 0}\r
 };\r
@@ -242,6 +287,7 @@ BDS_CONSOLE_CONNECT_ENTRY gPlatformSimpleConsole [] = {
   {(EFI_DEVICE_PATH_PROTOCOL*)&gOnChipPciVgaDevicePath, CONSOLE_OUT},\r
   {(EFI_DEVICE_PATH_PROTOCOL*)&gIsaSerialDevicePath, CONSOLE_ALL},\r
   {(EFI_DEVICE_PATH_PROTOCOL*)&gHiiVendorDevicePath0, CONSOLE_IN},\r
+  {(EFI_DEVICE_PATH_PROTOCOL*)&gDebugAgentUartDevicePath, CONSOLE_ALL},\r
   {(EFI_DEVICE_PATH_PROTOCOL*)&gUsbClassKeyboardDevicePath, CONSOLE_IN},\r
   {NULL, 0}\r
 };\r