2 // Copyright (c) 2011-2014, ARM Limited. All rights reserved.
3 // Copyright (c) 2014, Linaro Limited. All rights reserved.
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
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.
14 #include <Library/ArmLib.h>
17 INCLUDE AsmMacroIoLib.inc
19 EXPORT ArmPlatformPeiBootAction
20 EXPORT ArmPlatformIsPrimaryCore
21 EXPORT ArmPlatformGetPrimaryCoreMpId
22 EXPORT ArmPlatformGetCorePosition
23 EXPORT ArmGetPhysAddrTop
25 AREA VirtHelper, CODE, READONLY
27 ArmPlatformPeiBootAction FUNCTION
32 //ArmPlatformGetPrimaryCoreMpId (
35 ArmPlatformGetPrimaryCoreMpId FUNCTION
36 MOV32 r0, FixedPcdGet32 (PcdArmPrimaryCore)
41 //ArmPlatformIsPrimaryCore (
44 ArmPlatformIsPrimaryCore FUNCTION
50 //ArmPlatformGetCorePosition (
53 // With this function: CorePos = (ClusterId * 4) + CoreId
54 ArmPlatformGetCorePosition FUNCTION
55 and r1, r0, #ARM_CORE_MASK
56 and r0, r0, #ARM_CLUSTER_MASK
57 add r0, r1, r0, LSR #6
61 //EFI_PHYSICAL_ADDRESS
65 ArmGetPhysAddrTop FUNCTION