This patch replaces the logic in ConfigurationManager to print platform name based on platform ID with a simple #define PLAT_SOC_NAME defined in platform headers. This also removes duplication of the SVR_LX2160A, SVR_SOC_VER, SVR_MAJOR and SVR_MINOR macro definitions between SoC headers and platform headers.
Signed-off-by: Vikas Singh <vikas.si...@puresoftware.com> --- Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c | 11 ++++------- Platform/NXP/LX2160aRdbPkg/Include/Platform.h | 8 ++------ Silicon/NXP/LX2160A/LX2160A.dsc.inc | 3 ++- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c index 80ce8412c4..39376d900b 100644 --- a/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c +++ b/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManager.c @@ -2,7 +2,7 @@ Configuration Manager Dxe Copyright 2020 NXP - Copyright 2020 Puresoftware Ltd + Copyright 2020-2021 Puresoftware Ltd SPDX-License-Identifier: BSD-2-Clause-Patent @@ -25,6 +25,7 @@ */ #include "ConfigurationManager.h" #include <Library/SocLib.h> +#include <Chassis.h> /** The platform configuration repository information. */ @@ -170,12 +171,8 @@ InitializePlatformRepository ( PlatformRepo = This->PlatRepoInfo; Svr = SocGetSvr (); - if (SVR_SOC_VER(Svr) == SVR_LX2160A) { - PlatformRepo->FslBoardRevision = SVR_MAJOR(Svr); - DEBUG ((DEBUG_INFO, "Fsl : SoC LX2160A Rev = 0x%x\n", PlatformRepo->FslBoardRevision)); - } else { - DEBUG ((DEBUG_INFO, "Fsl : SoC Unknown Rev = 0x%x\n", PlatformRepo->FslBoardRevision)); - } + PlatformRepo->FslBoardRevision = SVR_MAJOR(Svr); + DEBUG ((DEBUG_INFO, "Fsl : SoC = %s Rev = 0x%x\n", PLAT_SOC_NAME, PlatformRepo->FslBoardRevision)); return EFI_SUCCESS; } diff --git a/Platform/NXP/LX2160aRdbPkg/Include/Platform.h b/Platform/NXP/LX2160aRdbPkg/Include/Platform.h index 76a41d4369..f2e831f033 100644 --- a/Platform/NXP/LX2160aRdbPkg/Include/Platform.h +++ b/Platform/NXP/LX2160aRdbPkg/Include/Platform.h @@ -2,7 +2,7 @@ * Platform headers * * Copyright 2020 NXP - * Copyright 2020 Puresoftware Ltd + * Copyright 2020-2021 Puresoftware Ltd * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -15,11 +15,7 @@ #define EFI_ACPI_ARM_OEM_REVISION 0x00000000 // Soc defines -#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFFFFE) -#define SVR_MAJOR(svr) (((svr) >> 4) & 0xf) -#define SVR_MINOR(svr) (((svr) >> 0) & 0xf) - -#define SVR_LX2160A 0x873600 +#define PLAT_SOC_NAME "LX2160ARDB" // PCLK #define DCFG_BASE 0x1E00000 diff --git a/Silicon/NXP/LX2160A/LX2160A.dsc.inc b/Silicon/NXP/LX2160A/LX2160A.dsc.inc index ea7e54fa89..15a06bea1f 100644 --- a/Silicon/NXP/LX2160A/LX2160A.dsc.inc +++ b/Silicon/NXP/LX2160A/LX2160A.dsc.inc @@ -2,7 +2,7 @@ # LX2160A Soc package. # # Copyright 2018-2020 NXP -# Copyright 2020 Puresoftware Ltd +# Copyright 2020-2021 Puresoftware Ltd # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -70,6 +70,7 @@ Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/ConfigurationManagerDxe.inf { <BuildOptions> *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Platform/NXP/LX2160aRdbPkg/Include + *_*_*_PLATFORM_FLAGS = -I$(WORKSPACE)/Silicon/NXP/Chassis3V2/Include } !endif -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#76763): https://edk2.groups.io/g/devel/message/76763 Mute This Topic: https://groups.io/mt/83630881/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-