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

index fbdc82a0794c90fd076ae3ee7c8e26391537011f..4c25d3765b87a0b1f1fa12a1baba4178ff55302e 100644 (file)
@@ -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
-
 /*------------------------------------------------------------------------------*/
 
 /*
index d3a83910b6fce2c6449d30fa040f4b7c596686b2..0801d2c367765e3162fd86226eec4661d17c5890 100644 (file)
@@ -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
index e11f39801e552aa000075f4bebe9f991eb2273e6..61838cb2d914167ef75534fff767680a013a984f 100644 (file)
@@ -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) || \