]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c
DynamicTablesPkg: Add an override for 16550 HID in SSDT
[mirror_edk2.git] / DynamicTablesPkg / Library / Common / SsdtSerialPortFixupLib / SsdtSerialPortFixupLib.c
index 0ff071485ef25f4ca63de0eeab5120d1beece4db..3c4356097c3bf25e8d1432b45ba8ca59d33e8d09 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   SSDT Serial Port Fixup Library.\r
 \r
-  Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>\r
+  Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -139,13 +139,21 @@ FixupIds (
   AML_OBJECT_NODE_HANDLE    NameOpIdNode;\r
   CONST CHAR8             * HidString;\r
   CONST CHAR8             * CidString;\r
+  CONST CHAR8             * NonBsaHid;\r
 \r
   // Get the _CID and _HID value to write.\r
   switch (SerialPortInfo->PortSubtype) {\r
     case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_FULL_16550:\r
     {\r
-      HidString = "PNP0501";\r
-      CidString = "PNP0500";\r
+      // If there is a non-BSA compliant HID, use that.\r
+      NonBsaHid = (CONST CHAR8*)PcdGetPtr (PcdNonBsaCompliant16550SerialHid);\r
+      if ((NonBsaHid != NULL) && (AsciiStrLen (NonBsaHid) != 0)) {\r
+        HidString = NonBsaHid;\r
+        CidString = "";\r
+      } else {\r
+        HidString = "PNP0501";\r
+        CidString = "PNP0500";\r
+      }\r
       break;\r
     }\r
     case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART:\r