diff options
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm64/armv8/lib/sysctrl.c | 10 | ||||
-rw-r--r-- | src/arch/arm64/include/armv8/arch/lib_helpers.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/arch/arm64/armv8/lib/sysctrl.c b/src/arch/arm64/armv8/lib/sysctrl.c index deb991f520..2737f56ad2 100644 --- a/src/arch/arm64/armv8/lib/sysctrl.c +++ b/src/arch/arm64/armv8/lib/sysctrl.c @@ -522,6 +522,16 @@ void raw_write_mair_current(uint64_t mair) SWITCH_CASE_WRITE(raw_write_mair,mair); } +/* MIDR */ +uint32_t raw_read_midr_el1(void) +{ + uint32_t midr_el1; + + __asm__ __volatile__("mrs %0, MIDR_EL1\n\t" : "=r" (midr_el1) : : "memory"); + + return midr_el1; +} + /* MPIDR */ uint64_t raw_read_mpidr_el1(void) { diff --git a/src/arch/arm64/include/armv8/arch/lib_helpers.h b/src/arch/arm64/include/armv8/arch/lib_helpers.h index 8c6198f63f..723fc15831 100644 --- a/src/arch/arm64/include/armv8/arch/lib_helpers.h +++ b/src/arch/arm64/include/armv8/arch/lib_helpers.h @@ -214,6 +214,7 @@ uint64_t raw_read_mair_el3(void); void raw_write_mair_el3(uint64_t mair_el3); uint64_t raw_read_mair_current(void); void raw_write_mair_current(uint64_t mair); +uint32_t raw_read_midr_el1(void); uint64_t raw_read_mpidr_el1(void); uint32_t raw_read_rmr_el1(void); void raw_write_rmr_el1(uint32_t rmr_el1); |