Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform/NXP: Pursue recent DynamicTablesPkg reorg #239

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Copyright 2020 NXP
Copyright 2020 Puresoftware Ltd
Copyright (c) 2024, Arm Limited. All rights reserved.<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent

Expand Down Expand Up @@ -472,7 +473,7 @@ GetStandardNameSpaceObject (
return Status;
}

/** Return an ARM namespace object.
/** Return an Arch Common namespace object.

@param [in] This Pointer to the Configuration Manager Protocol.
@param [in] CmObjectId The Configuration Manager Object ID.
Expand All @@ -487,40 +488,113 @@ GetStandardNameSpaceObject (
**/
EFI_STATUS
EFIAPI
GetArmNameSpaceObject (
GetArchCommonNameSpaceObject (
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This,
IN CONST CM_OBJECT_ID CmObjectId,
IN CONST CM_OBJECT_TOKEN Token OPTIONAL,
IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject
)
{
EFI_STATUS Status;
FSL_PLATFORM_REPOSITORY_INFO * PlatformRepo;
EDKII_PLATFORM_REPOSITORY_INFO * PlatformRepo;

Status = EFI_SUCCESS;
if ((This == NULL) || (CmObject == NULL)) {
ASSERT (This != NULL);
ASSERT (CmObject != NULL);
return EFI_INVALID_PARAMETER;
}

Status = EFI_NOT_FOUND;
PlatformRepo = This->PlatRepoInfo;

switch (GET_CM_OBJECT_ID (CmObjectId)) {
case EArmObjBootArchInfo:
case EArchCommonObjPowerManagementProfileInfo:
Status = HandleCmObject (
CmObjectId,
&PlatformRepo->BootArchInfo,
sizeof (PlatformRepo->BootArchInfo),
&PlatformRepo->PmProfileInfo,
sizeof (PlatformRepo->PmProfileInfo),
1,
CmObject
);
break;

case EArmObjPowerManagementProfileInfo:
case EArchCommonObjConsolePortInfo:
Status = HandleCmObject (
CmObjectId,
&PlatformRepo->PmProfileInfo,
sizeof (PlatformRepo->PmProfileInfo),
&PlatformRepo->SpcrSerialPort,
sizeof (PlatformRepo->SpcrSerialPort),
1,
CmObject
);
break;

case EArchCommonObjPciConfigSpaceInfo:
Status = HandleCmObjectRefByToken (
This,
CmObjectId,
PlatformRepo->PciConfigInfo,
sizeof (PlatformRepo->PciConfigInfo),
ARRAY_SIZE (PlatformRepo->PciConfigInfo),
Token,
GetPciConfigInfo,
CmObject
);
break;

default: {
Status = EFI_NOT_FOUND;
DEBUG ((
DEBUG_INFO,
"INFO: Object 0x%x. Status = %r\n",
CmObjectId,
Status
));
break;
}
} //switch

return Status;
}

/** Return an ARM namespace object.

@param [in] This Pointer to the Configuration Manager Protocol.
@param [in] CmObjectId The Configuration Manager Object ID.
@param [in] Token An optional token identifying the object. If
unused this must be CM_NULL_TOKEN.
@param [in, out] CmObject Pointer to the Configuration Manager Object
descriptor describing the requested Object.

@retval EFI_SUCCESS Success.
@retval EFI_INVALID_PARAMETER A parameter is invalid.
@retval EFI_NOT_FOUND The required object information is not found.
**/
EFI_STATUS
EFIAPI
GetArmNameSpaceObject (
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST This,
IN CONST CM_OBJECT_ID CmObjectId,
IN CONST CM_OBJECT_TOKEN Token OPTIONAL,
IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject
)
{
EFI_STATUS Status;
FSL_PLATFORM_REPOSITORY_INFO * PlatformRepo;

Status = EFI_SUCCESS;
if ((This == NULL) || (CmObject == NULL)) {
ASSERT (This != NULL);
ASSERT (CmObject != NULL);
return EFI_INVALID_PARAMETER;
}
PlatformRepo = This->PlatRepoInfo;

switch (GET_CM_OBJECT_ID (CmObjectId)) {
case EArmObjBootArchInfo:
Status = HandleCmObject (
CmObjectId,
&PlatformRepo->BootArchInfo,
sizeof (PlatformRepo->BootArchInfo),
1,
CmObject
);
Expand Down Expand Up @@ -612,29 +686,6 @@ GetArmNameSpaceObject (
);
break;

case EArmObjSerialConsolePortInfo:
Status = HandleCmObject (
CmObjectId,
&PlatformRepo->SpcrSerialPort,
sizeof (PlatformRepo->SpcrSerialPort),
1,
CmObject
);
break;

case EArmObjPciConfigSpaceInfo:
Status = HandleCmObjectRefByToken (
This,
CmObjectId,
PlatformRepo->PciConfigInfo,
sizeof (PlatformRepo->PciConfigInfo),
ARRAY_SIZE (PlatformRepo->PciConfigInfo),
Token,
GetPciConfigInfo,
CmObject
);
break;

default: {
Status = EFI_NOT_FOUND;
DEBUG ((
Expand Down Expand Up @@ -733,6 +784,9 @@ FslPlatformGetObject (
case EObjNameSpaceStandard:
Status = GetStandardNameSpaceObject (This, CmObjectId, Token, CmObject);
break;
case EObjNameSpaceArchCommon:
Status = GetArchCommonNameSpaceObject (This, CmObjectId, Token, CmObject);
break;
case EObjNameSpaceArm:
Status = GetArmNameSpaceObject (This, CmObjectId, Token, CmObject);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Copyright 2020 NXP
Copyright 2020 Puresoftware Ltd
Copyright (c) 2024, Arm Limited. All rights reserved.<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent

Expand Down Expand Up @@ -80,7 +81,7 @@ typedef struct PlatformRepositoryInfo {
CM_ARM_BOOT_ARCH_INFO BootArchInfo;

/// Power management profile information
CM_ARM_POWER_MANAGEMENT_PROFILE_INFO PmProfileInfo;
CM_ARCH_COMMON_POWER_MANAGEMENT_PROFILE_INFO PmProfileInfo;

/// Generic timer information
CM_ARM_GENERIC_TIMER_INFO GenericTimerInfo;
Expand All @@ -107,10 +108,10 @@ typedef struct PlatformRepositoryInfo {
CM_ARM_GIC_ITS_INFO GicItsInfo;

/// PCI configuration space information
CM_ARM_PCI_CONFIG_SPACE_INFO PciConfigInfo[PLAT_PCI_CONFG_COUNT];
CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO PciConfigInfo[PLAT_PCI_CONFG_COUNT];

/// Serial port information for serial port console redirection port
CM_ARM_SERIAL_PORT_INFO SpcrSerialPort;
CM_ARCH_COMMON_SERIAL_PORT_INFO SpcrSerialPort;

/// Fsl Board Revision
UINT32 FslBoardRevision;
Expand Down
6 changes: 3 additions & 3 deletions Platform/NXP/LX2160aRdbPkg/LX2160aRdbPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
!if $(DYNAMIC_ACPI_ENABLE) == TRUE
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
<LibraryClasses>
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiFadtLib/AcpiFadtLib.inf
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiMcfgLib/AcpiMcfgLib.inf
NULL|DynamicTablesPkg/Library/Acpi/Common/AcpiSpcrLib/AcpiSpcrLib.inf
NULL|Platform/NXP/LX2160aRdbPkg/AcpiTablesInclude/PlatformAcpiDsdtLib.inf
}
!endif
Expand Down
Loading