summaryrefslogtreecommitdiff
path: root/DynamicTablesPkg/Include/Library
AgeCommit message (Collapse)AuthorFilesLines
13 daysDynamicTablesPkg: SsdtSerialPortFixupLib: Add GICv5 IRQ ranges to IRQ checkSarah Walker1-0/+13
To support SPCR with GicV5, check GiCv5 SPI IRQ ranges too. And cleanup for ifdef for ARM specific validation with the Arch specific function to validate serial port information. Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib logical equality generatorVarshit Pandya1-0/+45
Add AmlCodeGenEqual() to create an AML LEqual expression from two supplied operands. Use the existing AML_METHOD_PARAM representation for integer, method argument, and local variable operands. The generated equality expression can be used as a predicate by control-flow objects. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib If code generatorVarshit Pandya1-0/+39
Add AmlCodeGenIf() to create an AML If object from a supplied predicate node. The API takes ownership of the predicate and returns an If node to which executable statements can subsequently be appended. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib Store generatorVarshit Pandya1-0/+44
Add AmlCodeGenStoreToName() to create an AML Store operation with a typed source operand and a named target. Support integer, method argument and local variable sources using the AML_METHOD_PARAM representation. Append the generated Store node to an optional parent object. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib NamedField code generatorVarshit Pandya1-0/+36
Add AmlCodeGenFieldElemNamed() to create a named element within an AML Field list. The API validates the supplied NameSeg and field length, encodes the length using the AML FieldPkgLen format, and appends the resulting NamedField node to its parent Field object. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib ReservedField code generatorVarshit Pandya1-0/+36
Add AmlCodeGenFieldElemReserved() to create an AML ReservedField element and append it to a Field list. The API accepts the reserved range length in bits and validates that the parent supports a Field list. ReservedField elements describe unnamed gaps in Field declarations and can be used when translating ASL Offset() declarations. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib Field code generatorVarshit Pandya1-0/+70
Add AmlCodeGenField() to create an empty AML Field object associated with an OperationRegion. Expose access type, lock rule, and update rule through typed public enumerations and encode them in the Field flags byte. The generated Field node can be attached directly to a parent or returned so that field elements can subsequently be appended. For example, the API can generate: Field (REG0, DWordAcc, NoLock, Preserve) { } Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Add AmlLib OperationRegion code generatorVarshit Pandya1-1/+54
Add AmlCodeGenOperationRegion() to create an AML OperationRegion object from a region name, address space, integer offset, and integer length. The API creates the OperationRegion object and populates its four fixed AML operands: - RegionName - RegionSpace - RegionOffset - RegionLength RegionOffset and RegionLength are encoded using the smallest suitable AML integer representation. The generated node can either be attached directly to a supplied parent or returned to the caller for later use. For example, the API can generate an object equivalent to: OperationRegion ( REG0, SystemMemory, RegionOffset, RegionLength ) This provides generators with a reusable way to describe register regions without relying on a precompiled ASL template. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Expose AmlLib Notify generatorVarshit Pandya1-0/+29
Make AmlCodeGenNotify() public and declare it in AmlLib.h. Add the new API to the CodeGen documentation group. Callers currently cannot append an individual Notify operation while incrementally constructing a method body. For example, this enables generators to construct _EVT methods containing conditional register writes and device notifications. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-09-10DynamicTablesPkg: Document AmlLib code generator APIsVarshit Pandya1-0/+23
Add AmlCodeGenMethod() and other missing public functions to the CodeGen API documentation group. Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-07-31DynamicTablesPkg/AmlLib: Add AmlCodeGenMethodRetBuffer APITuan Phan1-0/+51
Add support for generating AML methods that return a buffer through the new AmlCodeGenMethodRetBuffer() API. Signed-off-by: Tuan Phan <tuan.phan@oss.qualcomm.com>
2026-07-31DynamicTablesPkg/AmiLib: Make AmlCodeGenMethod publicTuan Phan1-0/+44
There is currently no API available for generating AML methods without a return value. This change exports the AmlCodeGenMethod API so it can be used to create non-returning methods when required. Signed-off-by: Tuan Phan <tuan.phan@oss.qualcomm.com>
2026-07-25DynamicTablesPkg: Use ArmSmcccSocIdLib for SoC IDVarshitPandya1-7/+10
Update SmbiosSmcLib to use ArmSmcccSocIdLib for retrieving the JEP106 identification code and SoC revision. Remove the duplicated SMCCC feature detection and SoC ID calls while retaining the SMBIOS-specific formatting of the Type 4 Processor ID. Signed-off-by: Varshit Pandya <Varshit.Pandya@arm.com>
2026-07-11DynamicTablesPkg: Add AmlUpdateRdDWord() and AmlUpdateRdWord()Pierre Gondois1-0/+42
Add the following functions to the AmlResourceDataApi: - AmlUpdateRdDWord() - AmlUpdateRdWord() Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-07-06DynamicTablesPkg: Fix memory leak in MetaDataObjLib libraryOleksandr Tymoshenko1-2/+2
Clean up all metadata entries when freeing a metadata handle in MetadataFreeHandle. Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>
2026-06-05DynamicTablesPkg/SmbiosStringTableLib: Add AllocateSmbiosRecord helperGirish Mahadevan1-0/+24
Add AllocateSmbiosRecord() to SmbiosStringTableLib to encapsulate the SMBIOS spec Section 6.1.3 string-area termination rule. Callers pass the fixed structure size and an optional string table; the function appends the correct string area (two-byte double-NULL when no strings are present, or the full string set size from StringTableGetStringSetSize() when strings exist). This removes the need for each generator to open-code the double-NULL or manually compute the string area size. Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com> Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-05-25DynamicTablesPkg/AmlLib: Add AmlMethodParamTypeBuffer supportAbdul Lateef Attar1-2/+7
Extend AML_METHOD_PARAM_TYPE enum with AmlMethodParamTypeBuffer (= 4) to allow callers to pass a raw byte Buffer as an AML method argument. Add a Buffer case to the switch in AmlCodeGenInvokeMethod() that delegates to the existing AmlCodeGenBuffer() helper, with NULL-pointer and zero-length guards matching the pattern of the other cases. AmlCodeGenReturnInvokeMethod() already delegates to AmlCodeGenInvokeMethod() so it picks up the new case automatically. Update AML_METHOD_PARAM documentation: clarify that DataSize carries the byte count when Type is AmlMethodParamTypeBuffer, and update the union/struct field comments accordingly. Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2026-03-11DynamicTablesPkg/AmlLib: Adds API method returning method invocationsAbdul Lateef Attar1-0/+65
Introduce AmlCodeGenReturnInvokeMethod(), a new AML code generation API that creates AML code for methods whose body returns the result of a method invocation, i.e. Return(MethodName(args...)). Supported parameter types for method arguments include: - AmlMethodParamTypeInteger: Integer constants. - AmlMethodParamTypeString: String literals. - AmlMethodParamTypeArg: ArgObj references (Arg0-Arg6). - AmlMethodParamTypeLocal: LocalObj references (Local0-Local7). The resulting MethodInvocation node is wrapped in a Return statement via AmlCodeGenReturn() and linked to the specified parent node. Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2026-03-11DynamicTablesPkg/AmlLib: Refactor AmlCodeGenInvokeMethod APIAbdul Lateef Attar1-13/+15
Refactor AmlCodeGenInvokeMethod() to construct a proper AML_METHOD_INVOC_OP wrapper node instead of attaching the method name and argument nodes directly as siblings to the parent. This aligns the implementation with AmlCodeGenReturnInvokeMethod(). The method invocation is now built as a structured node with: - FixedArg[0]: method name string (NameString data node) - FixedArg[1]: argument count (UINT8 data node) - VarList: parameter nodes (integer, string, ArgObj, LocalObj) Also add an optional OUT NewObjectNode parameter so callers can retrieve the created MethodInvocation node, and make ParentNode optional, matching the convention used by other AmlLib CodeGen APIs. Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2026-02-24DynamicTablesPkg: Replace include guards with #pragma onceMichael Kubacki14-56/+14
Replace traditional `#ifndef`/`#define`/`#endif` include guards with `#pragma` once. `#pragma once` is a widely supported preprocessor directive that prevents header files from being included multiple times. It is supported by all toolchains used to build edk2: GCC, Clang/LLVM, and MSVC. Compared to macro-based include guards, `#pragma once`: - Eliminates the risk of macro name collisions or copy/paste errors where two headers inadvertently use the same guard macro. - Eliminate inconsistency in the way include guard macros are named (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.). - Reduces boilerplate (three lines replaced by one). - Avoids polluting the macro namespace with guard symbols. - Can improve build times as the preprocessor can skip re-opening the file entirely, rather than re-reading it to find the matching `#endif` ("multiple-include optimization"). - Note that some compilers may already optimize traditional include guards, by recognzining the idiomatic pattern. This change is made acknowledging that overall portability of the code will technically be reduced, as `#pragma once` is not part of the C/C++ standards. However, this is considered acceptable given: 1. edk2 already defines a subset of supported compilers in BaseTools/Conf/tools_def.template, all of which have supported `#pragma once` for over two decades. 2. There have been concerns raised to the project about inconsistent include guard naming and potential macro collisions. Approximate compiler support dates: - MSVC: Supported since Visual C++ 4.2 (1996) - GCC: Supported since 3.4 (2004) (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html) - Clang (LLVM based): Since initial release in 2007 Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-01-26DynamicTablesPkg: Adds API to create method with Notify supportAbdul Lateef Attar1-1/+81
Adds APIs to create AML methods with Notify support in the AmlLib library. New API takes additional parameters for Notify type and Notify value. Notify type can be one of NameString, Local or Arg. Notification value is an integer representing the Notify value. Ref: ACPI spec 6.5 section 19.6.94 Notify (Notify Object of Event) Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-10-13DynamicTablesPkg: Add helper to add CmObj with given tokenSarah Walker2-0/+6
Implement function to add a CmObj with a token provided by the caller. This is intended to be used with abstract tokens, the value of which is generated by the caller. Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-09-30DynamicTablesPkg: Add SmbiosSmcLibSarah Walker1-0/+24
Implement a support library for SMBIOS-related SMC calls. Currently this implements a function to return the SoC ID. Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-07-29DynamicTablesPkg: add Tpm2DeviceTableLib to generate Tpm2 device tableLevi Yun1-0/+50
Introduce Tpm2DeviceTableLib to generate SSDT table which describes Tpm2 devices. This dynamic table generation is controlled by PcdGenTpm2DeviceTable which default value is FALSE. When it is TRUE, the TPM2 device ssdt table is generated when TPM2 ACPI table is generated. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-07-21DynamicTablesPkg: Adds AML code generation for serial UART RDAbdul Lateef Attar1-0/+75
Adds AML code generation for Serial UART resource descriptor. This commit introduces helper functions to generate AML resource data for serial UART resource descriptor. Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-07-21DynamicTablesPkg: Adds AML code generation for IRQAbdul Lateef Attar1-0/+42
Adds AML code generation for IRQ resource descriptor. This commit introduces helper functions to generate AML resource data for IRQ resource descriptors. Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-06-11DynamicTablesPkg: Add GetProximityDomainId() to CmObjHelperLibPierre Gondois1-0/+31
Proximity domains Ids should now be described using the CM_ARCH_COMMON_PROXIMITY_DOMAIN_INFO object. This adds a level of indirection: a Token allows to retrieve a CM_ARCH_COMMON_PROXIMITY_DOMAIN_INFO object, and this object might either have a hard-coded Id, or rely on the MetadataObjLib to generate an Id. Add a GetProximityDomainId () function to the CmObjHelperLib to factorize this level of abstraction and allow other generators to re-use the logic. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-06-11DynamicTablesPkg: Add CmObjHelperLibPierre Gondois1-0/+27
Some generators share some logic in how they handle CmObj. In an effort to factorize this code, create a CmObjHelperLib, aiming to host the common CmObj manipulation logic. Start by adding a CheckAcpiTablePresent() function, allowing to check if an ACPI table is in the list of the tables to install. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-06-11DynamicTablesPkg: Add MetadataHandlerLib libraryPierre Gondois1-0/+57
Built on top of the MetadataObjLib, this library aims to provide functions for each METADATA_ID to: - Generate new Metadata on the fly: the caller provides minimal information for a METADATA_ID, and the library generates the missing information. - Validate all the Metadata objects for a METADATA_ID. For instance, _UID must be unique for a _HID/_CID/EISAID. This patch also adds support for generation/validation of: - UIDs: For each EISAID or NameId, UIDs must be unique. The generation if UIDs is done by a per-EISAID/NameId incrementing counter. The validation of the Metadata consists in checking for the uniqueness of the UID per EISAID/NameId. - ProximityDomains: Proximity Domain Ids are generated by a counter, starting from 0. The validation of the Metadata consists in checking for the uniqueness of the proximity domain Ids. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-06-11DynamicTablesPkg: Add MetaDataObjLib libraryPierre Gondois1-0/+186
The DynamicTablesPkg allows to generate firmware tables based on information provided by a user or another source of information (a device tree for instance). Some information might be implicitly generated by generators. For instance, for ACPI tables, AML names or Uids are created by generators, but not provided by the user or another source of information. Some generators might need to cross-reference object/generated data that was previous generated for an object by another generator. For instance, there are three different generators creating serial ports in the AML namespace. These 3 generators must ensure not to use an Id which was not already created by another generator. Another example would be a generator needing to reference the AML path of a serial port. As the AML path is dynamically generated, this is currently not possible to do. Add a MetaDataObjLib library to keep track of the meta-data previously generated for an object. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-02-25DynamicTablesPkg/AmlLib: Implement C-State and P-State ACPI objectAbdul Lateef Attar1-1/+189
This commit introduces a set of functions designed to facilitate the creation and management of C-State (_CST, _CSD) and P-State (_PCT, _PSS) ACPI objects. Detailed Summary: 1) AmlCreateCstNode(): This function is responsible for creating a _CST (C-State) node, which is essential for defining processor idle states. 2) AmlAddCstState(): This function adds a C-State package to an existing CST node, allowing for the specification of individual C-State entries. 3) AmlCreateCsdNode(): This function creates a _CSD (C-State Dependency) node, which is used to describe dependencies between different C-States. 4) AmlCreatePctNode(): This function generates a _PCT (Performance Control) node, complete with PCT packages, to manage performance state transitions. 5) AmlCreatePssNode(): This function creates a _PSS (Performance Supported States) node, which lists the supported performance states for a processor. Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2024-08-30DynamicTablesPkg: AML code generation for IO resouce descriptor.Abdul Lateef Attar1-0/+42
Add helper functions to generate AML resource data for I/O resource descriptor. Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2024-07-29DynamicTablesPkg: Move Pci Config Space Info to Arm namespaceSami Mujawar1-6/+6
Move Pci Config Space Info object from Arm Namespace to the Arch Common namespace. Correspondingly also update the following modules to reflect the changes introduced by the move: - MCFG generator - SSDT PCIe generator - SSDT PCIe support library - ConfigurationManagerObjectParser - Dynamic Plat Repo TokenFixer map - FdtHwInfoParserLib/Pci/ArmPciConfigSpaceParser Cc: Pierre Gondois <Pierre.Gondois@arm.com> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com> Cc: Jeshua Smith <jeshuas@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2024-07-29DynamicTablesPkg: Move Serial Port Info Objects to Arch CommonSami Mujawar1-8/+8
Move Serial port info objects like the generic serial port info, Serial console port info and Serial debug port info from Arm Namespace to the Arch Common namespace. i.e. EArmObjSerialPortInfo -> EArchCommonObjSerialPortInfo EArmObjConsolePortInfo -> EArchCommonObjConsolePortInfo EArmObjSerialDebugPortInfo -> EArchCommonObjSerialDebugPortInfo CM_ARM_SERIAL_PORT_INFO -> CM_ARCH_COMMON_SERIAL_PORT_INFO Correspondingly also update the following modules to reflect the changes introduced by the move: - DBG2 Generator - SPCR Generator - SSDT Serial Port Fixup Lib - SSDT Serial Port Generator - FdtHwInfoParserLib/ArmSerialPortParser - ConfigurationManagerObjectParser - Dynamic Plat Repo TokenFixer map. Cc: Pierre Gondois <Pierre.Gondois@arm.com> Cc: Yeo Reum Yun <YeoReum.Yun@arm.com> Cc: AbdulLateef Attar <AbdulLateef.Attar@amd.com> Cc: Jeshua Smith <jeshuas@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2024-07-01DynamicTablesPkg: AmlLib CONST cleanupJeshua Smith1-6/+6
Several input strings to AmlLib APIs are treated as CONST but were missing the CONST keyword, requiring their callers to create unnecessary r/w copies of r/o input strings. This change properly marks these input strings as CONST. Signed-off-by: Jeshua Smith <jeshuas@nvidia.com> Reviewed-by: Jeff Brasen <jbrasen@nvidia.com>
2024-05-10DynamicTablesPkg: Adds integer to the AML package nodeAbdul Lateef Attar1-1/+40
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> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2024-01-29DynamicTablesPkg: Add DynamicTablesScmiInfoLibPierre Gondois1-0/+33
The SCP holds some power information that could be advertised through the _CPC object. The communication with the SCP is done through SCMI protocols (c.f. ArmScmiDxe). Use the SCMI protocols to query information and feed it to the DynamicTablesPkg. Acked-by: Leif Lindholm <quic_llindhol@quicinc.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2024-01-29DynamicTablesPkg: Add AmlCreatePsdNode() to generate _PSDPierre Gondois1-1/+34
Add AmlCreatePsdNode() to the AmlLib to generate _PSD objects. _PSD objects allow to describe 'performance control, P-state or CPPC, logical processor dependency', Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency). Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2024-01-29DynamicTablesPkg: Rename AmlCpcInfo.h to AcpiObjects.hPierre Gondois1-1/+1
The DynamicTables framework uses the AmlLib to generate some Aml objects. It is done by using structured known by both frameworks, e.g. the AML_CPC_INFO/CM_ARM_CPC_INFO structures. To prepare adding similar structures (e.g. representing _PSD information), rename AmlCpcInfo.h to AcpiObjects.h. This new file will contain all the structures used by the AmlLib and the DynamicTables framework. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2023-12-22DynamicTablesPkg: AML Code generation to invoke a methodAbdul Lateef Attar1-0/+112
Adds API to generate AML code to invoke/call another method. Also provides ability to pass arguments of type integer, string, ArgObj or LocalObj. 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> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-12-22DynamicTablesPkg: Corrects AmlCodeGenRdWordBusNumber parametersAbdul Lateef Attar1-5/+5
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> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-12-22DynamicTablesPkg: AML Code generation for word I/O rangesAbdul Lateef Attar1-0/+65
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> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-10-23DynamicTablesPkg/AmlLib: Enumerate memory attributesJeshua Smith1-4/+45
AmlCodeGenRdQWordMemory's and AmlCodeGenRdDWordMemory's Cacheable and MemoryRangeType parameters treat specific values as having specific meanings as defined by the spec. This change adds enums to map those meanings to their corresponding values. Signed-off-by: Jeshua Smith <jeshuas@nvidia.com> Acked-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-09-22DynamicTablesPkg: AML Code generation for I/O rangesVidya Sagar1-0/+67
Add helper functions to generate AML Resource Data describing I/O ranges of four words long. API AmlCodeGenRdQWordIo () is exposed. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-09-22DynamicTablesPkg: Add Aml NameUnicodeString APIJeff Brasen1-0/+31
Add API to generate a Name that contains a Unicode string buffer. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-09-22DynamicTablesPkg: Add support to add Strings to packageJeff Brasen1-0/+17
Add API to add a String to a package created with NamedPackage API. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-09-22DynamicTablesPkg: Add support for simple method invocation.Jeff Brasen1-0/+54
Add support to add Return objects via AML that pass a single integer argument to the named method. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-09-22DynamicTablesPkg: Add ThermalZone CodeGen functionJeff Brasen1-0/+28
Add API to generate a ThermalZone object to AmlLib. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2023-03-10DynamicTablesPkg: Add SMBIOS String table helper librarySami Mujawar1-0/+119
The Section 6.1.3, SMBIOS specification version 3.6.0 describes the handling of test strings in SMBIOS tables. Text strings are added at the end of the formatted portion of the SMBIOS structure and are referenced by index in the SMBIOS structure. Therefore, introduce a SmbiosStringTableLib to simplify the publishing of the string set. SmbiosStringTableLib introduces a concept of string table which records the references to the SMBIOS strings as they are added and returns an string reference which is then assigned to the string field in the formatted portion of the SMBIOS structure. Once all strings are added, the library provides an interface to get the required size for the string set. This allows sufficient memory to be allocated for the SMBIOS table. The library also provides an interface to publish the string set in accordance with the SMBIOS specification. Example: EFI_STATUS BuildSmbiosType17Table () { STRING_TABLE StrTable; UINT8 DevLocatorRef; UINT8 BankLocatorRef; SMBIOS_TABLE_TYPE17 *SmbiosRecord; CHAR8 *StringSet; ... // Initialize string table for 7 strings StringTableInitialize (&StrTable, 7); StringTableAddString (&StrTable, "SIMM 3", &DevLocatorRef); StringTableAddString (&StrTable, "Bank 0", &BankLocatorRef); ... SmbiosRecord = AllocateZeroPool ( sizeof (SMBIOS_TABLE_TYPE17) + StringTableGetStringSetSize (&StrTable) ); ... SmbiosRecord->DeviceLocator = DevLocatorRef; SmbiosRecord->BankLocator = BankLocatorRef; ... // get the string set area StringSet = (CHAR8*)(SmbiosRecord + 1); // publish the string set StringTablePublishStringSet ( &StrTable, StringSet, StringTableGetStringSetSize (&StrTable) ); // free string table StringTableFree (&StrTable); return EFI_SUCCESS; } Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Cc: Alexei Fedorov <Alexei.Fedorov@arm.com> Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Girish Mahadevan <gmahadevan@nvidia.com> Cc: Jeff Brasen <jbrasen@nvidia.com> Cc: Ashish Singhal <ashishsingha@nvidia.com> Cc: Nick Ramirez <nramirez@nvidia.com> Cc: William Watson <wwatson@nvidia.com> Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
2022-12-13DynamicTablesPkg: Remove duplicated wordsPierre Gondois1-1/+1
In an effort to clean the documentation of the above package, remove duplicated words. Cc: Sami Mujawar <Sami.Mujawar@arm.com> Cc: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>