public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sami Mujawar" <sami.mujawar@arm.com>
To: Abdul Lateef Attar <abdattar@amd.com>, devel@edk2.groups.io
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>,
	Pierre Gondois <pierre.gondois@arm.com>,
	"nd@arm.com" <nd@arm.com>
Subject: Re: [edk2-devel] [Resend PATCH v5 1/4] DynamicTablesPkg: AML Code generation for word I/O ranges
Date: Thu, 21 Dec 2023 13:53:09 +0000	[thread overview]
Message-ID: <d3fdcedb-ad78-4fa0-9026-41e3f0d7212b@arm.com> (raw)
In-Reply-To: <5b55e437561bb634f848050fb170b804c519c7ec.1703064925.git.AbdulLateef.Attar@amd.com>

Hi Abdul,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 20/12/2023 09:38 am, Abdul Lateef Attar wrote:
> From: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
>
> Add helper functions to generate AML resource data
> for word I/O.
>
> Cc: Pierre Gondois <pierre.gondois@arm.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
> ---
>   .../Include/Library/AmlLib/AmlLib.h           | 65 ++++++++++++++
>   .../AmlLib/CodeGen/AmlResourceDataCodeGen.c   | 88 +++++++++++++++++++
>   2 files changed, 153 insertions(+)
>
> diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> index 71e8539b30..5e340b94ce 100644
> --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
> @@ -2,6 +2,7 @@
>     AML Lib.
>   
>     Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
> +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
>   
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>   **/
> @@ -724,6 +725,70 @@ AmlCodeGenRdWordBusNumber (
>     OUT       AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL
>     );
>   
> +/** Code generation for the "WordIO ()" ASL function.
> +
> +  The Resource Data effectively created is a Word Address Space Resource
> +  Data. Cf ACPI 6.5:
> +   - s6.4.3.5.3 "Word Address Space Descriptor".
> +
> +  The created resource data node can be:
> +   - appended to the list of resource data elements of the NameOpNode.
> +     In such case NameOpNode must be defined by a the "Name ()" ASL statement
> +     and initially contain a "ResourceTemplate ()".
> +   - returned through the NewRdNode parameter.
> +
> +  @param [in]  IsResourceConsumer   ResourceUsage parameter.
> +  @param [in]  IsMinFixed           Minimum address is fixed.
> +  @param [in]  IsMaxFixed           Maximum address is fixed.
> +  @param [in]  IsPosDecode          Decode parameter
> +  @param [in]  IsaRanges            Possible values are:
> +                                     0-Reserved
> +                                     1-NonISAOnly
> +                                     2-ISAOnly
> +                                     3-EntireRange
> +  @param [in]  AddressGranularity   Address granularity.
> +  @param [in]  AddressMinimum       Minimum address.
> +  @param [in]  AddressMaximum       Maximum address.
> +  @param [in]  AddressTranslation   Address translation.
> +  @param [in]  RangeLength          Range length.
> +  @param [in]  ResourceSourceIndex  Resource Source index.
> +                                    Not supported. Must be 0.
> +  @param [in]  ResourceSource       Resource Source.
> +                                    Not supported. Must be NULL.
> +  @param [in]  IsDenseTranslation   TranslationDensity parameter.
> +  @param [in]  IsTypeStatic         TranslationType parameter.
> +  @param [in]  NameOpNode           NameOp object node defining a named object.
> +                                    If provided, append the new resource data
> +                                    node to the list of resource data elements
> +                                    of this node.
> +  @param [out] NewRdNode            If provided and success,
> +                                    contain the created node.
> +
> +  @retval EFI_SUCCESS             The function completed successfully.
> +  @retval EFI_INVALID_PARAMETER   Invalid parameter.
> +  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
> +**/
> +EFI_STATUS
> +EFIAPI
> +AmlCodeGenRdWordIo (
> +  IN        BOOLEAN IsResourceConsumer,
> +  IN        BOOLEAN IsMinFixed,
> +  IN        BOOLEAN IsMaxFixed,
> +  IN        BOOLEAN IsPosDecode,
> +  IN        UINT8 IsaRanges,
> +  IN        UINT16 AddressGranularity,
> +  IN        UINT16 AddressMinimum,
> +  IN        UINT16 AddressMaximum,
> +  IN        UINT16 AddressTranslation,
> +  IN        UINT16 RangeLength,
> +  IN        UINT8 ResourceSourceIndex,
> +  IN  CONST CHAR8 *ResourceSource,
> +  IN        BOOLEAN IsDenseTranslation,
> +  IN        BOOLEAN IsTypeStatic,
> +  IN        AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
> +  OUT       AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL
> +  );
> +
>   /** Code generation for the "QWordIO ()" ASL function.
>   
>     The Resource Data effectively created is a QWord Address Space Resource
> diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
> index 0bc1c1d119..60fe69ba6d 100644
> --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
> +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
> @@ -2,6 +2,7 @@
>     AML Resource Data Code Generation.
>   
>     Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<BR>
> +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
>   
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>   
> @@ -878,6 +879,93 @@ AmlCodeGenRdWordBusNumber (
>              );
>   }
>   
> +/** Code generation for the "WordIO ()" ASL function.
> +
> +  The Resource Data effectively created is a Word Address Space Resource
> +  Data. Cf ACPI 6.5:
> +   - s6.4.3.5.3 "Word Address Space Descriptor".
> +
> +  The created resource data node can be:
> +   - appended to the list of resource data elements of the NameOpNode.
> +     In such case NameOpNode must be defined by a the "Name ()" ASL statement
> +     and initially contain a "ResourceTemplate ()".
> +   - returned through the NewRdNode parameter.
> +
> +  @param [in]  IsResourceConsumer   ResourceUsage parameter.
> +  @param [in]  IsMinFixed           Minimum address is fixed.
> +  @param [in]  IsMaxFixed           Maximum address is fixed.
> +  @param [in]  IsPosDecode          Decode parameter
> +  @param [in]  IsaRanges            Possible values are:
> +                                     0-Reserved
> +                                     1-NonISAOnly
> +                                     2-ISAOnly
> +                                     3-EntireRange
> +  @param [in]  AddressGranularity   Address granularity.
> +  @param [in]  AddressMinimum       Minimum address.
> +  @param [in]  AddressMaximum       Maximum address.
> +  @param [in]  AddressTranslation   Address translation.
> +  @param [in]  RangeLength          Range length.
> +  @param [in]  ResourceSourceIndex  Resource Source index.
> +                                    Not supported. Must be 0.
> +  @param [in]  ResourceSource       Resource Source.
> +                                    Not supported. Must be NULL.
> +  @param [in]  IsDenseTranslation   TranslationDensity parameter.
> +  @param [in]  IsTypeStatic         TranslationType parameter.
> +  @param [in]  NameOpNode           NameOp object node defining a named object.
> +                                    If provided, append the new resource data
> +                                    node to the list of resource data elements
> +                                    of this node.
> +  @param [out] NewRdNode            If provided and success,
> +                                    contain the created node.
> +
> +  @retval EFI_SUCCESS             The function completed successfully.
> +  @retval EFI_INVALID_PARAMETER   Invalid parameter.
> +  @retval EFI_OUT_OF_RESOURCES    Could not allocate memory.
> +**/
> +EFI_STATUS
> +EFIAPI
> +AmlCodeGenRdWordIo (
> +  IN        BOOLEAN IsResourceConsumer,
> +  IN        BOOLEAN IsMinFixed,
> +  IN        BOOLEAN IsMaxFixed,
> +  IN        BOOLEAN IsPosDecode,
> +  IN        UINT8 IsaRanges,
> +  IN        UINT16 AddressGranularity,
> +  IN        UINT16 AddressMinimum,
> +  IN        UINT16 AddressMaximum,
> +  IN        UINT16 AddressTranslation,
> +  IN        UINT16 RangeLength,
> +  IN        UINT8 ResourceSourceIndex,
> +  IN  CONST CHAR8 *ResourceSource,
> +  IN        BOOLEAN IsDenseTranslation,
> +  IN        BOOLEAN IsTypeStatic,
> +  IN        AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
> +  OUT       AML_DATA_NODE_HANDLE    *NewRdNode  OPTIONAL
> +  )
> +{
> +  return AmlCodeGenRdWordSpace (
> +           ACPI_ADDRESS_SPACE_TYPE_IO,
> +           IsResourceConsumer,
> +           IsPosDecode,
> +           IsMinFixed,
> +           IsMaxFixed,
> +           RdIoRangeSpecificFlags (
> +             IsaRanges,
> +             IsDenseTranslation,
> +             IsTypeStatic
> +             ),
> +           AddressGranularity,
> +           AddressMinimum,
> +           AddressMaximum,
> +           AddressTranslation,
> +           RangeLength,
> +           ResourceSourceIndex,
> +           ResourceSource,
> +           NameOpNode,
> +           NewRdNode
> +           );
> +}
> +
>   /** Code generation for the "QWordSpace ()" ASL function.
>   
>     The Resource Data effectively created is a QWord Address Space Resource


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112814): https://edk2.groups.io/g/devel/message/112814
Mute This Topic: https://groups.io/mt/103278518/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-12-21 13:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20  9:38 [edk2-devel] [Resend PATCH v5 0/4] DynamicTablesPkg: Adds WordIO and method invocation ability Abdul Lateef Attar via groups.io
2023-12-20  9:38 ` [edk2-devel] [Resend PATCH v5 1/4] DynamicTablesPkg: AML Code generation for word I/O ranges Abdul Lateef Attar via groups.io
2023-12-21 13:53   ` Sami Mujawar [this message]
2023-12-20  9:38 ` [edk2-devel] [Resend PATCH v5 2/4] DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parameters Abdul Lateef Attar via groups.io
2023-12-21 13:53   ` Sami Mujawar
2023-12-20  9:38 ` [edk2-devel] [Resend PATCH v5 3/4] DynamicTablesPkg: Corrects function pointer typedef of AML_PARSE_FUNCTION Abdul Lateef Attar via groups.io
2023-12-21 13:54   ` Sami Mujawar
2023-12-22  4:16     ` Abdul Lateef Attar via groups.io
2023-12-20  9:38 ` [edk2-devel] [Resend PATCH v5 4/4] DynamicTablesPkg: AML Code generation to invoke a method Abdul Lateef Attar via groups.io
2023-12-20 10:19   ` PierreGondois
2023-12-21 13:55   ` Sami Mujawar
2023-12-22  4:10     ` Abdul Lateef Attar via groups.io
2023-12-21 13:56 ` [edk2-devel] [Resend PATCH v5 0/4] DynamicTablesPkg: Adds WordIO and method invocation ability Sami Mujawar
     [not found] ` <17A2DD5CE37E2833.24485@groups.io>
2023-12-21 16:34   ` Sami Mujawar
2023-12-22  3:59     ` Abdul Lateef Attar via groups.io
2023-12-22  8:49       ` Sami Mujawar

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=d3fdcedb-ad78-4fa0-9026-41e3f0d7212b@arm.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