From: "Abdul Lateef Attar via groups.io" <AbdulLateef.Attar=amd.com@groups.io>
To: gaoliming <gaoliming@byosoft.com.cn>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: 'Pierre Gondois' <pierre.gondois@arm.com>,
'Sami Mujawar' <sami.mujawar@arm.com>
Subject: Re: [edk2-devel] [edk2-stable202405 RESEND PATCH v2 1/1] DynamicTablesPkg: Adds integer to the AML package node
Date: Thu, 9 May 2024 08:39:20 +0000 [thread overview]
Message-ID: <IA1PR12MB645850824861E797CC4D4B6FE0E62@IA1PR12MB6458.namprd12.prod.outlook.com> (raw)
In-Reply-To: <00fc01daa1e4$1bb73d60$5325b820$@byosoft.com.cn>
[-- Attachment #1: Type: text/plain, Size: 7307 bytes --]
[AMD Official Use Only - General]
Hi Liming,
This patch provides an API to add integer value to AML package node.
Using this API user can create CXL device with two PNPID.
Without this API user has to rely on static ASL files.
This patch is required for platform who uses DynamicTablesPkg to generate ACPI tables based on this stable release.
Thanks
AbduL
________________________________
From: gaoliming <gaoliming@byosoft.com.cn>
Sent: Thursday, May 9, 2024 1:10 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>; Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>
Cc: 'Pierre Gondois' <pierre.gondois@arm.com>; 'Sami Mujawar' <sami.mujawar@arm.com>
Subject: 回复: [edk2-devel] [edk2-stable202405 RESEND PATCH v2 1/1] DynamicTablesPkg: Adds integer to the AML package node
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
Abdul:
Can you give more information why this change is required for this stable
tag 202405?
Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Abdul Lateef
> Attar via groups.io
> 发送时间: 2024年5月9日 12:49
> 收件人: devel@edk2.groups.io
> 抄送: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>; Pierre Gondois
> <pierre.gondois@arm.com>; Sami Mujawar <sami.mujawar@arm.com>
> 主题: [edk2-devel] [edk2-stable202405 RESEND PATCH v2 1/1]
> DynamicTablesPkg: Adds integer to the AML package node
>
> Adds an AmlAddIntegerToNamedPackage() API to generate AML code,
> which adds an integer value to the package node.
>
> Cc: Pierre Gondois <pierre.gondois@arm.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> ---
> .../Include/Library/AmlLib/AmlLib.h | 41 +++++++++++-
> .../Common/AmlLib/CodeGen/AmlCodeGen.c | 67
> +++++++++++++++++++
> 2 files changed, 107 insertions(+), 1 deletion(-)
>
> diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> index 82d5464084..4427ab68fa 100644
> --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> @@ -2,7 +2,7 @@
> AML Lib.
>
> Copyright (c) 2019 - 2023, Arm Limited. All rights reserved.<BR>
> - Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
reserved.<BR>
> + Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc. All rights
> reserved.<BR>
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
> **/
> @@ -1743,6 +1743,45 @@ AmlAddNameStringToNamedPackage (
> IN AML_OBJECT_NODE_HANDLE NamedNode
> );
>
> +/** Add an integer value to the named package node.
> +
> + AmlCodeGenNamePackage ("_CID", NULL, &PackageNode);
> + AmlGetEisaIdFromString ("PNP0A03", &EisaId);
> + AmlAddIntegerToNamedPackage (EisaId, NameNode);
> + AmlGetEisaIdFromString ("PNP0A08", &EisaId);
> + AmlAddIntegerToNamedPackage (EisaId, NameNode);
> +
> + equivalent of the following ASL code:
> + Name (_CID, Package (0x02) // _CID: Compatible ID
> + {
> + EisaId ("PNP0A03"),
> + EisaId ("PNP0A08")
> + })
> +
> + The package is added at the tail of the list of the input package node
> + name:
> + Name ("NamePackageNode", Package () {
> + [Pre-existing package entries],
> + [Newly created integer entry]
> + })
> +
> +
> + @ingroup CodeGenApis
> +
> + @param [in] Integer Integer value that need to be added to
> package node.
> + @param [in, out] NameNode Package named node to add the object
> to.
> +
> + @retval EFI_SUCCESS Success.
> + @retval EFI_INVALID_PARAMETER Invalid parameter.
> + @retval Others Error occurred during the operation.
> +**/
> +EFI_STATUS
> +EFIAPI
> +AmlAddIntegerToNamedPackage (
> + IN UINT32 Integer,
> + IN OUT AML_OBJECT_NODE_HANDLE NameNode
> + );
> +
> /** AML code generation to invoke/call another method.
>
> This method is a subset implementation of MethodInvocation
> diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
> b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
> index 22c2d598d0..89fa4e06f8 100644
> --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
> +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c
> @@ -3871,6 +3871,73 @@ exit_handler:
> return Status;
> }
>
> +/** Add an integer value to the named package node.
> +
> + AmlCodeGenNamePackage ("_CID", NULL, &PackageNode);
> + AmlGetEisaIdFromString ("PNP0A03", &EisaId);
> + AmlAddIntegerToNamedPackage (EisaId, NameNode);
> + AmlGetEisaIdFromString ("PNP0A08", &EisaId);
> + AmlAddIntegerToNamedPackage (EisaId, NameNode);
> +
> + equivalent of the following ASL code:
> + Name (_CID, Package (0x02) // _CID: Compatible ID
> + {
> + EisaId ("PNP0A03"),
> + EisaId ("PNP0A08")
> + })
> +
> + The package is added at the tail of the list of the input package node
> + name:
> + Name ("NamePackageNode", Package () {
> + [Pre-existing package entries],
> + [Newly created integer entry]
> + })
> +
> +
> + @ingroup CodeGenApis
> +
> + @param [in] Integer Integer value that need to be added to
> package node.
> + @param [in, out] NameNode Package named node to add the object
> to.
> +
> + @retval EFI_SUCCESS Success.
> + @retval EFI_INVALID_PARAMETER Invalid parameter.
> + @retval Others Error occurred during the operation.
> +**/
> +EFI_STATUS
> +EFIAPI
> +AmlAddIntegerToNamedPackage (
> + IN UINT32 Integer,
> + IN OUT AML_OBJECT_NODE_HANDLE NameNode
> + )
> +{
> + EFI_STATUS Status;
> + AML_OBJECT_NODE *PackageNode;
> +
> + if (NameNode == NULL) {
> + ASSERT_EFI_ERROR (FALSE);
> + return EFI_INVALID_PARAMETER;
> + }
> +
> + PackageNode = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
> + NameNode,
> + EAmlParseIndexTerm1
> + );
> + if ((PackageNode == NULL)
> ||
> + (AmlGetNodeType ((AML_NODE_HANDLE)PackageNode) !=
> EAmlNodeObject) ||
> + (!AmlNodeHasOpCode (PackageNode, AML_PACKAGE_OP, 0)))
> + {
> + ASSERT_EFI_ERROR (FALSE);
> + return EFI_INVALID_PARAMETER;
> + }
> +
> + Status = AmlAddRegisterOrIntegerToPackage (NULL, Integer, PackageNode);
> + if (EFI_ERROR (Status)) {
> + ASSERT_EFI_ERROR (Status);
> + }
> +
> + return Status;
> +}
> +
> /** AML code generation to invoke/call another method.
>
> This method is a subset implementation of MethodInvocation
> --
> 2.34.1
>
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118752): https://edk2.groups.io/g/devel/message/118752
Mute This Topic: https://groups.io/mt/105997619/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 13940 bytes --]
next prev parent reply other threads:[~2024-05-09 8:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-09 4:48 [edk2-devel] [edk2-stable202405 RESEND PATCH v2 0/1] DynamicTablesPkg: Adds integer to the AML package node Abdul Lateef Attar via groups.io
2024-05-09 4:48 ` [edk2-devel] [edk2-stable202405 RESEND PATCH v2 1/1] " Abdul Lateef Attar via groups.io
2024-05-09 7:40 ` 回复: " gaoliming via groups.io
2024-05-09 8:39 ` Abdul Lateef Attar via groups.io [this message]
2024-05-09 9:00 ` gaoliming via groups.io
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=IA1PR12MB645850824861E797CC4D4B6FE0E62@IA1PR12MB6458.namprd12.prod.outlook.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