From: Christophe Leroy <christophe.leroy@c-s.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 10/14] powerpc, 8xx: move get_immr() into C
Date: Wed, 12 Jul 2017 11:43:36 +0200 (CEST) [thread overview]
Message-ID: <4c8c72603166db537c436f2e57bf4c15da932c75.1499629706.git.christophe.leroy@c-s.fr> (raw)
In-Reply-To: <cover.1499629706.git.christophe.leroy@c-s.fr>
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(-)
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);
--
2.12.0
next prev parent reply other threads:[~2017-07-12 9:43 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-12 9:43 [U-Boot] [PATCH 00/14] Cleanup for 8xx and other misc powerpc Christophe Leroy
2017-07-12 9:43 ` [U-Boot] [PATCH 01/14] powerpc, 8xx: Simplify brgclk calculation and remove get_brgclk() Christophe Leroy
2017-07-12 12:52 ` Wolfgang Denk
2017-07-13 13:12 ` Christophe LEROY
2017-07-12 9:43 ` [U-Boot] [PATCH 02/14] powerpc: get rid of addr_probe() Christophe Leroy
2017-07-12 12:56 ` Wolfgang Denk
2017-07-12 9:43 ` [U-Boot] [PATCH 03/14] powerpc, timer: Does 8xx specific actions in 8xx cpu_init Christophe Leroy
2017-07-12 9:43 ` [U-Boot] [PATCH 04/14] power, timer: reset TBL before TBU Christophe Leroy
2017-07-12 13:00 ` Wolfgang Denk
2017-07-12 9:43 ` [U-Boot] [PATCH 05/14] powerpc: move set_msr() and get_msr() into .h Christophe Leroy
2017-07-12 13:03 ` Wolfgang Denk
2017-07-12 9:43 ` [U-Boot] [PATCH 06/14] powerpc: Remove unneccessary #ifdefs in reginfo Christophe Leroy
2017-07-12 13:07 ` Wolfgang Denk
2017-07-12 14:28 ` Christophe LEROY
2017-07-12 14:53 ` Wolfgang Denk
2017-07-12 19:56 ` Tom Rini
2017-07-13 13:15 ` Christophe LEROY
2017-07-12 9:43 ` [U-Boot] [PATCH 07/14] Convert CONFIG_CMD_REGINFO to Kconfig Christophe Leroy
2017-07-12 13:11 ` Wolfgang Denk
2017-07-12 9:43 ` [U-Boot] [PATCH 08/14] powerpc, 8xx: Simplifying check_CPU() Christophe Leroy
2017-07-12 9:43 ` [U-Boot] [PATCH 09/14] powerpc, 8xx: Move cache function into C files Christophe Leroy
2017-07-12 9:43 ` Christophe Leroy [this message]
2017-07-12 9:43 ` [U-Boot] [PATCH 11/14] powerpc, 8xx: move cache helper into C Christophe Leroy
2017-07-12 9:43 ` [U-Boot] [PATCH 12/14] powerpc: move get_pvr() and get_svr() " Christophe Leroy
2017-07-12 9:43 ` [U-Boot] [PATCH 13/14] powerpc, 8xx: fix missing function declarations Christophe Leroy
2017-07-12 9:43 ` [U-Boot] [PATCH 14/14] powerpc: Remove 8260 remainders Christophe Leroy
2017-07-12 19:56 ` [U-Boot] [PATCH 00/14] Cleanup for 8xx and other misc powerpc Tom Rini
2017-07-13 13:12 ` Christophe LEROY
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4c8c72603166db537c436f2e57bf4c15da932c75.1499629706.git.christophe.leroy@c-s.fr \
--to=christophe.leroy@c-s.fr \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.