public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Kun Qin" <kuqin12@gmail.com>
To: devel@edk2.groups.io
Cc: Sami Mujawar <Sami.Mujawar@arm.com>,
	Alexei Fedorov <Alexei.Fedorov@arm.com>,
	Joe Lopez <joelopez@microsoft.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Pierre Gondois <pierre.gondois@arm.com>
Subject: [PATCH v2 3/6] DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers
Date: Wed, 27 Jul 2022 21:31:44 -0700	[thread overview]
Message-ID: <20220728043147.395-4-kuqin12@gmail.com> (raw)
In-Reply-To: <20220728043147.395-1-kuqin12@gmail.com>

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>
---

Notes:
    v2:
    - Added Reviewed-by tag [Sami]
    - Added Reviewed-by tag [Pierre]

 DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c | 78 +++++++++++++++++++-
 1 file changed, 75 insertions(+), 3 deletions(-)

diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.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;
 }
 
+/** 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
-- 
2.37.1.windows.1


  parent reply	other threads:[~2022-07-28  4:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28  4:31 [PATCH v2 0/6] Enhance DynamicTablesPkg modules Kun Qin
2022-07-28  4:31 ` [PATCH v2 1/6] DynamicTablesPkg: DynamicPlatRepoLib: Added MemoryAllocationLib to inf Kun Qin
2022-07-28  4:31 ` [PATCH v2 2/6] DynamicTablesPkg: DynamicPlatRepoLib: Fix incorrect dereferencing Kun Qin
2022-07-28  4:31 ` Kun Qin [this message]
2022-07-28  4:31 ` [PATCH v2 4/6] DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed tables Kun Qin
2022-07-28 13:07   ` [edk2-devel] " PierreGondois
2022-07-29  5:00     ` Kun Qin
2022-07-29 15:11       ` PierreGondois
2022-07-28  4:31 ` [PATCH v2 5/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM space Kun Qin
2022-07-28 13:07   ` [edk2-devel] " PierreGondois
2022-07-29  5:01     ` Kun Qin
2022-07-28  4:31 ` [PATCH v2 6/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added case handling for PCI config Kun Qin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220728043147.395-4-kuqin12@gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox