2012-09-28 13:09:36 +02:00
|
|
|
//
|
2013-05-10 14:41:27 +02:00
|
|
|
// Copyright (c) 2012-2013, ARM Limited. All rights reserved.
|
2012-09-28 13:09:36 +02:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <Library/ArmLib.h>
|
|
|
|
|
2013-05-10 14:41:27 +02:00
|
|
|
#include <ArmPlatform.h>
|
|
|
|
|
2012-09-28 13:09:36 +02:00
|
|
|
INCLUDE AsmMacroIoLib.inc
|
|
|
|
|
2013-05-10 14:49:10 +02:00
|
|
|
EXPORT ArmPlatformPeiBootAction
|
2012-09-28 13:09:36 +02:00
|
|
|
EXPORT ArmPlatformGetCorePosition
|
2013-05-10 14:41:27 +02:00
|
|
|
EXPORT ArmPlatformIsPrimaryCore
|
2013-12-06 17:11:34 +01:00
|
|
|
EXPORT ArmPlatformGetPrimaryCoreMpId
|
2012-09-28 13:09:36 +02:00
|
|
|
|
|
|
|
PRESERVE8
|
|
|
|
AREA CTA15A7Helper, CODE, READONLY
|
2013-05-10 14:49:10 +02:00
|
|
|
|
|
|
|
ArmPlatformPeiBootAction FUNCTION
|
|
|
|
bx lr
|
|
|
|
ENDFUNC
|
2012-09-28 13:09:36 +02:00
|
|
|
|
|
|
|
//UINTN
|
|
|
|
//ArmPlatformGetCorePosition (
|
|
|
|
// IN UINTN MpId
|
|
|
|
// );
|
|
|
|
ArmPlatformGetCorePosition FUNCTION
|
ARM Packages: Replace tabs by spaces for indentation
Replace tabs by spaces for indentation to comply to EDK2 coding standards.
Done in files with extension ".S", ".c", ".h", ".asm", ".dsc", ".inc", "*.inf",
"*.dec" or ".fdf" and located in ArmPkg, ArmPlatformPkg, EmbeddedPkg,
BeagleBoardPkg or Omap35xxPkg.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15901 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-26 12:14:17 +02:00
|
|
|
and r1, r0, #ARM_CORE_MASK
|
|
|
|
and r0, r0, #ARM_CLUSTER_MASK
|
|
|
|
add r0, r1, r0, LSR #7
|
|
|
|
bx lr
|
2012-09-28 13:09:36 +02:00
|
|
|
ENDFUNC
|
|
|
|
|
2013-05-10 14:41:27 +02:00
|
|
|
//UINTN
|
|
|
|
//ArmPlatformIsPrimaryCore (
|
|
|
|
// IN UINTN MpId
|
|
|
|
// );
|
|
|
|
ArmPlatformIsPrimaryCore FUNCTION
|
|
|
|
// Extract cpu_id and cluster_id from ARM_SCC_CFGREG48
|
|
|
|
// with cpu_id[0:3] and cluster_id[4:7]
|
2016-08-10 15:50:25 +02:00
|
|
|
mov32 r1, ARM_CTA15A7_SCC_CFGREG48
|
2013-05-10 14:41:27 +02:00
|
|
|
ldr r1, [r1]
|
|
|
|
lsr r1, #24
|
|
|
|
|
|
|
|
// Shift the SCC value to get the cluster ID at the offset #8
|
|
|
|
lsl r2, r1, #4
|
|
|
|
and r2, r2, #0xF00
|
|
|
|
|
|
|
|
// Keep only the cpu ID from the original SCC
|
|
|
|
and r1, r1, #0x0F
|
|
|
|
// Add the Cluster ID to the Cpu ID
|
|
|
|
orr r1, r1, r2
|
|
|
|
|
|
|
|
// Keep the Cluster ID and Core ID from the MPID
|
2016-08-10 15:50:25 +02:00
|
|
|
mov32 r2, ARM_CLUSTER_MASK :OR: ARM_CORE_MASK
|
2013-05-10 14:41:27 +02:00
|
|
|
and r0, r0, r2
|
|
|
|
|
|
|
|
// Compare mpid and boot cpu from ARM_SCC_CFGREG48
|
|
|
|
cmp r0, r1
|
|
|
|
moveq r0, #1
|
|
|
|
movne r0, #0
|
|
|
|
bx lr
|
|
|
|
ENDFUNC
|
|
|
|
|
2013-12-06 17:11:34 +01:00
|
|
|
//UINTN
|
|
|
|
//ArmPlatformGetPrimaryCoreMpId (
|
|
|
|
// VOID
|
|
|
|
// );
|
|
|
|
ArmPlatformGetPrimaryCoreMpId FUNCTION
|
|
|
|
// Extract cpu_id and cluster_id from ARM_SCC_CFGREG48
|
|
|
|
// with cpu_id[0:3] and cluster_id[4:7]
|
2016-08-10 15:50:25 +02:00
|
|
|
mov32 r0, ARM_CTA15A7_SCC_CFGREG48
|
2013-12-06 17:11:34 +01:00
|
|
|
ldr r0, [r0]
|
|
|
|
lsr r0, #24
|
|
|
|
|
|
|
|
// Shift the SCC value to get the cluster ID at the offset #8
|
|
|
|
lsl r1, r0, #4
|
|
|
|
and r1, r1, #0xF00
|
|
|
|
|
|
|
|
// Keep only the cpu ID from the original SCC
|
|
|
|
and r0, r0, #0x0F
|
|
|
|
// Add the Cluster ID to the Cpu ID
|
|
|
|
orr r0, r0, r1
|
|
|
|
bx lr
|
|
|
|
ENDFUNC
|
|
|
|
|
2012-09-28 13:09:36 +02:00
|
|
|
END
|