Skip to content

Commit d8d47a0

Browse files
jbrasenardbiesheuvel
authored andcommitted
DynamicTablesPkg: Add support for non-serial DBG2 devices
This commit adds support for building non-serial DBG2 devices 1. Add new common namespace objects: - EArchCommonObjMemoryRangeDescriptor - EArchCommonObjDbg2DeviceInfo 2. Enhance DBG2 table generator: - Add support for non-serial DBG2 devices - Support multiple debug devices - Improve memory handling with proper allocation checks - Add better cleanup in error paths 3. Update configuration manager: - Add parsers for new common namespace objects Signed-off-by: Jeff Brasen <[email protected]>
1 parent 42c6deb commit d8d47a0

File tree

4 files changed

+563
-261
lines changed

4 files changed

+563
-261
lines changed

DynamicTablesPkg/Include/ArchCommonNameSpaceObjects.h

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @file
22
33
Copyright (c) 2024, Arm Limited. All rights reserved.<BR>
4-
Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.<BR>
4+
Copyright (c) 2024 - 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.<BR>
55
Copyright (C) 2024 - 2025, Advanced Micro Devices, Inc. All rights reserved.
66
77
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -18,6 +18,7 @@
1818
#include <AcpiObjects.h>
1919
#include <StandardNameSpaceObjects.h>
2020

21+
#include <IndustryStandard/AcpiAml.h>
2122
#include <IndustryStandard/Tpm2Acpi.h>
2223

2324
/** The EARCH_COMMON_OBJECT_ID enum describes the Object IDs
@@ -59,6 +60,8 @@ typedef enum ArchCommonObjectID {
5960
EArchCommonObjPssInfo, ///< 32 - P-State status (PSS) Info
6061
EArchCommonObjPpcInfo, ///< 33 - P-State control (PPC) Info
6162
EArchCommonObjStaInfo, ///< 34 - _STA (Device Status) Info
63+
EArchCommonObjMemoryRangeDescriptor, ///< 35 - Memory Range Descriptor
64+
EArchCommonObjGenericDbg2DeviceInfo, ///< 36 - Generic DBG2 Device Info
6265
EArchCommonObjMax
6366
} EARCH_COMMON_OBJECT_ID;
6467

@@ -812,6 +815,41 @@ typedef struct CmArchCommonStaInfo {
812815
UINT32 DeviceStatus;
813816
} CM_ARCH_COMMON_STA_INFO;
814817

818+
/** A structure that describes the
819+
Memory Range descriptor.
820+
821+
ID: EArchCommonObjMemoryRangeDescriptor
822+
*/
823+
typedef struct CmArchCommonMemoryRangeDescriptor {
824+
/// Base address of Memory Range,
825+
UINT64 BaseAddress;
826+
827+
/// Length of the Memory Range.
828+
UINT64 Length;
829+
} CM_ARCH_COMMON_MEMORY_RANGE_DESCRIPTOR;
830+
831+
/** A structure that describes a generic device to add a DBG2 device node from.
832+
833+
ID: EArchCommonObjGenericDbg2DeviceInfo,
834+
*/
835+
typedef struct CmArchCommonDbg2DeviceInfo {
836+
/// Token identifying an array of CM_ARCH_COMMON_MEMORY_RANGE_DESCRIPTOR objects
837+
CM_OBJECT_TOKEN AddressResourceToken;
838+
839+
/// The DBG2 port type
840+
UINT16 PortType;
841+
842+
/// The DBG2 port subtype
843+
UINT16 PortSubtype;
844+
845+
/// Access Size
846+
UINT8 AccessSize;
847+
848+
/** ASCII Null terminated string that will be appended to \_SB_. for the full path.
849+
*/
850+
CHAR8 ObjectName[AML_NAME_SEG_SIZE + 1];
851+
} CM_ARCH_COMMON_DBG2_DEVICE_INFO;
852+
815853
#pragma pack()
816854

817855
#endif // ARCH_COMMON_NAMESPACE_OBJECTS_H_

DynamicTablesPkg/Library/Acpi/Common/AcpiDbg2Lib/AcpiDbg2Lib.inf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
[LibraryClasses]
4242
BaseLib
43+
PrintLib
4344
SsdtSerialPortFixupLib
4445

4546
[FixedPcd]

0 commit comments

Comments
 (0)