]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
DynamicTablesPkg: Serial debug port initialisation
[mirror_edk2.git] / DynamicTablesPkg / Library / Acpi / Arm / AcpiDbg2LibArm / Dbg2Generator.c
index 346ab5b22f5402bf87c385558f68f080d1b454ed..51c843d25f75388104694855ce133b3d61860196 100644 (file)
@@ -175,7 +175,7 @@ GET_OBJECT_LIST (
   CM_ARM_SERIAL_PORT_INFO\r
   );\r
 \r
-/** Initialize the PL011 UART with the parameters obtained from\r
+/** Initialize the PL011/SBSA UART with the parameters obtained from\r
     the Configuration Manager.\r
 \r
   @param [in]  SerialPortInfo Pointer to the Serial Port Information.\r
@@ -353,15 +353,22 @@ BuildDbg2Table (
   AcpiDbg2.Dbg2DeviceInfo[DBG_PORT_INDEX_PORT1].Dbg2Device.PortSubtype =\r
     SerialPortInfo->PortSubtype;\r
 \r
-  // Initialize the serial port\r
-  Status = SetupDebugUart (SerialPortInfo);\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((\r
-      DEBUG_ERROR,\r
-      "ERROR: DBG2: Failed to configure debug serial port. Status = %r\n",\r
-      Status\r
-      ));\r
-    goto error_handler;\r
+  if ((SerialPortInfo->PortSubtype ==\r
+      EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART)           ||\r
+      (SerialPortInfo->PortSubtype ==\r
+      EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X) ||\r
+      (SerialPortInfo->PortSubtype ==\r
+      EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART)) {\r
+    // Initialize the serial port\r
+    Status = SetupDebugUart (SerialPortInfo);\r
+    if (EFI_ERROR (Status)) {\r
+      DEBUG ((\r
+        DEBUG_ERROR,\r
+        "ERROR: DBG2: Failed to configure debug serial port. Status = %r\n",\r
+        Status\r
+        ));\r
+      goto error_handler;\r
+    }\r
   }\r
 \r
   *Table = (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2;\r