From: Sergey Temerkhanov Date: Wed, 14 Oct 2015 16:55:44 +0000 (-0700) Subject: armv8: Add read_mpidr() function X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ba5648cd91b010a9288798472a6d51b137fff89d;p=project%2Fbcm63xx%2Fu-boot.git armv8: Add read_mpidr() function This patch adds the read_mpidr() function which returns the MPIDR_EL1 register value Signed-off-by: Sergey Temerkhanov Signed-off-by: Radha Mohan Chintakuntla Reviewed-by: Simon Glass --- 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);