]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
powerpc, 8xx: move get_immr() into C
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 13 Jul 2017 13:10:02 +0000 (15:10 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 23 Jul 2017 02:22:50 +0000 (22:22 -0400)
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
arch/powerpc/include/asm/ppc.h

index cd3b29425fb5fa91aea9b97d37dd7381c34deee0..fbdc82a0794c90fd076ae3ee7c8e26391537011f 100644 (file)
@@ -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
index 27d3b83e070baaa2711d1bd760f8e74fa326481f..e11f39801e552aa000075f4bebe9f991eb2273e6 100644 (file)
 #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);