#========================================================================================\r
-# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011-2017, ARM Limited. All rights reserved.\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
#include <AsmMacroIoLibV8.h>\r
#include <Chipset/AArch64.h>\r
\r
-#start of the code section\r
-.text\r
-.align 3\r
-\r
-GCC_ASM_EXPORT(SetupExceptionLevel1)\r
-GCC_ASM_EXPORT(SetupExceptionLevel2)\r
-\r
// Setup EL1 while in EL1\r
-ASM_PFX(SetupExceptionLevel1):\r
+ASM_FUNC(SetupExceptionLevel1)\r
mov x5, x30 // Save LR\r
\r
mov x0, #CPACR_CP_FULL_ACCESS\r
ret x5\r
\r
// Setup EL2 while in EL2\r
-ASM_PFX(SetupExceptionLevel2):\r
+ASM_FUNC(SetupExceptionLevel2)\r
msr sctlr_el2, xzr\r
mrs x0, hcr_el2 // Read EL2 Hypervisor configuration Register\r
\r
\r
msr cptr_el2, xzr // Disable copro traps to EL2\r
\r
+ // Enable Timer access for non-secure EL1 and EL0\r
+ // The cnthctl_el2 register bits are architecturally\r
+ // UNKNOWN on reset.\r
+ // Disable event stream as it is not in use at this stage\r
+ mov x0, #(CNTHCTL_EL2_EL1PCTEN | CNTHCTL_EL2_EL1PCEN)\r
+ msr cnthctl_el2, x0\r
+\r
ret\r
\r
ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r