[U-Boot,10/14] powerpc, 8xx: move get_immr() into C
diff mbox

Message ID 4c8c72603166db537c436f2e57bf4c15da932c75.1499629706.git.christophe.leroy@c-s.fr
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Christophe Leroy July 12, 2017, 9:43 a.m. UTC
Avoid unnecessary assembly functions when they can easily be written
in C.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/cpu/mpc8xx/start.S | 15 ---------------
 arch/powerpc/include/asm/ppc.h  |  9 ++++++++-
 2 files changed, 8 insertions(+), 16 deletions(-)

Patch
diff mbox

diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index cd3b29425f..fbdc82a079 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -305,21 +305,6 @@  int_return:
 	SYNC
 	rfi
 
-/*
- * unsigned int get_immr (unsigned int mask)
- *
- * return (mask ? (IMMR & mask) : IMMR);
- */
-	.globl	get_immr
-get_immr:
-	mr	r4,r3		/* save mask */
-	mfspr	r3, IMMR	/* IMMR */
-	cmpwi	0,r4,0		/* mask != 0 ? */
-	beq	4f
-	and	r3,r3,r4	/* IMMR & mask */
-4:
-	blr
-
 	.globl get_pvr
 get_pvr:
 	mfspr	r3, PVR
diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
index 4013ddaa74..1f650a7fb3 100644
--- a/arch/powerpc/include/asm/ppc.h
+++ b/arch/powerpc/include/asm/ppc.h
@@ -38,8 +38,15 @@ 
 #include <asm/arch/immap_lsch2.h>
 #endif
 
+#include <asm/processor.h>
+
 #if defined(CONFIG_8xx)
-uint get_immr(uint);
+static inline uint get_immr(uint mask)
+{
+	uint immr = mfspr(SPRN_IMMR);
+
+	return mask ? (immr & mask) : immr;
+}
 #endif
 uint get_pvr(void);
 uint get_svr(void);