diff options
author | Sergey Temerkhanov <s.temerkhanov@gmail.com> | 2015-10-14 09:55:44 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-01-19 22:25:35 +0000 |
commit | ba5648cd91b010a9288798472a6d51b137fff89d (patch) | |
tree | fb1390a6333660a17f6d3bc0c448a8a7636986d1 /arch | |
parent | 19de81502be9e4dd1132b4b9641f66a587b8b0e2 (diff) | |
download | u-boot-ba5648cd91b010a9288798472a6d51b137fff89d.tar.gz u-boot-ba5648cd91b010a9288798472a6d51b137fff89d.tar.xz u-boot-ba5648cd91b010a9288798472a6d51b137fff89d.zip |
armv8: Add read_mpidr() function
This patch adds the read_mpidr() function which returns the
MPIDR_EL1 register value
Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com>
Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/system.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 71b31085b4..5d66fa00b6 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -72,6 +72,17 @@ static inline void set_sctlr(unsigned int val) asm volatile("isb"); } +static inline unsigned long read_mpidr(void) +{ + unsigned long val; + + asm volatile("mrs %0, mpidr_el1" : "=r" (val)); + + return val; +} + +#define BSP_COREID 0 + void __asm_flush_dcache_all(void); void __asm_invalidate_dcache_all(void); void __asm_flush_dcache_range(u64 start, u64 end); |