From a534d7148079f71f932e963d836c731559491021 Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Thu, 31 Mar 2011 12:18:28 +0000 Subject: [PATCH] ArmPlatformPkg/ArmPlatformLib: Introduce the function ArmPlatformGetBootMode() This function returns the current Boot Mode of the ARM Platform. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11480 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c | 14 ++++++++++++++ .../Library/ArmVExpressLibCTA9x4/CTA9x4.c | 16 ++++++++++++++++ ArmPlatformPkg/Include/Library/ArmPlatformLib.h | 13 +++++++++++++ ArmPlatformPkg/PlatformPei/PlatformPei.c | 7 +------ ArmPlatformPkg/PlatformPei/PlatformPei.inf | 2 ++ 5 files changed, 46 insertions(+), 6 deletions(-) diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c index 003f657163..070db6ab59 100644 --- a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c +++ b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c @@ -57,6 +57,20 @@ VOID ArmPlatformBootRemapping(VOID) { MmioOr32 (ARM_EB_SYSCTRL, BIT8); //EB_SP810_CTRL_BASE } +/** + Return the current Boot Mode + + This function returns the boot reason on the platform + +**/ +EFI_BOOT_MODE +ArmPlatformGetBootMode ( + VOID + ) +{ + return BOOT_WITH_FULL_CONFIGURATION; +} + /** Initialize controllers that must setup at the early stage diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c index 2d39207e29..490dda1a92 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c @@ -137,6 +137,22 @@ VOID ArmPlatformTrustzoneInit(VOID) { TZASC_REGION_SIZE_256MB, TZASC_REGION_SECURITY_NSRW); } +/** + Return the current Boot Mode + + This function returns the boot reason on the platform + + @return Return the current Boot Mode of the platform + +**/ +EFI_BOOT_MODE +ArmPlatformGetBootMode ( + VOID + ) +{ + return BOOT_WITH_FULL_CONFIGURATION; +} + /** Remap the memory at 0x0 diff --git a/ArmPlatformPkg/Include/Library/ArmPlatformLib.h b/ArmPlatformPkg/Include/Library/ArmPlatformLib.h index c9b215e6dc..83c19baabd 100644 --- a/ArmPlatformPkg/Include/Library/ArmPlatformLib.h +++ b/ArmPlatformPkg/Include/Library/ArmPlatformLib.h @@ -67,6 +67,19 @@ VOID ArmPlatformIsMemoryInitialized(VOID); **/ VOID ArmPlatformInitializeBootMemory(VOID); +/** + Return the current Boot Mode + + This function returns the boot reason on the platform + + @return Return the current Boot Mode of the platform + +**/ +EFI_BOOT_MODE +ArmPlatformGetBootMode ( + VOID + ); + /** Initialize controllers that must setup at the early stage diff --git a/ArmPlatformPkg/PlatformPei/PlatformPei.c b/ArmPlatformPkg/PlatformPei/PlatformPei.c index a7fa4321c0..0d90173670 100644 --- a/ArmPlatformPkg/PlatformPei/PlatformPei.c +++ b/ArmPlatformPkg/PlatformPei/PlatformPei.c @@ -77,12 +77,7 @@ Returns: BuildFvHob (FixedPcdGet32(PcdFlashFvMainBase), FixedPcdGet32(PcdFlashFvMainSize)); - // - // Let's assume things are OK if not told otherwise - // Should we read an environment variable in order to easily change this? - // - BootMode = BOOT_WITH_FULL_CONFIGURATION; - + BootMode = ArmPlatformGetBootMode (); Status = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode); ASSERT_EFI_ERROR (Status); diff --git a/ArmPlatformPkg/PlatformPei/PlatformPei.inf b/ArmPlatformPkg/PlatformPei/PlatformPei.inf index 452c0258d6..c35889a968 100644 --- a/ArmPlatformPkg/PlatformPei/PlatformPei.inf +++ b/ArmPlatformPkg/PlatformPei/PlatformPei.inf @@ -34,11 +34,13 @@ MdePkg/MdePkg.dec EmbeddedPkg/EmbeddedPkg.dec ArmPkg/ArmPkg.dec + ArmPlatformPkg/ArmPlatformPkg.dec [LibraryClasses] PeimEntryPoint DebugLib HobLib + ArmPlatformLib [Ppis] gEfiPeiMasterBootModePpiGuid # PPI ALWAYS_PRODUCED