This register is A5x specific. It is the reason why the code moved from ArmLib
to ArmCpuLib/ArmCortexA5xLib.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15397
6f19259b-4bc3-4df7-8a09-
765794883524
--- /dev/null
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2013 - 2014, 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
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+#include <AsmMacroIoLibV8.h>\r
+\r
+.text\r
+.align 3\r
+GCC_ASM_EXPORT (ArmReadCpuExCr)\r
+GCC_ASM_EXPORT (ArmWriteCpuExCr)\r
+\r
+ASM_PFX(ArmReadCpuExCr):\r
+ mrs x0, S3_1_c15_c2_1\r
+ ret\r
+\r
+ASM_PFX(ArmWriteCpuExCr):\r
+ msr S3_1_c15_c2_1, x0\r
+ dsb sy\r
+ isb\r
+ ret\r
+\r
+ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r
)\r
{\r
}\r
+\r
+VOID\r
+EFIAPI\r
+ArmSetCpuExCrBit (\r
+ IN UINT64 Bits\r
+ )\r
+{\r
+ UINT64 Value;\r
+ Value = ArmReadCpuExCr ();\r
+ Value |= Bits;\r
+ ArmWriteCpuExCr (Value);\r
+}\r
+\r
+VOID\r
+EFIAPI\r
+ArmUnsetCpuExCrBit (\r
+ IN UINT64 Bits\r
+ )\r
+{\r
+ UINT64 Value;\r
+ Value = ArmReadCpuExCr ();\r
+ Value &= ~Bits;\r
+ ArmWriteCpuExCr (Value);\r
+}\r
#/* @file\r
-# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011-2014, 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
[Sources.common]\r
ArmCortexA5xLib.c\r
\r
+[Sources.AARCH64]\r
+ AArch64/ArmCortexA5xHelper.S | GCC\r
+\r
[FixedPcd]\r
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz\r
/** @file\r
\r
- Copyright (c) 2012-2013, ARM Limited. All rights reserved.\r
+ Copyright (c) 2012-2014, 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
//\r
#define A5X_FEATURE_SMP (1 << 6)\r
\r
+//\r
+// Helper functions to access CPU Extended Control Register\r
+//\r
+UINT64\r
+EFIAPI\r
+ArmReadCpuExCr (\r
+ VOID\r
+ );\r
+\r
+VOID\r
+EFIAPI\r
+ArmWriteCpuExCr (\r
+ IN UINT64 Val\r
+ );\r
+\r
+VOID\r
+EFIAPI\r
+ArmSetCpuExCrBit (\r
+ IN UINT64 Bits\r
+ );\r
+\r
+VOID\r
+EFIAPI\r
+ArmUnsetCpuExCrBit (\r
+ IN UINT64 Bits\r
+ );\r
+\r
#endif\r
GCC_ASM_EXPORT (ArmWriteMVBar)\r
GCC_ASM_EXPORT (ArmCallWFE)\r
GCC_ASM_EXPORT (ArmCallSEV)\r
-GCC_ASM_EXPORT (ArmReadCpuExCr)\r
-GCC_ASM_EXPORT (ArmWriteCpuExCr)\r
GCC_ASM_EXPORT (ArmReadCpuActlr)\r
GCC_ASM_EXPORT (ArmWriteCpuActlr)\r
\r
sev\r
ret\r
\r
-ASM_PFX(ArmReadCpuExCr):\r
- mrs x0, S3_1_c15_c2_1\r
- ret\r
-\r
-ASM_PFX(ArmWriteCpuExCr):\r
- msr S3_1_c15_c2_1, x0\r
- dsb sy\r
- isb\r
- ret\r
-\r
ASM_PFX(ArmReadCpuActlr):\r
mrs x0, S3_1_c15_c2_0\r
ret\r