[PATCH v1 3/6] DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers


Kun Qin
 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3996

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@...>
Cc: Alexei Fedorov <Alexei.Fedorov@...>

Co-authored-by: Joe Lopez <joelopez@...>
Signed-off-by: Kun Qin <kuqin12@...>
---
DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c | =
78 +++++++++++++++++++-
1 file changed, 75 insertions(+), 3 deletions(-)

diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTok=
enFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectToke=
nFixer.c
index 84e4bb7e3bc8..345acab53f74 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer=
.c
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer=
.c
@@ -64,6 +64,78 @@ TokenFixerItsGroup (
return EFI_SUCCESS;=0D
}=0D
=0D
+/** EArmObjNamedComponent token fixer.=0D
+=0D
+ CmObjectToken fixer function that updates the Tokens in the CmObjects.=0D
+=0D
+ @param [in] CmObject Pointer to the Configuration Manager Object.=0D
+ @param [in] Token Token to be updated in the CmObject.=0D
+=0D
+ @retval EFI_SUCCESS Success.=0D
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.=0D
+ @retval EFI_UNSUPPORTED Not supported.=0D
+**/=0D
+STATIC=0D
+EFI_STATUS=0D
+EFIAPI=0D
+TokenFixerNamedComponentNode (=0D
+ IN CM_OBJ_DESCRIPTOR *CmObject,=0D
+ IN CM_OBJECT_TOKEN Token=0D
+ )=0D
+{=0D
+ ASSERT (CmObject !=3D NULL);=0D
+ ((CM_ARM_NAMED_COMPONENT_NODE *)CmObject->Data)->Token =3D Token;=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
+/** EArmObjRootComplex token fixer.=0D
+=0D
+ CmObjectToken fixer function that updates the Tokens in the CmObjects.=0D
+=0D
+ @param [in] CmObject Pointer to the Configuration Manager Object.=0D
+ @param [in] Token Token to be updated in the CmObject.=0D
+=0D
+ @retval EFI_SUCCESS Success.=0D
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.=0D
+ @retval EFI_UNSUPPORTED Not supported.=0D
+**/=0D
+STATIC=0D
+EFI_STATUS=0D
+EFIAPI=0D
+TokenFixerRootComplexNode (=0D
+ IN CM_OBJ_DESCRIPTOR *CmObject,=0D
+ IN CM_OBJECT_TOKEN Token=0D
+ )=0D
+{=0D
+ ASSERT (CmObject !=3D NULL);=0D
+ ((CM_ARM_ROOT_COMPLEX_NODE *)CmObject->Data)->Token =3D Token;=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
+/** EArmObjSmmuV3 token fixer.=0D
+=0D
+ CmObjectToken fixer function that updates the Tokens in the CmObjects.=0D
+=0D
+ @param [in] CmObject Pointer to the Configuration Manager Object.=0D
+ @param [in] Token Token to be updated in the CmObject.=0D
+=0D
+ @retval EFI_SUCCESS Success.=0D
+ @retval EFI_INVALID_PARAMETER A parameter is invalid.=0D
+ @retval EFI_UNSUPPORTED Not supported.=0D
+**/=0D
+STATIC=0D
+EFI_STATUS=0D
+EFIAPI=0D
+TokenFixerSmmuV3Node (=0D
+ IN CM_OBJ_DESCRIPTOR *CmObject,=0D
+ IN CM_OBJECT_TOKEN Token=0D
+ )=0D
+{=0D
+ ASSERT (CmObject !=3D NULL);=0D
+ ((CM_ARM_SMMUV3_NODE *)CmObject->Data)->Token =3D Token;=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
/** TokenFixer functions table.=0D
=0D
A CmObj having a CM_OBJECT_TOKEN field might need to have its=0D
@@ -90,10 +162,10 @@ CM_OBJECT_TOKEN_FIXER TokenFixer[EArmObjMax] =3D {
NULL, ///< 16 - Hypervisor Vendor Id=0D
NULL, ///< 17 - Fixed feature flags for FADT=
=0D
TokenFixerItsGroup, ///< 18 - ITS Group=0D
- TokenFixerNotImplemented, ///< 19 - Named Component=0D
- TokenFixerNotImplemented, ///< 20 - Root Complex=0D
+ TokenFixerNamedComponentNode, ///< 19 - Named Component=0D
+ TokenFixerRootComplexNode, ///< 20 - Root Complex=0D
TokenFixerNotImplemented, ///< 21 - SMMUv1 or SMMUv2=0D
- TokenFixerNotImplemented, ///< 22 - SMMUv3=0D
+ TokenFixerSmmuV3Node, ///< 22 - SMMUv3=0D
TokenFixerNotImplemented, ///< 23 - PMCG=0D
NULL, ///< 24 - GIC ITS Identifier Array=0D
NULL, ///< 25 - ID Mapping Array=0D
--=20
2.36.0.windows.1

Join devel@edk2.groups.io to automatically receive all group messages.