* [edk2-devel] [PATCH v1 0/3] DynamicTablesPkg: Updated word I/O
@ 2023-11-29 16:05 Abdul Lateef Attar via groups.io
2023-11-29 16:06 ` [edk2-devel] [PATCH v1 1/3] DynamicTablesPkg: AML Code generation for word I/O ranges Abdul Lateef Attar via groups.io
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Abdul Lateef Attar via groups.io @ 2023-11-29 16:05 UTC (permalink / raw)
To: devel; +Cc: Abdul Lateef Attar, Pierre Gondois, Sami Mujawar
From: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Code changes to
Add API to generate word I/O ranges.
Correct the parameter to generate word bus number.
Corrects the function pointer typedef
PR: https://github.com/tianocore/edk2/pull/5090
Cc: Pierre Gondois <pierre.gondois@arm.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Abdul Lateef Attar (3):
DynamicTablesPkg: AML Code generation for word I/O ranges
DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parameters
DynamicTablesPkg: Corrects function pointer typedef of
AML_PARSE_FUNCTION
.../Include/Library/AmlLib/AmlLib.h | 75 +++++++++++++-
.../AmlLib/CodeGen/AmlResourceDataCodeGen.c | 98 ++++++++++++++++++-
.../Library/Common/AmlLib/Parser/AmlParser.c | 3 +-
3 files changed, 164 insertions(+), 12 deletions(-)
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111847): https://edk2.groups.io/g/devel/message/111847
Mute This Topic: https://groups.io/mt/102874537/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 5+ messages in thread
* [edk2-devel] [PATCH v1 1/3] DynamicTablesPkg: AML Code generation for word I/O ranges
2023-11-29 16:05 [edk2-devel] [PATCH v1 0/3] DynamicTablesPkg: Updated word I/O Abdul Lateef Attar via groups.io
@ 2023-11-29 16:06 ` Abdul Lateef Attar via groups.io
2023-11-29 16:06 ` [edk2-devel] [PATCH v1 2/3] DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parameters Abdul Lateef Attar via groups.io
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Abdul Lateef Attar via groups.io @ 2023-11-29 16:06 UTC (permalink / raw)
To: devel; +Cc: Abdul Lateef Attar, Pierre Gondois, Sami Mujawar
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>
---
.../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
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111848): https://edk2.groups.io/g/devel/message/111848
Mute This Topic: https://groups.io/mt/102874538/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [edk2-devel] [PATCH v1 2/3] DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parameters
2023-11-29 16:05 [edk2-devel] [PATCH v1 0/3] DynamicTablesPkg: Updated word I/O Abdul Lateef Attar via groups.io
2023-11-29 16:06 ` [edk2-devel] [PATCH v1 1/3] DynamicTablesPkg: AML Code generation for word I/O ranges Abdul Lateef Attar via groups.io
@ 2023-11-29 16:06 ` Abdul Lateef Attar via groups.io
2023-11-29 16:06 ` [edk2-devel] [PATCH v1 3/3] DynamicTablesPkg: Corrects function pointer typedef of AML_PARSE_FUNCTION Abdul Lateef Attar via groups.io
2023-11-30 8:40 ` [edk2-devel] [PATCH v1 0/3] DynamicTablesPkg: Updated word I/O PierreGondois
3 siblings, 0 replies; 5+ messages in thread
From: Abdul Lateef Attar via groups.io @ 2023-11-29 16:06 UTC (permalink / raw)
To: devel; +Cc: Abdul Lateef Attar, Pierre Gondois, Sami Mujawar
From: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Corrects the parameters of AmlCodeGenRdWordBusNumber() to
UINT16 to generate word bus number.
Cc: Pierre Gondois <pierre.gondois@arm.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
---
DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h | 10 +++++-----
.../Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c | 10 +++++-----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
index 5e340b94ce..eb8740692f 100644
--- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
+++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h
@@ -714,11 +714,11 @@ AmlCodeGenRdWordBusNumber (
IN BOOLEAN IsMinFixed,
IN BOOLEAN IsMaxFixed,
IN BOOLEAN IsPosDecode,
- IN UINT32 AddressGranularity,
- IN UINT32 AddressMinimum,
- IN UINT32 AddressMaximum,
- IN UINT32 AddressTranslation,
- IN UINT32 RangeLength,
+ IN UINT16 AddressGranularity,
+ IN UINT16 AddressMinimum,
+ IN UINT16 AddressMaximum,
+ IN UINT16 AddressTranslation,
+ IN UINT16 RangeLength,
IN UINT8 ResourceSourceIndex,
IN CONST CHAR8 *ResourceSource,
IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
index 60fe69ba6d..46243f981c 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlResourceDataCodeGen.c
@@ -848,11 +848,11 @@ AmlCodeGenRdWordBusNumber (
IN BOOLEAN IsMinFixed,
IN BOOLEAN IsMaxFixed,
IN BOOLEAN IsPosDecode,
- IN UINT32 AddressGranularity,
- IN UINT32 AddressMinimum,
- IN UINT32 AddressMaximum,
- IN UINT32 AddressTranslation,
- IN UINT32 RangeLength,
+ IN UINT16 AddressGranularity,
+ IN UINT16 AddressMinimum,
+ IN UINT16 AddressMaximum,
+ IN UINT16 AddressTranslation,
+ IN UINT16 RangeLength,
IN UINT8 ResourceSourceIndex,
IN CONST CHAR8 *ResourceSource,
IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111849): https://edk2.groups.io/g/devel/message/111849
Mute This Topic: https://groups.io/mt/102874539/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [edk2-devel] [PATCH v1 3/3] DynamicTablesPkg: Corrects function pointer typedef of AML_PARSE_FUNCTION
2023-11-29 16:05 [edk2-devel] [PATCH v1 0/3] DynamicTablesPkg: Updated word I/O Abdul Lateef Attar via groups.io
2023-11-29 16:06 ` [edk2-devel] [PATCH v1 1/3] DynamicTablesPkg: AML Code generation for word I/O ranges Abdul Lateef Attar via groups.io
2023-11-29 16:06 ` [edk2-devel] [PATCH v1 2/3] DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parameters Abdul Lateef Attar via groups.io
@ 2023-11-29 16:06 ` Abdul Lateef Attar via groups.io
2023-11-30 8:40 ` [edk2-devel] [PATCH v1 0/3] DynamicTablesPkg: Updated word I/O PierreGondois
3 siblings, 0 replies; 5+ messages in thread
From: Abdul Lateef Attar via groups.io @ 2023-11-29 16:06 UTC (permalink / raw)
To: devel; +Cc: Abdul Lateef Attar, Pierre Gondois, Sami Mujawar
From: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Corrects the function pointer typedef AML_PARSE_FUNCTION,
otherwise some compiler like VS2019 gives error.
Cc: Pierre Gondois <pierre.gondois@arm.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
---
DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c
index 8e584d4930..d3a51a94c7 100644
--- a/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c
+++ b/DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.c
@@ -100,8 +100,7 @@ AmlParseStream (
**/
typedef
EFI_STATUS
-EFIAPI
-(*AML_PARSE_FUNCTION) (
+(EFIAPI *AML_PARSE_FUNCTION)(
IN CONST AML_NODE_HEADER *Node,
IN AML_PARSE_FORMAT ExpectedFormat,
IN OUT AML_STREAM *FStream,
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111850): https://edk2.groups.io/g/devel/message/111850
Mute This Topic: https://groups.io/mt/102874541/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [edk2-devel] [PATCH v1 0/3] DynamicTablesPkg: Updated word I/O
2023-11-29 16:05 [edk2-devel] [PATCH v1 0/3] DynamicTablesPkg: Updated word I/O Abdul Lateef Attar via groups.io
` (2 preceding siblings ...)
2023-11-29 16:06 ` [edk2-devel] [PATCH v1 3/3] DynamicTablesPkg: Corrects function pointer typedef of AML_PARSE_FUNCTION Abdul Lateef Attar via groups.io
@ 2023-11-30 8:40 ` PierreGondois
3 siblings, 0 replies; 5+ messages in thread
From: PierreGondois @ 2023-11-30 8:40 UTC (permalink / raw)
To: Abdul Lateef Attar, devel; +Cc: Abdul Lateef Attar, Sami Mujawar
Hello Abdul,
Thanks for the patches,
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
Regards,
Pierre
On 11/29/23 17:05, Abdul Lateef Attar wrote:
> From: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
>
> Code changes to
> Add API to generate word I/O ranges.
> Correct the parameter to generate word bus number.
> Corrects the function pointer typedef
>
> PR: https://github.com/tianocore/edk2/pull/5090
>
> Cc: Pierre Gondois <pierre.gondois@arm.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
>
> Abdul Lateef Attar (3):
> DynamicTablesPkg: AML Code generation for word I/O ranges
> DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parameters
> DynamicTablesPkg: Corrects function pointer typedef of
> AML_PARSE_FUNCTION
>
> .../Include/Library/AmlLib/AmlLib.h | 75 +++++++++++++-
> .../AmlLib/CodeGen/AmlResourceDataCodeGen.c | 98 ++++++++++++++++++-
> .../Library/Common/AmlLib/Parser/AmlParser.c | 3 +-
> 3 files changed, 164 insertions(+), 12 deletions(-)
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111899): https://edk2.groups.io/g/devel/message/111899
Mute This Topic: https://groups.io/mt/102874537/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-11-30 8:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-29 16:05 [edk2-devel] [PATCH v1 0/3] DynamicTablesPkg: Updated word I/O Abdul Lateef Attar via groups.io
2023-11-29 16:06 ` [edk2-devel] [PATCH v1 1/3] DynamicTablesPkg: AML Code generation for word I/O ranges Abdul Lateef Attar via groups.io
2023-11-29 16:06 ` [edk2-devel] [PATCH v1 2/3] DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parameters Abdul Lateef Attar via groups.io
2023-11-29 16:06 ` [edk2-devel] [PATCH v1 3/3] DynamicTablesPkg: Corrects function pointer typedef of AML_PARSE_FUNCTION Abdul Lateef Attar via groups.io
2023-11-30 8:40 ` [edk2-devel] [PATCH v1 0/3] DynamicTablesPkg: Updated word I/O PierreGondois
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox