From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mx.groups.io with SMTP id smtpd.web11.29068.1658982714039278204 for ; Wed, 27 Jul 2022 21:31:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kGI/EJNy; spf=pass (domain: gmail.com, ip: 209.85.215.174, mailfrom: kuqin12@gmail.com) Received: by mail-pg1-f174.google.com with SMTP id 72so631239pge.0 for ; Wed, 27 Jul 2022 21:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ji0D/ZgFHdYVHc61ya2mH7aMtk/SEqUJS39I6lelqXI=; b=kGI/EJNyomZqY1+ad+BCDtdq3gCBXUKvSmZLAhSfQXs/TnypD4aFa0AWqyNeOQLIqH yThmBSpubjn76A8wauYJf4SPCfGgsHVvxJZ7L0fyc5qBRQMHa8mx7JoGVhZF7fUb2lzr Jurq5oGZOncEh/nyN+A59n372szielCJJvGs8j+I/VmToZWLpSrPV4npaggmUN+ZQT3Y V5hXTbc6IL7lb4H2lOqozWSHmQSYFFm0WKMXaz9zXrb8LBC+65ApTO/KigU5TywJdujp lybXLGNYjTqK7OfYYycvJBC4YDZRFDdE0GiY9Xp5+aa0xh7UcRDhPyxoFy34kraq68qs kSxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ji0D/ZgFHdYVHc61ya2mH7aMtk/SEqUJS39I6lelqXI=; b=o7rP9tn2+KtcSL2lVJvm0s6EkrPC2GVWsuGEd/Ko+lpa3sLVx4ilpje8qMv7w3OwUK Cqmt3reVYYD5tu/HapWDrKWzEiHW1NdZvSHnlmr48EfDaMpMGqVgc0BpTxhkXswigeBt Bu0vXnsJqEusFsGYAnprcstXo8QZZhXf9bXfxY0fFS+MljRdkwo9We+4aE+5jA3Ae/uL b7SR2nmGXEmaQofYDwLz1/ySBkkhmySYL8XkPrbDWgkwa+PtUkoGepNLWoNfwvHwkUL5 QbdcmlZiZ+KrmhbWHMEywIm8YndiYSxqtu+RbadqxmJrabipg1A7UHbcvqDlB3HGOvAo 8vEg== X-Gm-Message-State: AJIora+8I+AjlpNZBriaQhfyXlceQc6G/blS7o/9bE+IkIunxFBMhsd1 5QDww0bObdtQXHTgYqTnjjw1rHCiIcc= X-Google-Smtp-Source: AGRyM1uyL0w7cfntTmiY7YIF/HQOo1OjNIzSoM6ImU7Ftk6noUmPcXmzYAZm+pQ54GLFL7/Y3p4nJw== X-Received: by 2002:a05:6a00:1a04:b0:52a:d4dc:5653 with SMTP id g4-20020a056a001a0400b0052ad4dc5653mr6790931pfv.69.1658982713251; Wed, 27 Jul 2022 21:31:53 -0700 (PDT) Return-Path: Received: from MININT-0U7P5GU.redmond.corp.microsoft.com ([2001:4898:80e8:36:7fef:12fc:943:d465]) by smtp.gmail.com with ESMTPSA id ik1-20020a170902ab0100b0016c48c52ce4sm14716392plb.204.2022.07.27.21.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 21:31:53 -0700 (PDT) From: "Kun Qin" To: devel@edk2.groups.io Cc: Sami Mujawar , Alexei Fedorov , Joe Lopez , Sami Mujawar , Pierre Gondois Subject: [PATCH v2 3/6] DynamicTablesPkg: DynamicPlatRepoLib: Adding more token fixers Date: Wed, 27 Jul 2022 21:31:44 -0700 Message-Id: <20220728043147.395-4-kuqin12@gmail.com> X-Mailer: git-send-email 2.37.1.windows.1 In-Reply-To: <20220728043147.395-1-kuqin12@gmail.com> References: <20220728043147.395-1-kuqin12@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Cc: Alexei Fedorov Co-authored-by: Joe Lopez Signed-off-by: Kun Qin Reviewed-by: Sami Mujawar Reviewed-by: Pierre Gondois --- 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/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.37.1.windows.1