summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2024-10-23 15:20:15 +0200
committerTom Rini <trini@konsulko.com>2024-10-27 17:24:13 -0600
commit080be069f5fc4cd0f5a9fbf3e697e0a9ba3ca992 (patch)
tree2b7057f7b4ad954a91cdb09f65117bf5ffce54e1
parent92e02b01eceacb21c65c1aa07e3ca0695fdbaff7 (diff)
arm: Implement read_mpidr on armv7
Implement read_mpidr() on armv7 to make use of it in generic code that compiles on both armv7 and armv8. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/arm/include/asm/system.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 2237d7d0066..9eb30c2ade8 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -394,6 +394,15 @@ void switch_to_hypervisor_ret(void);
#define wfi()
#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 long get_cpsr(void)
{
unsigned long cpsr;