* [PATCH v2 0/2] Add a Pcd to override the 16650 HID in SSDT
@ 2021-01-22 12:51 Joey Gouly
2021-01-22 12:51 ` [PATCH v2 1/2] DynamicTablesPkg: Don't use gEfiMdeModulePkgTokenSpaceGuid Joey Gouly
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Joey Gouly @ 2021-01-22 12:51 UTC (permalink / raw)
To: devel
Cc: joey.gouly, ardb+tianocore, sami.mujawar, jbrasen, ipark,
Samer.El-Haj-Mahmoud, nd
This series adds PcdNonSbsaCompliantSerialHid so that firmware can
override the PNP0501 HID used by 16550 UART in the SSDT table, in case
they are not compatible with the generic PNP0501 HID.
I have tested this with acpiview, some extra testing would be
appreciated.
Changes available at https://github.com/jgouly/edk2/tree/1588_non_sbsa_hid_v2
v2:
- Renamed PcdNonSbsaCompliantSerialHid to PcdNonBsaCompliant16550SerialHid
Joey Gouly (2):
DynamicTablesPkg: Don't use gEfiMdeModulePkgTokenSpaceGuid
DynamicTablesPkg: Add an override for 16550 HID in SSDT
DynamicTablesPkg/DynamicTablesPkg.dec | 13 +++++++++----
.../DynamicTableFactoryDxe.inf | 8 ++++----
.../SsdtSerialPortFixupLib.inf | 4 +++-
.../SsdtSerialPortFixupLib.c | 14 +++++++++++---
4 files changed, 27 insertions(+), 12 deletions(-)
--
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] DynamicTablesPkg: Don't use gEfiMdeModulePkgTokenSpaceGuid
2021-01-22 12:51 [PATCH v2 0/2] Add a Pcd to override the 16650 HID in SSDT Joey Gouly
@ 2021-01-22 12:51 ` Joey Gouly
2021-02-02 13:00 ` [edk2-devel] " Alexei Fedorov
2021-01-22 12:51 ` [PATCH v2 2/2] DynamicTablesPkg: Add an override for 16550 HID in SSDT Joey Gouly
2021-02-02 13:00 ` [edk2-devel] [PATCH v2 0/2] Add a Pcd to override the 16650 " Alexei Fedorov
2 siblings, 1 reply; 6+ messages in thread
From: Joey Gouly @ 2021-01-22 12:51 UTC (permalink / raw)
To: devel
Cc: joey.gouly, ardb+tianocore, sami.mujawar, jbrasen, ipark,
Samer.El-Haj-Mahmoud, nd
Introduce gEdkiiDynamicTablesPkgTokenSpaceGuid and use that instead.
Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
---
DynamicTablesPkg/DynamicTablesPkg.dec | 10 ++++++----
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf | 8 ++++----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec b/DynamicTablesPkg/DynamicTablesPkg.dec
index f36a6e8bb7c17f82acff3c766b15202b064a64b5..291a45a69679ae82219ecd2f26dfabfbab1f7f65 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dec
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -1,7 +1,7 @@
## @file
# dec file for Dynamic Tables Framework.
#
-# Copyright (c) 2017 - 2020, Arm Limited. All rights reserved.<BR>
+# Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -36,11 +36,13 @@ [Protocols]
[PcdsFixedAtBuild]
# Maximum number of Custom ACPI Generators
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxCustomACPIGenerators|1|UINT16|0xC0000001
+ gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdMaxCustomACPIGenerators|1|UINT16|0xC0000001
# Maximum number of Custom SMBIOS Generators
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxCustomSMBIOSGenerators|1|UINT16|0xC0000002
+ gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdMaxCustomSMBIOSGenerators|1|UINT16|0xC0000002
# Maximum number of Custom DT Generators
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxCustomDTGenerators|1|UINT16|0xC0000003
+ gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdMaxCustomDTGenerators|1|UINT16|0xC0000003
+[Guids]
+ gEdkiiDynamicTablesPkgTokenSpaceGuid = { 0xab226e66, 0x31d8, 0x4613, { 0x87, 0x9d, 0xd2, 0xfa, 0xb6, 0x10, 0x26, 0x3c } }
diff --git a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
index 56b69591ac52ca3ba51250dc01a0846b22442ce9..29ed3dc2e5029206f8852c4b11240e7b493bbc57 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
+++ b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
@@ -1,7 +1,7 @@
## @file
# Module to manage the list of available table factories.
#
-# Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+# Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
@@ -41,9 +41,9 @@ [LibraryClasses]
UefiDriverEntryPoint
[FixedPcd]
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxCustomACPIGenerators
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxCustomSMBIOSGenerators
- gEfiMdeModulePkgTokenSpaceGuid.PcdMaxCustomDTGenerators
+ gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdMaxCustomACPIGenerators
+ gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdMaxCustomSMBIOSGenerators
+ gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdMaxCustomDTGenerators
[Protocols]
gEdkiiDynamicTableFactoryProtocolGuid # PRODUCES
--
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] DynamicTablesPkg: Add an override for 16550 HID in SSDT
2021-01-22 12:51 [PATCH v2 0/2] Add a Pcd to override the 16650 HID in SSDT Joey Gouly
2021-01-22 12:51 ` [PATCH v2 1/2] DynamicTablesPkg: Don't use gEfiMdeModulePkgTokenSpaceGuid Joey Gouly
@ 2021-01-22 12:51 ` Joey Gouly
2021-02-02 13:01 ` [edk2-devel] " Alexei Fedorov
2021-02-02 13:00 ` [edk2-devel] [PATCH v2 0/2] Add a Pcd to override the 16650 " Alexei Fedorov
2 siblings, 1 reply; 6+ messages in thread
From: Joey Gouly @ 2021-01-22 12:51 UTC (permalink / raw)
To: devel
Cc: joey.gouly, ardb+tianocore, sami.mujawar, jbrasen, ipark,
Samer.El-Haj-Mahmoud, nd
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>
---
DynamicTablesPkg/DynamicTablesPkg.dec | 3 +++
DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf | 4 +++-
DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c | 14 +++++++++++---
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec b/DynamicTablesPkg/DynamicTablesPkg.dec
index 291a45a69679ae82219ecd2f26dfabfbab1f7f65..b242df01058729ce74d40c1fcf931acc3bc66fa5 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dec
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -44,5 +44,8 @@ [PcdsFixedAtBuild]
# Maximum number of Custom DT Generators
gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdMaxCustomDTGenerators|1|UINT16|0xC0000003
+ # Non BSA Compliant 16550 Serial HID
+ gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdNonBsaCompliant16550SerialHid|""|VOID*|0x40000008
+
[Guids]
gEdkiiDynamicTablesPkgTokenSpaceGuid = { 0xab226e66, 0x31d8, 0x4613, { 0x87, 0x9d, 0xd2, 0xfa, 0xb6, 0x10, 0x26, 0x3c } }
diff --git a/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf b/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
index af3d404393f5f1385ab2d40f45f7222ab66f9b3a..54bf71a3b73949a9c834445a81bdade02d49e9d3 100644
--- a/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
+++ b/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
@@ -1,7 +1,7 @@
## @file
# SSDT Serial Port fixup Library
#
-# Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
+# Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
@@ -28,3 +28,5 @@ [LibraryClasses]
AmlLib
BaseLib
+[Pcd]
+ gEdkiiDynamicTablesPkgTokenSpaceGuid.PcdNonBsaCompliant16550SerialHid
diff --git a/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c b/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c
index 0ff071485ef25f4ca63de0eeab5120d1beece4db..3c4356097c3bf25e8d1432b45ba8ca59d33e8d09 100644
--- a/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c
+++ b/DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.c
@@ -1,7 +1,7 @@
/** @file
SSDT Serial Port Fixup Library.
- Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
+ Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -139,13 +139,21 @@ FixupIds (
AML_OBJECT_NODE_HANDLE NameOpIdNode;
CONST CHAR8 * HidString;
CONST CHAR8 * CidString;
+ CONST CHAR8 * NonBsaHid;
// Get the _CID and _HID value to write.
switch (SerialPortInfo->PortSubtype) {
case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_FULL_16550:
{
- HidString = "PNP0501";
- CidString = "PNP0500";
+ // If there is a non-BSA compliant HID, use that.
+ NonBsaHid = (CONST CHAR8*)PcdGetPtr (PcdNonBsaCompliant16550SerialHid);
+ if ((NonBsaHid != NULL) && (AsciiStrLen (NonBsaHid) != 0)) {
+ HidString = NonBsaHid;
+ CidString = "";
+ } else {
+ HidString = "PNP0501";
+ CidString = "PNP0500";
+ }
break;
}
case EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART:
--
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [PATCH v2 0/2] Add a Pcd to override the 16650 HID in SSDT
2021-01-22 12:51 [PATCH v2 0/2] Add a Pcd to override the 16650 HID in SSDT Joey Gouly
2021-01-22 12:51 ` [PATCH v2 1/2] DynamicTablesPkg: Don't use gEfiMdeModulePkgTokenSpaceGuid Joey Gouly
2021-01-22 12:51 ` [PATCH v2 2/2] DynamicTablesPkg: Add an override for 16550 HID in SSDT Joey Gouly
@ 2021-02-02 13:00 ` Alexei Fedorov
2 siblings, 0 replies; 6+ messages in thread
From: Alexei Fedorov @ 2021-02-02 13:00 UTC (permalink / raw)
To: Joey Gouly, devel
[-- Attachment #1: Type: text/plain, Size: 54 bytes --]
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
[-- Attachment #2: Type: text/html, Size: 89 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [PATCH v2 1/2] DynamicTablesPkg: Don't use gEfiMdeModulePkgTokenSpaceGuid
2021-01-22 12:51 ` [PATCH v2 1/2] DynamicTablesPkg: Don't use gEfiMdeModulePkgTokenSpaceGuid Joey Gouly
@ 2021-02-02 13:00 ` Alexei Fedorov
0 siblings, 0 replies; 6+ messages in thread
From: Alexei Fedorov @ 2021-02-02 13:00 UTC (permalink / raw)
To: Joey Gouly, devel
[-- Attachment #1: Type: text/plain, Size: 54 bytes --]
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
[-- Attachment #2: Type: text/html, Size: 95 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [PATCH v2 2/2] DynamicTablesPkg: Add an override for 16550 HID in SSDT
2021-01-22 12:51 ` [PATCH v2 2/2] DynamicTablesPkg: Add an override for 16550 HID in SSDT Joey Gouly
@ 2021-02-02 13:01 ` Alexei Fedorov
0 siblings, 0 replies; 6+ messages in thread
From: Alexei Fedorov @ 2021-02-02 13:01 UTC (permalink / raw)
To: Joey Gouly, devel
[-- Attachment #1: Type: text/plain, Size: 54 bytes --]
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
[-- Attachment #2: Type: text/html, Size: 83 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-02-02 13:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-22 12:51 [PATCH v2 0/2] Add a Pcd to override the 16650 HID in SSDT Joey Gouly
2021-01-22 12:51 ` [PATCH v2 1/2] DynamicTablesPkg: Don't use gEfiMdeModulePkgTokenSpaceGuid Joey Gouly
2021-02-02 13:00 ` [edk2-devel] " Alexei Fedorov
2021-01-22 12:51 ` [PATCH v2 2/2] DynamicTablesPkg: Add an override for 16550 HID in SSDT Joey Gouly
2021-02-02 13:01 ` [edk2-devel] " Alexei Fedorov
2021-02-02 13:00 ` [edk2-devel] [PATCH v2 0/2] Add a Pcd to override the 16650 " Alexei Fedorov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox