[U-Boot,12/14] powerpc: move get_pvr() and get_svr() into C
diff mbox

Message ID 8afbabcec9a9cb58c2be76d4b7956b2288aef556.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/mpc83xx/start.S | 10 ----------
 arch/powerpc/cpu/mpc85xx/start.S | 10 ----------
 arch/powerpc/cpu/mpc86xx/start.S | 10 ----------
 arch/powerpc/cpu/mpc8xx/start.S  |  5 -----
 arch/powerpc/include/asm/ppc.h   | 11 +++++++++--
 5 files changed, 9 insertions(+), 37 deletions(-)

Patch
diff mbox

diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index 2fed4a1fec..d99ae27a65 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -116,16 +116,6 @@  disable_addr_trans:
 	mtspr	SRR1, r3
 	rfi
 
-	.globl get_svr
-get_svr:
-	mfspr	r3, SVR
-	blr
-
-	.globl get_pvr
-get_pvr:
-	mfspr	r3, PVR
-	blr
-
 	.globl	ppcDWstore
 ppcDWstore:
 	lfd	1, 0(r4)
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index 63fdffddb1..f03e1a0bfe 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -1427,16 +1427,6 @@  dcache_status:
 	andi.	r3,r3,L1CSR0_DCE
 	blr
 
-	.globl get_pvr
-get_pvr:
-	mfspr	r3,PVR
-	blr
-
-	.globl get_svr
-get_svr:
-	mfspr	r3,SVR
-	blr
-
 /*------------------------------------------------------------------------------- */
 /* Function:	 in8 */
 /* Description:	 Input 8 bits */
diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S
index ec5f4a756a..b9e544d23c 100644
--- a/arch/powerpc/cpu/mpc86xx/start.S
+++ b/arch/powerpc/cpu/mpc86xx/start.S
@@ -545,16 +545,6 @@  int_return:
 dc_read:
 	blr
 
-	.globl get_pvr
-get_pvr:
-	mfspr	r3, PVR
-	blr
-
-	.globl get_svr
-get_svr:
-	mfspr	r3, SVR
-	blr
-
 
 /*
  * Function:	in8
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index 4c25d3765b..202ea81ae4 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -305,11 +305,6 @@  int_return:
 	SYNC
 	rfi
 
-	.globl get_pvr
-get_pvr:
-	mfspr	r3, PVR
-	blr
-
 /*------------------------------------------------------------------------------*/
 
 /*
diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
index c41dc1fee0..e8650e4388 100644
--- a/arch/powerpc/include/asm/ppc.h
+++ b/arch/powerpc/include/asm/ppc.h
@@ -48,8 +48,15 @@  static inline uint get_immr(uint mask)
 	return mask ? (immr & mask) : immr;
 }
 #endif
-uint get_pvr(void);
-uint get_svr(void);
+static inline uint get_pvr(void)
+{
+	return mfspr(PVR);
+}
+
+static inline uint get_svr(void)
+{
+	return mfspr(SVR);
+}
 
 #if defined(CONFIG_MPC85xx)	|| \
 	defined(CONFIG_MPC86xx)	|| \