summaryrefslogtreecommitdiff
path: root/src/arch/arm64/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm64/include')
-rw-r--r--src/arch/arm64/include/arch/startup.h3
-rw-r--r--src/arch/arm64/include/armv8/arch/lib_helpers.h12
2 files changed, 14 insertions, 1 deletions
diff --git a/src/arch/arm64/include/arch/startup.h b/src/arch/arm64/include/arch/startup.h
index bb3a863754..671c13e4cb 100644
--- a/src/arch/arm64/include/arch/startup.h
+++ b/src/arch/arm64/include/arch/startup.h
@@ -29,8 +29,9 @@
#define TTBR0_INDEX 2
#define SCR_INDEX 3
#define VBAR_INDEX 4
+#define CNTFRQ_INDEX 5
/* IMPORTANT!!! If any new element is added please update NUM_ELEMENTS */
-#define NUM_ELEMENTS 5
+#define NUM_ELEMENTS 6
#ifndef __ASSEMBLY__
diff --git a/src/arch/arm64/include/armv8/arch/lib_helpers.h b/src/arch/arm64/include/armv8/arch/lib_helpers.h
index 1e04d48cfa..bb7300f2b7 100644
--- a/src/arch/arm64/include/armv8/arch/lib_helpers.h
+++ b/src/arch/arm64/include/armv8/arch/lib_helpers.h
@@ -261,6 +261,16 @@
402:
.endm
+/* Macro to read from an el0 register */
+.macro read_el0 xreg sysreg
+ mrs \xreg, \sysreg\()_el0
+.endm
+
+/* Macro to write to an el0 register */
+.macro write_el0 sysreg xreg temp
+ msr \sysreg\()_el0, \xreg
+.endm
+
/* Macro to invalidate all stage 1 TLB entries for current EL */
.macro tlbiall_current temp
switch_el \temp, 401f, 402f, 403f
@@ -547,6 +557,8 @@ uint64_t raw_read_vbar_current(void);
void raw_write_vbar_current(uint64_t vbar);
uint64_t raw_read_vbar(uint32_t el);
void raw_write_vbar(uint64_t vbar, uint32_t el);
+uint32_t raw_read_cntfrq_el0(void);
+void raw_write_cntfrq_el0(uint32_t cntfrq_el0);
/* Cache maintenance system instructions */
void dccisw(uint64_t cisw);