125 ASSERT (This !=
NULL);
126 ASSERT (AcpiTableInfo !=
NULL);
127 ASSERT (CfgMgrProtocol !=
NULL);
128 ASSERT (Table !=
NULL);
129 ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
130 ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
132 if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
133 (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
137 "ERROR: SPMI: Requested table revision = %d, is not supported."
138 "Supported table revision: Minimum = %d, Maximum = %d\n",
139 AcpiTableInfo->AcpiTableRevision,
140 This->MinAcpiTableRevision,
141 This->AcpiTableRevision
143 return EFI_INVALID_PARAMETER;
148 Status = GetEArchCommonObjSpmiInterfaceInfo (
154 if (EFI_ERROR (Status)) {
157 "ERROR: SPMI: Failed to retrieve interface type and base address.\n"
164 (SpmiInfo->
InterfaceType > EFI_ACPI_SPMI_INTERFACE_TYPE_SSIF))
168 "ERROR: SPMI: The Interface Type is invalid. Type = %d\n",
171 return EFI_INVALID_PARAMETER;
175 if ((SpmiInfo->
InterfaceType == EFI_ACPI_SPMI_INTERFACE_TYPE_SSIF) &&
176 (SpmiInfo->
BaseAddress.AddressSpaceId != EFI_ACPI_6_5_SMBUS))
180 "ERROR: SPMI: Invalid Address Space ID for SSIF. ID = %d\n",
183 return EFI_INVALID_PARAMETER;
187 if ((SpmiInfo->
InterfaceType != EFI_ACPI_SPMI_INTERFACE_TYPE_SSIF) &&
188 ((SpmiInfo->
BaseAddress.AddressSpaceId != EFI_ACPI_6_5_SYSTEM_MEMORY) &&
189 (SpmiInfo->
BaseAddress.AddressSpaceId != EFI_ACPI_6_5_SYSTEM_IO)))
193 "ERROR: SPMI: Invalid Address Space ID. ID = %d\n",
196 return EFI_INVALID_PARAMETER;
199 Status = GetEArchCommonObjSpmiInterruptDeviceInfo (
205 if (!EFI_ERROR (Status)) {
210 "ERROR: SPMI: The Interrupt Type has non-zero reserved bits. InterruptType = 0x%x\n",
213 return EFI_INVALID_PARAMETER;
216 if (SpmiInfo->
InterfaceType == EFI_ACPI_SPMI_INTERFACE_TYPE_SSIF) {
221 "ERROR: SPMI: The Interrupt Type bit0 should be zero for SSIF interface type.\n"
223 return EFI_INVALID_PARAMETER;
230 "ERROR: SPMI: PCI Device Flag is invalid for SSIF interface type.\n"
232 return EFI_INVALID_PARAMETER;
237 if ((SpmiIntrDeviceInfo->
Gpe != 0) &&
242 "ERROR: SPMI: The Interrupt Type bit0 should be set if a GPE number is provided.\n"
244 return EFI_INVALID_PARAMETER;
253 "ERROR: SPMI: Invalid interrupt type = 0x%x for GSI 0x%x\n",
257 return EFI_INVALID_PARAMETER;
261 AcpiSpmi.
Gpe = SpmiIntrDeviceInfo->
Gpe;
268 "INFO: SPMI: The platform does not provide interrupt and PCI device information.\n"
272 "Using default values (0) for the interrupt and PCI device information.\n"
278 if (!EFI_ERROR (Status) && (DeviceId.CompletionCode == IPMI_COMP_CODE_NORMAL)) {
297 if (EFI_ERROR (Status)) {
300 "ERROR: SPMI: Failed to add ACPI header. Status = %r\n",
311#define SPMI_GENERATOR_REVISION CREATE_REVISION (1, 0)
321 L
"ACPI.STD.SPMI.GENERATOR",
363 DEBUG ((DEBUG_INFO,
"SPMI: Register Generator. Status = %r\n", Status));
387 DEBUG ((DEBUG_INFO,
"SPMI: Deregister Generator. Status = %r\n", Status));
#define EFI_ACPI_6_5_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE_SIGNATURE
EFI_STATUS EFIAPI RegisterAcpiTableGenerator(IN CONST ACPI_TABLE_GENERATOR *CONST Generator)
EFI_STATUS EFIAPI DeregisterAcpiTableGenerator(IN CONST ACPI_TABLE_GENERATOR *CONST Generator)
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdSpmi
SPMI Generator.
#define ACPI_HEADER(Signature, Type, Revision)
@ EArchCommonObjSpmiInterfaceInfo
27 - SPMI Interface Info
@ EArchCommonObjSpmiInterruptDeviceInfo
28 - SPMI Interrupt and Device Info
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
#define GET_OBJECT_LIST(CmObjectNameSpace, CmObjectId, Type)
@ EObjNameSpaceArchCommon
Arch Common Objects Namespace.
EFI_STATUS EFIAPI IpmiGetDeviceId(OUT IPMI_GET_DEVICE_ID_RESPONSE *DeviceId)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define EFI_ACPI_SPMI_INTERFACE_TYPE_KCS
#define EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_5_TABLE_REVISION
EFI_STATUS EFIAPI AcpiSpmiLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
STATIC CONST ACPI_TABLE_GENERATOR SpmiGenerator
#define SPMI_GENERATOR_REVISION
EFI_STATUS EFIAPI AcpiSpmiLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
STATIC EFI_STATUS EFIAPI BuildSpmiTable(IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
EFI_STATUS EFIAPI AddAcpiHeader(IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CONST ACPI_TABLE_GENERATOR *CONST Generator, IN OUT EFI_ACPI_DESCRIPTION_HEADER *CONST AcpiHeader, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST UINT32 Length)
EFI_ACPI_6_5_GENERIC_ADDRESS_STRUCTURE BaseAddress
UINT32 GlobalSystemInterrupt
EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE BaseAddress
UINT16 SpecificationRevision
UINT32 GlobalSystemInterrupt
EFI_ACPI_SERVICE_PROCESSOR_MANAGEMENT_INTERFACE_TABLE_DEVICE_ID DeviceId