All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 11/14] powerpc, 8xx: move cache helper into C
Date: Wed, 12 Jul 2017 11:43:38 +0200 (CEST)	[thread overview]
Message-ID: <3bdd545d711bec89e600d731e0a3d56f9cf4f2bb.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  | 32 --------------------------------
 arch/powerpc/include/asm/cache.h | 32 ++++++++++++++++++++++++++++++++
 arch/powerpc/include/asm/ppc.h   |  6 ------
 3 files changed, 32 insertions(+), 38 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index fbdc82a079..4c25d3765b 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -310,38 +310,6 @@ get_pvr:
 	mfspr	r3, PVR
 	blr
 
-
-	.globl wr_ic_cst
-wr_ic_cst:
-	mtspr	IC_CST, r3
-	blr
-
-	.globl rd_ic_cst
-rd_ic_cst:
-	mfspr	r3, IC_CST
-	blr
-
-	.globl wr_ic_adr
-wr_ic_adr:
-	mtspr	IC_ADR, r3
-	blr
-
-
-	.globl wr_dc_cst
-wr_dc_cst:
-	mtspr	DC_CST, r3
-	blr
-
-	.globl rd_dc_cst
-rd_dc_cst:
-	mfspr	r3, DC_CST
-	blr
-
-	.globl wr_dc_adr
-wr_dc_adr:
-	mtspr	DC_ADR, r3
-	blr
-
 /*------------------------------------------------------------------------------*/
 
 /*
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index d3a83910b6..0801d2c367 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
@@ -107,6 +107,38 @@ void disable_cpc_sram(void);
 
 #define DC_DFWT		0x40000000	/* Data cache is forced write through */
 #define DC_LES		0x20000000	/* Caches are little endian mode */
+
+#if !defined(__ASSEMBLY__)
+static inline uint rd_ic_cst(void)
+{
+	return mfspr(IC_CST);
+}
+
+static inline void wr_ic_cst(uint val)
+{
+	mtspr(IC_CST, val);
+}
+
+static inline void wr_ic_adr(uint val)
+{
+	mtspr(IC_ADR, val);
+}
+
+static inline uint rd_dc_cst(void)
+{
+	return mfspr(DC_CST);
+}
+
+static inline void wr_dc_cst(uint val)
+{
+	mtspr(DC_CST, val);
+}
+
+static inline void wr_dc_adr(uint val)
+{
+	mtspr(DC_ADR, val);
+}
+#endif
 #endif /* CONFIG_8xx */
 
 #endif
diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
index 1f650a7fb3..c41dc1fee0 100644
--- a/arch/powerpc/include/asm/ppc.h
+++ b/arch/powerpc/include/asm/ppc.h
@@ -50,12 +50,6 @@ static inline uint get_immr(uint mask)
 #endif
 uint get_pvr(void);
 uint get_svr(void);
-uint rd_ic_cst(void);
-void wr_ic_cst(uint);
-void wr_ic_adr(uint);
-uint rd_dc_cst(void);
-void wr_dc_cst(uint);
-void wr_dc_adr(uint);
 
 #if defined(CONFIG_MPC85xx)	|| \
 	defined(CONFIG_MPC86xx)	|| \
-- 
2.12.0

  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 ` [U-Boot] [PATCH 10/14] powerpc, 8xx: move get_immr() into C Christophe Leroy
2017-07-12  9:43 ` Christophe Leroy [this message]
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=3bdd545d711bec89e600d731e0a3d56f9cf4f2bb.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.