[U-Boot,4/7] powerpc/8xx: get rid of get_immr()
diff mbox series

Message ID 29c919b5d0e917281a75aef54af59b28b25b4b5e.1516968803.git.christophe.leroy@c-s.fr
State Not Applicable
Headers show
Series
  • [U-Boot,1/7] soft_i2c: cleanup - no 8xx support
Related show

Commit Message

Christophe Leroy Jan. 26, 2018, 8:49 a.m. UTC
function get_immr() is almost not used and doesn't bring much
added value. Just replace it with mfspr(SPRN_IMMR) at the two
needed places.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/cpu/mpc8xx/cpu.c     | 7 +++----
 arch/powerpc/cpu/mpc8xx/reginfo.c | 2 +-
 arch/powerpc/cpu/mpc8xx/speed.c   | 3 +--
 arch/powerpc/include/asm/ppc.h    | 8 --------
 4 files changed, 5 insertions(+), 15 deletions(-)

Patch
diff mbox series

diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c
index 1883440db3..0eabb714d3 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu.c
@@ -36,7 +36,7 @@  DECLARE_GLOBAL_DATA_PTR;
 
 static int check_CPU(long clock, uint pvr, uint immr)
 {
-	immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
+	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
 	uint k;
 	char buf[32];
 
@@ -90,7 +90,7 @@  static int check_CPU(long clock, uint pvr, uint immr)
 int checkcpu(void)
 {
 	ulong clock = gd->cpu_clk;
-	uint immr = get_immr(0);	/* Return full IMMR contents */
+	uint immr = mfspr(SPRN_IMMR);	/* Return full IMMR contents */
 	uint pvr = get_pvr();
 
 	puts("CPU:   ");
@@ -237,8 +237,7 @@  int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  */
 unsigned long get_tbclk(void)
 {
-	uint immr = get_immr(0);	/* Return full IMMR contents */
-	immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
+	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
 	ulong oscclk, factor, pll;
 
 	if (in_be32(&immap->im_clkrst.car_sccr) & SCCR_TBS)
diff --git a/arch/powerpc/cpu/mpc8xx/reginfo.c b/arch/powerpc/cpu/mpc8xx/reginfo.c
index 277d2753b2..1f6e606e52 100644
--- a/arch/powerpc/cpu/mpc8xx/reginfo.c
+++ b/arch/powerpc/cpu/mpc8xx/reginfo.c
@@ -22,7 +22,7 @@  void print_reginfo(void)
 	 */
 
 	printf("\nSystem Configuration registers\n"
-		"\tIMMR\t0x%08X\n", get_immr(0));
+		"\tIMMR\t0x%08X\n", mfspr(SPRN_IMMR));
 
 	printf("\tSIUMCR\t0x%08X", in_be32(&sysconf->sc_siumcr));
 	printf("\tSYPCR\t0x%08X\n", in_be32(&sysconf->sc_sypcr));
diff --git a/arch/powerpc/cpu/mpc8xx/speed.c b/arch/powerpc/cpu/mpc8xx/speed.c
index fa8f87cbc5..f8eb4a13ea 100644
--- a/arch/powerpc/cpu/mpc8xx/speed.c
+++ b/arch/powerpc/cpu/mpc8xx/speed.c
@@ -17,8 +17,7 @@  DECLARE_GLOBAL_DATA_PTR;
  */
 int get_clocks(void)
 {
-	uint immr = get_immr(0);	/* Return full IMMR contents */
-	immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
+	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
 	uint sccr = in_be32(&immap->im_clkrst.car_sccr);
 	uint divider = 1 << (((sccr & SCCR_DFBRG11) >> 11) * 2);
 
diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
index 5e0aa08be9..db289ed707 100644
--- a/arch/powerpc/include/asm/ppc.h
+++ b/arch/powerpc/include/asm/ppc.h
@@ -40,14 +40,6 @@ 
 
 #include <asm/processor.h>
 
-#if defined(CONFIG_8xx)
-static inline uint get_immr(uint mask)
-{
-	uint immr = mfspr(SPRN_IMMR);
-
-	return mask ? (immr & mask) : immr;
-}
-#endif
 static inline uint get_pvr(void)
 {
 	return mfspr(PVR);