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.singh@...>
---
Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Configuration=
Manager.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/C=
onfigurationManager.c b/Platform/NXP/ConfigurationManagerPkg/ConfigurationM=
anagerDxe/ConfigurationManager.c
index 80ce8412c4..39376d900b 100644
--- a/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Configur=
ationManager.c
+++ b/Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Configur=
ationManager.c
@@ -2,7 +2,7 @@
Configuration Manager Dxe=0D
=0D
Copyright 2020 NXP=0D
- Copyright 2020 Puresoftware Ltd=0D
+ Copyright 2020-2021 Puresoftware Ltd=0D
=0D
SPDX-License-Identifier: BSD-2-Clause-Patent=0D
=0D
@@ -25,6 +25,7 @@
*/=0D
#include "ConfigurationManager.h"=0D
#include <Library/SocLib.h>=0D
+#include <Chassis.h>=0D
=0D
/** The platform configuration repository information.=0D
*/=0D
@@ -170,12 +171,8 @@ InitializePlatformRepository (
PlatformRepo =3D This->PlatRepoInfo;=0D
=0D
Svr =3D SocGetSvr ();=0D
- if (SVR_SOC_VER(Svr) =3D=3D SVR_LX2160A) {=0D
- PlatformRepo->FslBoardRevision =3D SVR_MAJOR(Svr);=0D
- DEBUG ((DEBUG_INFO, "Fsl : SoC LX2160A Rev =3D 0x%x\n", PlatformRepo->=
FslBoardRevision));=0D
- } else {=0D
- DEBUG ((DEBUG_INFO, "Fsl : SoC Unknown Rev =3D 0x%x\n", PlatformRepo->=
FslBoardRevision));=0D
- }=0D
+ PlatformRepo->FslBoardRevision =3D SVR_MAJOR(Svr);=0D
+ DEBUG ((DEBUG_INFO, "Fsl : SoC =3D %s Rev =3D 0x%x\n", PLAT_SOC_NAME, Pl=
atformRepo->FslBoardRevision));=0D
=0D
return EFI_SUCCESS;=0D
}=0D
diff --git a/Platform/NXP/LX2160aRdbPkg/Include/Platform.h b/Platform/NXP/L=
X2160aRdbPkg/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=0D
*=0D
* Copyright 2020 NXP=0D
- * Copyright 2020 Puresoftware Ltd=0D
+ * Copyright 2020-2021 Puresoftware Ltd=0D
*=0D
* SPDX-License-Identifier: BSD-2-Clause-Patent=0D
*=0D
@@ -15,11 +15,7 @@
#define EFI_ACPI_ARM_OEM_REVISION 0x00000000=0D
=0D
// Soc defines=0D
-#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFFFFE)=0D
-#define SVR_MAJOR(svr) (((svr) >> 4) & 0xf)=0D
-#define SVR_MINOR(svr) (((svr) >> 0) & 0xf)=0D
-=0D
-#define SVR_LX2160A 0x873600=0D
+#define PLAT_SOC_NAME "LX2160ARDB"=0D
=0D
// PCLK=0D
#define DCFG_BASE 0x1E00000=0D
diff --git a/Silicon/NXP/LX2160A/LX2160A.dsc.inc b/Silicon/NXP/LX2160A/LX21=
60A.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.=0D
#=0D
# Copyright 2018-2020 NXP=0D
-# Copyright 2020 Puresoftware Ltd=0D
+# Copyright 2020-2021 Puresoftware Ltd=0D
#=0D
# SPDX-License-Identifier: BSD-2-Clause-Patent=0D
#=0D
@@ -70,6 +70,7 @@
Platform/NXP/ConfigurationManagerPkg/ConfigurationManagerDxe/Configurati=
onManagerDxe.inf {=0D
<BuildOptions>=0D
*_*_*_PLATFORM_FLAGS =3D -I$(WORKSPACE)/Platform/NXP/LX2160aRdbPkg/I=
nclude=0D
+ *_*_*_PLATFORM_FLAGS =3D -I$(WORKSPACE)/Silicon/NXP/Chassis3V2/Inclu=
de=0D
}=0D
!endif=0D
=0D
--=20
2.25.1