diff options
author | Kun Qin <kuqin12@gmail.com> | 2022-06-30 18:00:17 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-09-01 10:27:02 +0000 |
commit | d9c8a9cf11958ead37f7c350986564948b24b4a8 (patch) | |
tree | 82e368704541a6b0ff259679fef53cd2428b51f1 /DynamicTablesPkg/Library/Common | |
parent | b18c0905ee4c244d881ec74edbbcbdf424c8c875 (diff) | |
download | edk2-d9c8a9cf11958ead37f7c350986564948b24b4a8.tar.gz edk2-d9c8a9cf11958ead37f7c350986564948b24b4a8.tar.bz2 edk2-d9c8a9cf11958ead37f7c350986564948b24b4a8.zip |
DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3996
This change added more token fixers for other node types, including
NamedComponentNode, RootComplexNode, and SmmuV3Node.
The corresponding entries for tokenFixer functions table is also updated.
Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
Co-authored-by: Joe Lopez <joelopez@microsoft.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Tested-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'DynamicTablesPkg/Library/Common')
-rw-r--r-- | DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c | 78 |
1 files changed, 75 insertions, 3 deletions
diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c index 84e4bb7e3b..345acab53f 100644 --- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c +++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c @@ -64,6 +64,78 @@ TokenFixerItsGroup ( return EFI_SUCCESS;
}
+/** EArmObjNamedComponent token fixer.
+
+ CmObjectToken fixer function that updates the Tokens in the CmObjects.
+
+ @param [in] CmObject Pointer to the Configuration Manager Object.
+ @param [in] Token Token to be updated in the CmObject.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_UNSUPPORTED Not supported.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+TokenFixerNamedComponentNode (
+ IN CM_OBJ_DESCRIPTOR *CmObject,
+ IN CM_OBJECT_TOKEN Token
+ )
+{
+ ASSERT (CmObject != NULL);
+ ((CM_ARM_NAMED_COMPONENT_NODE *)CmObject->Data)->Token = Token;
+ return EFI_SUCCESS;
+}
+
+/** EArmObjRootComplex token fixer.
+
+ CmObjectToken fixer function that updates the Tokens in the CmObjects.
+
+ @param [in] CmObject Pointer to the Configuration Manager Object.
+ @param [in] Token Token to be updated in the CmObject.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_UNSUPPORTED Not supported.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+TokenFixerRootComplexNode (
+ IN CM_OBJ_DESCRIPTOR *CmObject,
+ IN CM_OBJECT_TOKEN Token
+ )
+{
+ ASSERT (CmObject != NULL);
+ ((CM_ARM_ROOT_COMPLEX_NODE *)CmObject->Data)->Token = Token;
+ return EFI_SUCCESS;
+}
+
+/** EArmObjSmmuV3 token fixer.
+
+ CmObjectToken fixer function that updates the Tokens in the CmObjects.
+
+ @param [in] CmObject Pointer to the Configuration Manager Object.
+ @param [in] Token Token to be updated in the CmObject.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.
+ @retval EFI_UNSUPPORTED Not supported.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+TokenFixerSmmuV3Node (
+ IN CM_OBJ_DESCRIPTOR *CmObject,
+ IN CM_OBJECT_TOKEN Token
+ )
+{
+ ASSERT (CmObject != NULL);
+ ((CM_ARM_SMMUV3_NODE *)CmObject->Data)->Token = Token;
+ return EFI_SUCCESS;
+}
+
/** TokenFixer functions table.
A CmObj having a CM_OBJECT_TOKEN field might need to have its
@@ -90,10 +162,10 @@ CM_OBJECT_TOKEN_FIXER TokenFixer[EArmObjMax] = { NULL, ///< 16 - Hypervisor Vendor Id
NULL, ///< 17 - Fixed feature flags for FADT
TokenFixerItsGroup, ///< 18 - ITS Group
- TokenFixerNotImplemented, ///< 19 - Named Component
- TokenFixerNotImplemented, ///< 20 - Root Complex
+ TokenFixerNamedComponentNode, ///< 19 - Named Component
+ TokenFixerRootComplexNode, ///< 20 - Root Complex
TokenFixerNotImplemented, ///< 21 - SMMUv1 or SMMUv2
- TokenFixerNotImplemented, ///< 22 - SMMUv3
+ TokenFixerSmmuV3Node, ///< 22 - SMMUv3
TokenFixerNotImplemented, ///< 23 - PMCG
NULL, ///< 24 - GIC ITS Identifier Array
NULL, ///< 25 - ID Mapping Array
|