diff options
Diffstat (limited to 'ArmPlatformPkg/ArmRealViewEbPkg/Library')
-rw-r--r-- | ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbLibSec.inf | 44 | ||||
-rw-r--r--[-rwxr-xr-x] | ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbBoot.S (renamed from ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbBoot.S) | 14 | ||||
-rw-r--r--[-rwxr-xr-x] | ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbBoot.asm (renamed from ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbBoot.asm) | 16 | ||||
-rw-r--r--[-rwxr-xr-x] | ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbSec.c (renamed from ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbSec.c) | 17 | ||||
-rw-r--r-- | ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbSecLib.inf (renamed from ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbSecLib.inf) | 8 |
5 files changed, 80 insertions, 19 deletions
diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbLibSec.inf b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbLibSec.inf new file mode 100644 index 0000000000..652211d991 --- /dev/null +++ b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbLibSec.inf @@ -0,0 +1,44 @@ +#/* @file
+# Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+#
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+#*/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = ArmRealViewEbLibSec
+ FILE_GUID = 5d1013ae-57b8-4a37-87d8-f5bf70e49059
+ MODULE_TYPE = SEC
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = ArmPlatformLib
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ EmbeddedPkg/EmbeddedPkg.dec
+ ArmPkg/ArmPkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
+
+[LibraryClasses]
+ IoLib
+ ArmLib
+
+[Sources.common]
+ ArmRealViewEb.c
+
+[FeaturePcd]
+ gEmbeddedTokenSpaceGuid.PcdCacheEnable
+
+[FixedPcd]
+ gArmTokenSpaceGuid.PcdSystemMemoryBase
+ gArmTokenSpaceGuid.PcdSystemMemorySize
+
+ gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
+ gArmTokenSpaceGuid.PcdArmPrimaryCore
diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbBoot.S b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbBoot.S index 3f8c9ce520..ba87650f99 100755..100644 --- a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbBoot.S +++ b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbBoot.S @@ -1,5 +1,5 @@ //
-// Copyright (c) 2011, ARM Limited. All rights reserved.
+// Copyright (c) 2011-2012, ARM Limited. All rights reserved.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -13,7 +13,7 @@ #include <AsmMacroIoLib.h>
#include <Base.h>
-#include <Library/ArmPlatformLib.h>
+#include <Library/ArmPlatformSecLib.h>
#include <ArmPlatform.h>
#include <AutoGen.h>
@@ -21,7 +21,7 @@ .align 3
GCC_ASM_EXPORT(ArmPlatformSecBootAction)
-GCC_ASM_EXPORT(ArmPlatformInitializeBootMemory)
+GCC_ASM_EXPORT(ArmPlatformSecBootMemoryInit)
/**
Call at the beginning of the platform boot up
@@ -33,7 +33,11 @@ GCC_ASM_EXPORT(ArmPlatformInitializeBootMemory) **/
ASM_PFX(ArmPlatformSecBootAction):
- bx lr
+ LoadConstantToReg (ARM_EB_SYS_FLAGS_NV_REG, r0)
+ ldr r0, [r0]
+ cmp r0, #0
+ bxeq lr
+ bxne r0
/**
Initialize the memory where the initial stacks will reside
@@ -45,6 +49,6 @@ ASM_PFX(ArmPlatformSecBootAction): pointer is not used (probably required to use assembly language)
**/
-ASM_PFX(ArmPlatformInitializeBootMemory):
+ASM_PFX(ArmPlatformSecBootMemoryInit):
// The SMC does not need to be initialized for RTSM
bx lr
diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbBoot.asm b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbBoot.asm index 9794aac430..1765dd13aa 100755..100644 --- a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbBoot.asm +++ b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbBoot.asm @@ -1,5 +1,5 @@ //
-// Copyright (c) 2011, ARM Limited. All rights reserved.
+// Copyright (c) 2011-2012, ARM Limited. All rights reserved.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -13,17 +13,17 @@ #include <AsmMacroIoLib.h>
#include <Base.h>
-#include <Library/ArmPlatformLib.h>
+#include <Library/ArmPlatformSecLib.h>
#include <ArmPlatform.h>
#include <AutoGen.h>
INCLUDE AsmMacroIoLib.inc
EXPORT ArmPlatformSecBootAction
- EXPORT ArmPlatformInitializeBootMemory
+ EXPORT ArmPlatformSecBootMemoryInit
PRESERVE8
- AREA CTA9x4BootMode, CODE, READONLY
+ AREA ArmRealviewEbBootMode, CODE, READONLY
/**
Call at the beginning of the platform boot up
@@ -35,7 +35,11 @@ **/
ArmPlatformSecBootAction
- bx lr
+ LoadConstantToReg (ARM_EB_SYS_FLAGS_NV_REG, r0)
+ ldr r0, [r0]
+ cmp r0, #0
+ bxeq lr
+ bxne r0
/**
Initialize the memory where the initial stacks will reside
@@ -47,6 +51,6 @@ ArmPlatformSecBootAction pointer is not used (probably required to use assembly language)
**/
-ArmPlatformInitializeBootMemory
+ArmPlatformSecBootMemoryInit
// The SMC does not need to be initialized for RTSM
bx lr
diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbSec.c b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbSec.c index 7191835a61..10dcef92ad 100755..100644 --- a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbSec.c +++ b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbSec.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011, ARM Limited. All rights reserved. +* Copyright (c) 2011-2012, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License @@ -13,7 +13,8 @@ **/ #include <Library/IoLib.h> -#include <Library/ArmPlatformLib.h> +#include <Library/ArmLib.h> +#include <Library/ArmPlatformSecLib.h> #include <Library/DebugLib.h> #include <Library/PcdLib.h> @@ -30,7 +31,7 @@ **/ VOID -ArmPlatformTrustzoneInit ( +ArmPlatformSecTrustzoneInit ( IN UINTN MpId ) { @@ -44,12 +45,18 @@ ArmPlatformTrustzoneInit ( For example, some L2x0 requires to be initialized in Secure World **/ -VOID +RETURN_STATUS ArmPlatformSecInitialize ( - VOID + IN UINTN MpId ) { + // If it is not the primary core then there is nothing to do + if (!IS_PRIMARY_CORE(MpId)) { + return RETURN_SUCCESS; + } + // Do nothing yet + return RETURN_SUCCESS; } /** diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbSecLib.inf b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbSecLib.inf index f72b50dde4..b6971bc768 100644 --- a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbSecLib.inf +++ b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbSecLib.inf @@ -1,5 +1,5 @@ #/* @file
-# Copyright (c) 2011, ARM Limited. All rights reserved.
+# Copyright (c) 2011-2012, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -17,7 +17,7 @@ FILE_GUID = 6e02ebe0-1d96-11e0-b9cb-0002a5d5c51b
MODULE_TYPE = BASE
VERSION_STRING = 1.0
- LIBRARY_CLASS = ArmPlatformLib
+ LIBRARY_CLASS = ArmPlatformSecLib
[Packages]
MdePkg/MdePkg.dec
@@ -31,7 +31,6 @@ ArmLib
[Sources.common]
- ArmRealViewEb.c
ArmRealViewEbSec.c
ArmRealViewEbBoot.asm | RVCT
ArmRealViewEbBoot.S | GCC
@@ -41,3 +40,6 @@ [FixedPcd]
gArmTokenSpaceGuid.PcdFvBaseAddress
+
+ gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
+ gArmTokenSpaceGuid.PcdArmPrimaryCore
|