133 return EFI_INVALID_PARAMETER;
139 return EFI_OUT_OF_RESOURCES;
184 IN VOID *PccSubspace,
190 (PccSubspace ==
NULL))
193 return EFI_INVALID_PARAMETER;
200 return EFI_BUFFER_TOO_SMALL;
234 if (CmPccCount == 0) {
240 return EFI_INVALID_PARAMETER;
245 switch (GenericPcc->
Type) {
246 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC:
250 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
254 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
258 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
262 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC:
266 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
272 return EFI_INVALID_PARAMETER;
275 PccBuffer = (UINT8 *)CmPccArray;
278 for (Index = 0; Index < CmPccCount; Index++) {
286 if (EFI_ERROR (Status)) {
291 PccBuffer += CmObjSize;
316 if ((PccCmObj ==
NULL) ||
317 (PccCmObj->Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC) ||
321 return EFI_INVALID_PARAMETER;
324 Doorbell = &PccCmObj->DoorbellReg;
325 ChannelTiming = &PccCmObj->ChannelTiming;
327 PccAcpi->Type = PccCmObj->Type;
329 *(UINT32 *)&PccAcpi->Reserved[0] = EFI_ACPI_RESERVED_DWORD;
330 *(UINT16 *)&PccAcpi->Reserved[4] = EFI_ACPI_RESERVED_WORD;
331 PccAcpi->BaseAddress = PccCmObj->BaseAddress;
332 PccAcpi->AddressLength = PccCmObj->AddressLength;
335 &PccAcpi->DoorbellRegister,
340 PccAcpi->DoorbellWrite = Doorbell->
WriteMask;
371 if ((PccCmObj ==
NULL) ||
372 (GenericPccCmObj->
Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS) ||
376 return EFI_INVALID_PARAMETER;
382 ASSERT ((PccCmObj->PlatIrq.Flags & ~MAX_UINT8) == 0);
384 PccAcpi->Type = GenericPccCmObj->
Type;
386 PccAcpi->PlatformInterrupt = PccCmObj->PlatIrq.Interrupt;
387 PccAcpi->PlatformInterruptFlags = (UINT8)PccCmObj->PlatIrq.Flags;
388 PccAcpi->Reserved = EFI_ACPI_RESERVED_BYTE;
389 PccAcpi->BaseAddress = GenericPccCmObj->
BaseAddress;
393 &PccAcpi->DoorbellRegister,
398 PccAcpi->DoorbellWrite = Doorbell->
WriteMask;
404 if ((PccCmObj->PlatIrq.Interrupt != 0)) {
434 if ((PccCmObj ==
NULL) ||
435 (GenericPccCmObj->
Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS) ||
439 return EFI_INVALID_PARAMETER;
443 PlatIrqAck = &PccCmObj->PlatIrqAckReg;
446 ASSERT ((PccCmObj->PlatIrq.Flags & ~MAX_UINT8) == 0);
448 PccAcpi->Type = GenericPccCmObj->
Type;
450 PccAcpi->PlatformInterrupt = PccCmObj->PlatIrq.Interrupt;
451 PccAcpi->PlatformInterruptFlags = (UINT8)PccCmObj->PlatIrq.Flags;
452 PccAcpi->BaseAddress = GenericPccCmObj->
BaseAddress;
453 PccAcpi->Reserved = EFI_ACPI_RESERVED_BYTE;
454 PccAcpi->BaseAddress = GenericPccCmObj->
BaseAddress;
458 &PccAcpi->DoorbellRegister,
463 PccAcpi->DoorbellWrite = Doorbell->
WriteMask;
470 &PccAcpi->PlatformInterruptAckRegister,
474 PccAcpi->PlatformInterruptAckPreserve = PlatIrqAck->
PreserveMask;
475 PccAcpi->PlatformInterruptAckWrite = PlatIrqAck->
WriteMask;
477 if ((PccCmObj->PlatIrq.Interrupt != 0)) {
510 if ((PccCmObj ==
NULL) ||
511 ((GenericPccCmObj->
Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC) &&
512 (GenericPccCmObj->
Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC)) ||
516 return EFI_INVALID_PARAMETER;
520 PlatIrqAck = &PccCmObj->PlatIrqAckReg;
521 CmdCompleteCheck = &PccCmObj->CmdCompleteCheckReg;
522 CmdCompleteUpdate = &PccCmObj->CmdCompleteUpdateReg;
523 ErrorStatus = &PccCmObj->ErrorStatusReg;
526 ASSERT ((PccCmObj->PlatIrq.Flags & ~MAX_UINT8) == 0);
527 ASSERT ((GenericPccCmObj->
AddressLength & ~MAX_UINT32) == 0);
529 PccAcpi->Type = GenericPccCmObj->
Type;
531 PccAcpi->PlatformInterrupt = PccCmObj->PlatIrq.Interrupt;
532 PccAcpi->PlatformInterruptFlags = (UINT8)PccCmObj->PlatIrq.Flags;
533 PccAcpi->Reserved = EFI_ACPI_RESERVED_BYTE;
534 PccAcpi->BaseAddress = GenericPccCmObj->
BaseAddress;
535 PccAcpi->AddressLength = (UINT32)GenericPccCmObj->
AddressLength;
538 &PccAcpi->DoorbellRegister,
543 PccAcpi->DoorbellWrite = Doorbell->
WriteMask;
550 &PccAcpi->PlatformInterruptAckRegister,
554 PccAcpi->PlatformInterruptAckPreserve = PlatIrqAck->
PreserveMask;
555 PccAcpi->PlatformInterruptAckSet = PlatIrqAck->
WriteMask;
557 PccAcpi->Reserved1[0] = EFI_ACPI_RESERVED_BYTE;
558 PccAcpi->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
559 PccAcpi->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
560 PccAcpi->Reserved1[3] = EFI_ACPI_RESERVED_BYTE;
561 PccAcpi->Reserved1[4] = EFI_ACPI_RESERVED_BYTE;
562 PccAcpi->Reserved1[5] = EFI_ACPI_RESERVED_BYTE;
563 PccAcpi->Reserved1[6] = EFI_ACPI_RESERVED_BYTE;
564 PccAcpi->Reserved1[7] = EFI_ACPI_RESERVED_BYTE;
567 &PccAcpi->CommandCompleteCheckRegister,
571 PccAcpi->CommandCompleteCheckMask = CmdCompleteCheck->
PreserveMask;
575 &PccAcpi->CommandCompleteUpdateRegister,
579 PccAcpi->CommandCompleteUpdatePreserve = CmdCompleteUpdate->
PreserveMask;
580 PccAcpi->CommandCompleteUpdateSet = CmdCompleteUpdate->
WriteMask;
583 &PccAcpi->ErrorStatusRegister,
590 if (GenericPccCmObj->
Type == EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC) {
592 }
else if ((PccCmObj->PlatIrq.Interrupt != 0)) {
623 if ((PccCmObj ==
NULL) ||
624 (GenericPccCmObj->
Type != EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS) ||
628 return EFI_INVALID_PARAMETER;
632 CmdCompleteCheck = &PccCmObj->CmdCompleteCheckReg;
633 ErrorStatus = &PccCmObj->ErrorStatusReg;
636 PccAcpi->Type = GenericPccCmObj->
Type;
638 PccAcpi->Version = PccCmObj->Version;
639 PccAcpi->BaseAddress = GenericPccCmObj->
BaseAddress;
640 PccAcpi->SharedMemoryRangeLength = GenericPccCmObj->
AddressLength;
643 &PccAcpi->DoorbellRegister,
648 PccAcpi->DoorbellWrite = Doorbell->
WriteMask;
651 &PccAcpi->CommandCompleteCheckRegister,
655 PccAcpi->CommandCompleteCheckMask = CmdCompleteCheck->
PreserveMask;
659 &PccAcpi->ErrorStatusRegister,
698 VOID *CurrentPccSubspace;
707 for (Index = 0; Index < MaxIndex; Index++) {
708 CurrentPccSubspace = Table[Index];
709 if (CurrentPccSubspace ==
NULL) {
711 return EFI_INVALID_PARAMETER;
715 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_GENERIC:
724 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS:
733 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS:
742 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_3_EXTENDED_PCC:
751 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_4_EXTENDED_PCC:
760 case EFI_ACPI_6_4_PCCT_SUBSPACE_TYPE_5_HW_REGISTERS_COMMUNICATIONS:
771 return EFI_INVALID_PARAMETER;
774 if (EFI_ERROR (Status)) {
779 if (Size < CmObjSize) {
781 return EFI_BUFFER_TOO_SMALL;
784 PccBuffer += CmObjSize;
832 UINT32 MappingTableCount;
835 UINT32 PccType0Count;
837 UINT32 PccType1Count;
839 UINT32 PccType2Count;
841 UINT32 PccType3Count;
843 UINT32 PccType4Count;
845 UINT32 PccType5Count;
847 ASSERT (This !=
NULL);
848 ASSERT (AcpiTableInfo !=
NULL);
849 ASSERT (CfgMgrProtocol !=
NULL);
850 ASSERT (Table !=
NULL);
851 ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
852 ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
854 if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
855 (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
859 "ERROR: PCCT: Requested table revision = %d, is not supported."
860 "Supported table revision: Minimum = %d, Maximum = %d\n",
861 AcpiTableInfo->AcpiTableRevision,
862 This->MinAcpiTableRevision,
863 This->AcpiTableRevision
866 return EFI_INVALID_PARAMETER;
875 Status = GetEArchCommonObjPccSubspaceType0Info (
881 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
886 Status = GetEArchCommonObjPccSubspaceType1Info (
892 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
897 Status = GetEArchCommonObjPccSubspaceType2Info (
903 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
908 Status = GetEArchCommonObjPccSubspaceType3Info (
914 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
919 Status = GetEArchCommonObjPccSubspaceType4Info (
925 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
930 Status = GetEArchCommonObjPccSubspaceType5Info (
936 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
942 MappingTableCount = PccType0Count;
943 MappingTableCount += PccType1Count;
944 MappingTableCount += PccType2Count;
945 MappingTableCount += PccType3Count;
946 MappingTableCount += PccType4Count;
947 MappingTableCount += PccType5Count;
950 if (EFI_ERROR (Status)) {
958 if (EFI_ERROR (Status)) {
964 if (EFI_ERROR (Status)) {
970 if (EFI_ERROR (Status)) {
976 if (EFI_ERROR (Status)) {
982 if (EFI_ERROR (Status)) {
988 if (EFI_ERROR (Status)) {
1004 if (*Table ==
NULL) {
1005 Status = EFI_OUT_OF_RESOURCES;
1019 if (EFI_ERROR (Status)) {
1022 "ERROR: PCCT: Failed to add ACPI header. Status = %r\n",
1029 Buffer = (UINT8 *)Pcct;
1035 if (EFI_ERROR (Status)) {
1042 Pcct->Reserved = EFI_ACPI_RESERVED_QWORD;
1051 "ERROR: PCCT: Failed to install table. Status = %r\n",
1055 if (*Table !=
NULL) {
1086 ASSERT (This !=
NULL);
1087 ASSERT (AcpiTableInfo !=
NULL);
1088 ASSERT (CfgMgrProtocol !=
NULL);
1089 ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
1090 ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
1092 if ((Table ==
NULL) || (*Table ==
NULL)) {
1093 DEBUG ((DEBUG_ERROR,
"ERROR: PCCT: Invalid Table Pointer\n"));
1094 ASSERT ((Table !=
NULL) && (*Table !=
NULL));
1095 return EFI_INVALID_PARAMETER;
1105#define PCCT_GENERATOR_REVISION CREATE_REVISION (1, 0)
1116 L
"ACPI.STD.PCCT.GENERATOR",
1169 DEBUG ((DEBUG_INFO,
"PCCT: Register Generator. Status = %r\n", Status));
1193 DEBUG ((DEBUG_INFO,
"PCCT: Deregister Generator. Status = %r\n", Status));
#define EFI_ACPI_6_4_PLATFORM_COMMUNICATIONS_CHANNEL_TABLE_SIGNATURE
#define EFI_ACPI_6_4_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION
EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC EFI_ACPI_6_4_PCCT_SUBSPACE_4_EXTENDED_PCC
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
@ EStdAcpiTableIdPcct
PCCT Generator.
struct CmArchCommonPccSubspaceType2Info CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO
struct CmArchCommonPccSubspaceType5Info CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO
struct CmArchCommonPccSubspaceType3Info CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO
struct CmArchCommonPccSubspaceType1Info CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO
CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO CM_ARCH_COMMON_PCC_SUBSPACE_TYPE4_INFO
PCC_SUBSPACE_GENERIC_INFO CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO
@ EArchCommonObjPccSubspaceType4Info
23 - Pcc Subspace Type 4 Info
@ EArchCommonObjPccSubspaceType2Info
21 - Pcc Subspace Type 2 Info
@ EArchCommonObjPccSubspaceType5Info
24 - Pcc Subspace Type 5 Info
@ EArchCommonObjPccSubspaceType3Info
22 - Pcc Subspace Type 3 Info
@ EArchCommonObjPccSubspaceType1Info
20 - Pcc Subspace Type 1 Info
@ EArchCommonObjPccSubspaceType0Info
19 - Pcc Subspace Type 0 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.
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
STATIC EFI_STATUS EFIAPI FreePcctTableResources(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, IN OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
STATIC BOOLEAN mHasPlatformInterrupt
STATIC EFI_STATUS EFIAPI AddSubspaceStructType2(IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE2_INFO *PccCmObj, IN EFI_ACPI_6_4_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS *PccAcpi)
STATIC EFI_STATUS EFIAPI MappingTableAdd(IN MAPPING_TABLE *MappingTable, IN VOID *PccSubspace, IN UINT32 Index)
STATIC EFI_STATUS EFIAPI AddSubspaceStructType0(IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE0_INFO *PccCmObj, IN EFI_ACPI_6_4_PCCT_SUBSPACE_GENERIC *PccAcpi)
STATIC EFI_STATUS EFIAPI BuildPcctTable(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)
STATIC EFI_STATUS EFIAPI MapPccSubspaceId(IN MAPPING_TABLE *MappingTable, IN VOID *CmPccArray, IN UINT32 CmPccCount)
#define PCCT_GENERATOR_REVISION
STATIC EFI_STATUS EFIAPI AddSubspaceStructType5(IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE5_INFO *PccCmObj, IN EFI_ACPI_6_4_PCCT_SUBSPACE_5_HW_REGISTERS_COMMUNICATIONS *PccAcpi)
STATIC EFI_STATUS EFIAPI MappingTableInitialize(IN MAPPING_TABLE *MappingTable, IN UINT32 Count)
STATIC VOID EFIAPI MappingTableFree(IN OUT MAPPING_TABLE *MappingTable)
STATIC ACPI_PCCT_GENERATOR PcctGenerator
EFI_STATUS EFIAPI AcpiPcctLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI AcpiPcctLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
STATIC EFI_STATUS EFIAPI AddSubspaceStructType34(IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE3_INFO *PccCmObj, IN EFI_ACPI_6_4_PCCT_SUBSPACE_3_EXTENDED_PCC *PccAcpi)
STATIC EFI_STATUS EFIAPI AddSubspaceStructType1(IN CM_ARCH_COMMON_PCC_SUBSPACE_TYPE1_INFO *PccCmObj, IN EFI_ACPI_6_4_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS *PccAcpi)
STATIC EFI_STATUS EFIAPI PopulatePcctTable(IN MAPPING_TABLE *MappingTable, IN VOID *Pcc, IN UINT32 Size)
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)
ACPI_TABLE_GENERATOR Header
ACPI Table generator header.
UINT32 MaxIndex
Number of entries in the Table.
EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE Register
GAS describing the Register.
UINT64 WriteMask
Mask of bits to set when writing.
UINT32 NominalLatency
Expected latency to process a command, in microseconds.
UINT16 MinRequestTurnaroundTime
UINT32 MaxPeriodicAccessRate
PCC_SUBSPACE_CHANNEL_TIMING_INFO ChannelTiming
Mailbox Timings.
UINT8 Type
Table type (or subspace).
PCC_MAILBOX_REGISTER_INFO DoorbellReg
Doorbell Register.
UINT64 AddressLength
Address length.