Add a new StaToken field to CM_ARCH_COMMON_PROC_HIERARCHY_INFO
CmObj, allowing to describe the ASL "_STA" value the processor
or processor container should return.
CM_X64_LOCAL_APIC_X2APIC_INFO.StaToken already allows to reference
a StaToken from a X2APIC CmObj. If ProcHierarchy objects are used,
the SSDT CPU topology table will be generated using the X2APIC
objects, so the new field should not collide with the new one.
Add a note to CM_X64_LOCAL_APIC_X2APIC_INFO.StaToken
to handle this case.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
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>
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>
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>
Add the Configuration Manager objects required to describe SMBIOS
Additional Information (Type 40) structures.
The top-level object references a list of Additional Information entries.
Each entry identifies a field in an existing SMBIOS structure and
references a typed value object containing the additional data.
Define the maximum value buffer size from the SMBIOS Type 40 formatted
length limit and add parsers for the new CM objects.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Move SMBIOS_MAX_STRING_SIZE and CFMWS_MAX_INTERLEAVE_WAYS to the
common definitions near the top of ArchCommonNameSpaceObjects.h.
Document that SMBIOS_MAX_STRING_SIZE is an implementation-defined
Configuration Manager storage limit, including the terminating NULL,
rather than an SMBIOS specification limit. Also distinguish it from
the legacy SMBIOS_STRING_MAX_LENGTH definition used for SMBIOS 2.6
MIF compatibility.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add EArchCommonObjSystemInfo to ArchCommonNameSpaceObjects.h and a
corresponding parser entry in ConfigurationManagerObjectParser.c.
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
The SMBIOS_TABLE_GENERATOR_BUILD_TABLEEX and
SMBIOS_TABLE_GENERATOR_FREE_TABLEEX callback types do not specify EFIAPI.
The Type 37 implementations specify it, while the other extended callback
implementations follow the omission in the shared types.
For X64 GCC builds, BaseTools/Conf/tools_def.template adds
-DEFIAPI=__attribute__((ms_abi)). Therefore, callbacks marked with EFIAPI
use the Microsoft x64 ABI, while unannotated callback types use the
compiler default ABI. If the two sides differ, the caller and callee use
different argument registers, and GCC rejects the function pointer
assignment.
This mismatch remained hidden while the standalone Type 37 generator was
built only for AARCH64. Moving the SMBIOS generators to the common
component section adds X64 build coverage and exposes it.
Add EFIAPI to the extended callback types and all matching implementations.
This follows the ACPI generator callback convention and provides the ABI
prerequisite for expanding the SMBIOS standalone build coverage.
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
Add support for generating SMBIOS Type 37 Memory Channel structures from
Configuration Manager data.
Introduce the Memory Channel CM object and the associated Memory Channel
Device CM object. The channel object describes the Type 37 fixed fields,
including channel type, maximum channel load, memory device count, and the
token for the device-list object. The device-list object describes each
memory device attached to the channel using a device load and a Type 17
Memory Device CM token.
Add parser entries for both CM objects and register the Type 37 generator in
the DynamicTablesPkg DSC so it is available through the SMBIOS table factory.
The Type 37 generator builds one SMBIOS record per Memory Channel CM object.
For each channel, it retrieves the referenced Memory Channel Device list,
validates the channel type, maximum channel load, device count, device load,
and device tokens, resolves each referenced Type 17 CM token to an SMBIOS
handle, and emits the variable-length MemoryDevice array in the Type 37
record.
This allows platforms to describe memory channels and link them to generated
Type 17 Memory Device records through CM tokens instead of hard-coded SMBIOS
handles.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add an SMBIOS Type 20 generator for Memory Device Mapped Address
structures.
The generator builds one Type 20 table per Memory Device Mapped Address
CM object, validates the address range, encodes extended addresses when
the 32-bit address fields cannot represent the range, and maps optional
Type 17 and Type 19 CM object references to SMBIOS handles. If either
reference token is CM_NULL_TOKEN, the corresponding SMBIOS handle is set
to SMBIOS_HANDLE_INVALID.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add a Configuration Manager object and parser for SMBIOS Type 23
System Reset information.
Add a Type 23 SMBIOS generator that creates the System Reset structure
from the System Reset CM object. The generator expects a single CM
object, fills the system reset capabilities and watchdog reset fields,
and registers the generated table with the SMBIOS table factory.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add a Configuration Manager object and parser for SMBIOS Type 29
Electrical Current Probe information.
Add a Type 29 SMBIOS generator that creates one Electrical Current Probe
structure for each Electrical Current Probe CM object. The generator
validates the probe location and status fields, publishes the optional
description string, and registers the generated table with the SMBIOS
table factory.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add a Configuration Manager object and parser for SMBIOS Type 26
Voltage Probe information.
Add a Type 26 SMBIOS generator that creates one Voltage Probe
structure for each Voltage Probe CM object. The generator validates
the probe location and status fields, publishes the optional
description string, and registers the generated table with the
SMBIOS table factory.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Introduce a CM_ARCH_COMMON_TEMPERATURE_PROBE_INFO object to describe
temperature probes provided by the platform. The generator creates one
SMBIOS Type 28 record for each temperature probe object and populates
the description, location/status, probe limits, resolution, tolerance,
accuracy, OEM-defined data, and nominal value.
Add the CM object parser entry and wire the generator into the
DynamicTablesPkg build.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Introduce a CM_ARCH_COMMON_COOLING_DEVICE_INFO object to describe
cooling devices provided by the platform. The generator creates one
SMBIOS Type 27 record for each cooling device object and populates the
device type/status, cooling unit group, OEM-defined data, nominal speed,
and optional description string.
The temperature probe handle is set to 0xFFFF for now because SMBIOS
Type 28 Temperature Probe generation is not currently available. Reject
non-null temperature probe tokens until Type 28 handle resolution can be
added.
Add the CM object parser entry and wire the generator into the
DynamicTablesPkg build.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add EArchCommonObjMemoryArrayMappedAddress to ArchCommonNameSpaceObjects.h
and a corresponding parser entry in ConfigurationManagerObjectParser.c.
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add EArchCommonObjMemoryDeviceInfo to ArchCommonNameSpaceObjects.h
and a corresponding parser entry in ConfigurationManagerObjectParser.c.
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add EArchCommonObjPhysicalMemoryArray to ArchCommonNameSpaceObjects.h
and a corresponding parser entry in ConfigurationManagerObjectParser.c.
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
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>
Add EArchCommonObjPlatformFwInfo to ArchCommonNameSpaceObjects.h and a
corresponding parser entry in ConfigurationManagerObjectParser.c.
Signed-off-by: Girish Mahadevan <gmahadevan@nvidia.com>
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Update the Standard ACPI Table IDs listed in TableGenerator.h to match
the ESTD_ACPI_TABLE_ID enum in AcpiTableGenerator.h.
This fixes the RAW/DSDT/SSDT aliasing at ID 1, corrects the numbering of
the remaining standard ACPI table generators, and adds the IDs that were
missing from the documentation comment.
Keeping this mapping accurate makes TableGeneratorId values easier to
decode during debug when inspecting logs, dumps, or generated table
registration paths.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
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>
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>
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>
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>
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>
The Generic ACPI for Arm Components 1.2 Platform Design Document [1],
section 2.6.1.2 "ASL reference code for the DMC620 PMU" provides
information to describe the Arm Corelink DMC620 Dynamic Memory
Controller's Performance Monitoring Unit (PMU) block using an ASL
definition block table.
Add support for a table generator for the DMC620 PMU block. The table
generator uses the Configuration Manager protocol to obtain the
following information.
- Number of sockets on the platform
- DMC620 devices per socket
After obtaining the socket based topology, information is obtained on
individual DMC620 devices. This includes
- PMU register base address and length
- Information on the associated PMU interrupt
The table generator uses the Dynamic AML CodeGen API's for generating
the table from the information obtained through the Configuration
Manager protocol.
[1] - https://developer.arm.com/documentation/den0093/1-2eac1/
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
Add AcpiSsdtPlicAplicLib to create PLIC and APLIC device entries in the
RISC-V namespace. These interrupt controller devices are essential for
accurate ACPI namespace representation on RISC-V platforms.
This library facilitates SSDT generation for PLIC and APLIC, enabling
proper OS discovery and configuration.
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Add a generator for the RISC-V Hart Capabilities Table (RHCT), a new
ACPI table used to convey CPU feature information to the operating
system.
This generator enables firmware to describe RISC-V hart capabilities
in a standardized way as part of the ACPI table set.
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Add a new header file to define RISC-V Namespace objects used by the
Configuration Manager.
Include the new header in the main Configuration Manager Object header
to ensure the definitions are available where needed.
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Adds RootPortInfoToken to PCIe config space object to
support addition of root port devices in PCIE SSDT.
Updates the ConfigurationManagerObjectParser to include the new token.
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Introduce new architecture common namespace object
for PCIe root ports in the DynamicTables package.
This object holds information:
- PCIe root port address in device and function format
- Reference token information to the PCIe routing table object
- Slot number information for the root port
Also updates ConfigurationManagerObjectParser to parse
the new object and populate the relevant fields.
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
X64 platforms supports WordIo and uncached PCIe resources.
Hence, include WordIo and uncached PCIe resources in _CRS.
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
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>