]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmgPkg/PlatformBootManagerLib: Add Debug Agent console
authorMichael Kinney <michael.d.kinney@intel.com>
Fri, 23 Dec 2016 00:49:05 +0000 (16:49 -0800)
committerMichael Kinney <michael.d.kinney@intel.com>
Tue, 10 Jan 2017 20:42:09 +0000 (12:42 -0800)
The Debug Agent in the SourceLevelDebugPkg can multiplex
both source level debug messages and console messages on
the same UART.  When this is done, the Debug Agent owns
the UART device and an additional device handle with a
Serial I/O Protocol is produced with a VenHw device path
node.

In order for a platform to provide a UART based console
when the Debug Agent is using the same UART device, the
PlatformBootManagerLib must consider the SerialI/O
Protocol produces by the Debug Agent as one of the
supported consoles.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c

index 00a1d22eeaafcee1d296a41b3216a73a79f6b9f8..ec58efa5ef4a69b9fe7052990949d13dc1c9521e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Platform BDS customizations include file.\r
 \r
-  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -65,6 +65,7 @@ Abstract:
 #include <Guid/HobList.h>\r
 #include <Guid/GlobalVariable.h>\r
 #include <Guid/EventGroup.h>\r
+#include <Guid/DebugAgentGuid.h>\r
 \r
 #include <OvmfPlatforms.h>\r
 \r
@@ -144,6 +145,16 @@ extern VENDOR_DEVICE_PATH         gTerminalTypeDeviceNode;
     DEVICE_PATH_MESSAGING_PC_ANSI \\r
   }\r
 \r
+#define gEndEntire \\r
+  { \\r
+    END_DEVICE_PATH_TYPE, \\r
+    END_ENTIRE_DEVICE_PATH_SUBTYPE, \\r
+    { \\r
+      END_DEVICE_PATH_LENGTH, \\r
+      0 \\r
+    } \\r
+  }\r
+\r
 #define PCI_CLASS_SCC          0x07\r
 #define PCI_SUBCLASS_SERIAL    0x00\r
 #define PCI_IF_16550           0x02\r
index 4a6becec7ea8843123c6d0884849bba580f13cb6..f9e35c955d4d2167e182108eb974b956d8642c39 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  Platform BDS customizations library.\r
 #\r
-#  Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
@@ -36,6 +36,7 @@
   MdePkg/MdePkg.dec\r
   MdeModulePkg/MdeModulePkg.dec\r
   IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
+  SourceLevelDebugPkg/SourceLevelDebugPkg.dec\r
   OvmfPkg/OvmfPkg.dec\r
 \r
 [LibraryClasses]\r
index e9737a7577c971a52746569284dc957608a1c899..82f294577ecf41f50458432d6e220381a8f710ad 100644 (file)
@@ -2,7 +2,7 @@
   Defined the platform specific device path which will be used by\r
   platform Bbd to perform the platform policy connect.\r
 \r
-  Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
 \r
 #include "BdsPlatform.h"\r
 \r
+//\r
+// Debug Agent UART Device Path structure\r
+//\r
+#pragma pack(1)\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
+#pragma pack()\r
+\r
 ACPI_HID_DEVICE_PATH       gPnpPs2KeyboardDeviceNode  = gPnpPs2Keyboard;\r
 ACPI_HID_DEVICE_PATH       gPnp16550ComPortDeviceNode = gPnp16550ComPort;\r
 UART_DEVICE_PATH           gUartDeviceNode            = gUart;\r
@@ -24,10 +36,50 @@ VENDOR_DEVICE_PATH         gTerminalTypeDeviceNode    = gPcAnsiTerminal;
 // Platform specific keyboard device path\r
 //\r
 \r
+\r
+//\r
+// Debug Agent UART 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
+  gPcAnsiTerminal,\r
+  gEndEntire\r
+};\r
+\r
+\r
 //\r
 // Predefined platform default console device path\r
 //\r
 PLATFORM_CONSOLE_CONNECT_ENTRY   gPlatformConsole[] = {\r
+  {\r
+    (EFI_DEVICE_PATH_PROTOCOL *) &gDebugAgentUartDevicePath,\r
+    (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)\r
+  },\r
   {\r
     NULL,\r
     0\r