Function to get the contents of the mpidr register, similar to
its arm64 counterpart.

Signed-off-by: Heiko Stuebner <[email protected]>
---
 arch/arm/include/asm/system.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index aed2e3c51e..b5332f4347 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -364,6 +364,15 @@ static inline int is_hyp(void)
 #endif
 }
 
+static inline unsigned long read_mpidr(void)
+{
+       unsigned long val;
+
+       asm volatile ("mrc p15, 0, %0, c0, c0, 5" : "=r" (val));
+
+       return val;
+}
+
 static inline unsigned int get_cr(void)
 {
        unsigned int val;
-- 
2.20.1

_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

Reply via email to