]> git.proxmox.com Git - mirror_edk2.git/commitdiff
DynamicTablesPkg: Add an override for 16550 HID in SSDT
authorJoey Gouly <joey.gouly@arm.com>
Fri, 22 Jan 2021 12:51:12 +0000 (12:51 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 11 Feb 2021 10:35:35 +0000 (10:35 +0000)
Some platforms advertise support for a 16550 UART, but are not
compatible with the PNP0500 HID. Allow them to override the HID by
setting PcdNonBsaCompliant16550SerialHid.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
DynamicTablesPkg/DynamicTablesPkg.dec
DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c
DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf

index 291a45a69679ae82219ecd2f26dfabfbab1f7f65..b242df01058729ce74d40c1fcf931acc3bc66fa5 100644 (file)
@@ -44,5 +44,8 @@
   # Maximum number of Custom DT Generators\r
   gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdMaxCustomDTGenerators|1|UINT16|0xC0000003\r
 \r
+  # Non BSA Compliant 16550 Serial HID\r
+  gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdNonBsaCompliant16550SerialHid|""|VOID*|0x40000008\r
+\r
 [Guids]\r
   gEdkiiDynamicTablesPkgTokenSpaceGuid = { 0xab226e66, 0x31d8, 0x4613, { 0x87, 0x9d, 0xd2, 0xfa, 0xb6, 0x10, 0x26, 0x3c } }\r
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
index af3d404393f5f1385ab2d40f45f7222ab66f9b3a..54bf71a3b73949a9c834445a81bdade02d49e9d3 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  SSDT Serial Port fixup Library\r
 #\r
-#  Copyright (c) 2020, Arm Limited. All rights reserved.<BR>\r
+#  Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<BR>\r
 #\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 ##\r
@@ -28,3 +28,5 @@
   AmlLib\r
   BaseLib\r
 \r
+[Pcd]\r
+  gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdNonBsaCompliant16550SerialHid\r