[U-Boot,1/8] arm: v7: add read_mpidr function for arm32
diff mbox series

Message ID 20190405083013.5473-2-heiko@sntech.de
State Changes Requested
Delegated to: Kever Yang
Headers show
Series
  • arm-trusted-firmware support for rk3288
Related show

Commit Message

Heiko Stuebner April 5, 2019, 8:30 a.m. UTC
Function to get the contents of the mpidr register, similar to
its arm64 counterpart.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm/include/asm/system.h | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Matthias Brugger April 16, 2019, 10:29 a.m. UTC | #1
On 05/04/2019 10:30, Heiko Stuebner wrote:
> Function to get the contents of the mpidr register, similar to
> its arm64 counterpart.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>

Reviewed-by: Matthias Brugger <mbrugger@suse.com>

> ---
>  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;
>

Patch
diff mbox series

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;