1 /** @file 2 * 3 * Copyright (c) 2011-2012, ARM Limited. All rights reserved. 4 * 5 * This program and the accompanying materials 6 * are licensed and made available under the terms and conditions of the BSD License 7 * which accompanies this distribution. The full text of the license may be found at 8 * http://opensource.org/licenses/bsd-license.php 9 * 10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 * 13 **/ 14 15 #ifndef _ARMPLATFORMSECLIB_H_ 16 #define _ARMPLATFORMSECLIB_H_ 17 18 #define ARM_SEC_BOOT_MASK ~0 19 #define ARM_SEC_COLD_BOOT (1 << 0) 20 #define ARM_SEC_SECONDARY_COLD_BOOT (1 << 1) 21 22 /** 23 Initialize the memory where the initial stacks will reside 24 25 This memory can contain the initial stacks (Secure and Secure Monitor stacks). 26 In some platform, this region is already initialized and the implementation of this function can 27 do nothing. This memory can also represent the Secure RAM. 28 This function is called before the satck has been set up. Its implementation must ensure the stack 29 pointer is not used (probably required to use assembly language) 30 31 **/ 32 VOID 33 ArmPlatformSecBootMemoryInit ( 34 VOID 35 ); 36 37 /** 38 Call at the beginning of the platform boot up 39 40 This function allows the firmware platform to do extra actions at the early 41 stage of the platform power up. 42 43 Note: This function must be implemented in assembler as there is no stack set up yet 44 45 **/ 46 VOID 47 ArmPlatformSecBootAction ( 48 VOID 49 ); 50 51 /** 52 Initialize controllers that must setup at the early stage 53 54 Some peripherals must be initialized in Secure World. 55 For example: Some L2 controller, interconnect, clock, DMC, etc 56 57 **/ 58 RETURN_STATUS 59 ArmPlatformSecInitialize ( 60 IN UINTN MpId 61 ); 62 63 /** 64 Call before jumping to Normal World 65 66 This function allows the firmware platform to do extra actions before 67 jumping to the Normal World 68 69 **/ 70 VOID 71 ArmPlatformSecExtraAction ( 72 IN UINTN MpId, 73 OUT UINTN* JumpAddress 74 ); 75 76 /** 77 Initialize the Secure peripherals and memory regions 78 79 If Trustzone is supported by your platform then this function makes the required initialization 80 of the secure peripherals and memory regions. 81 82 **/ 83 VOID 84 ArmPlatformSecTrustzoneInit ( 85 IN UINTN MpId 86 ); 87 88 #endif 89