[U-Boot,7/7] powerpc/8xx: refactorise reginfo
diff mbox series

Message ID 3dc52afdd136559bae62a4508da207d571e01533.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. 25, 2018, 2:46 p.m. UTC
reginfo is redundant with some of the commands in immap.c, so
move reginfo into that file and remove duplicated info.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/cpu/mpc8xx/Makefile |  1 -
 arch/powerpc/cpu/mpc8xx/immap.c  | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/arch/powerpc/cpu/mpc8xx/Makefile b/arch/powerpc/cpu/mpc8xx/Makefile
index 40f38923ec..35ff18a7b3 100644
--- a/arch/powerpc/cpu/mpc8xx/Makefile
+++ b/arch/powerpc/cpu/mpc8xx/Makefile
@@ -12,6 +12,5 @@  obj-y	+= cpu_init.o
 obj-$(CONFIG_OF_LIBFDT) += fdt.o
 obj-$(CONFIG_CMD_IMMAP) += immap.o
 obj-y	+= interrupts.o
-obj-$(CONFIG_CMD_REGINFO) += reginfo.o
 obj-y	+= speed.o
 obj-y	+= cache.o
diff --git a/arch/powerpc/cpu/mpc8xx/immap.c b/arch/powerpc/cpu/mpc8xx/immap.c
index dfe5dc2125..7059a4eb06 100644
--- a/arch/powerpc/cpu/mpc8xx/immap.c
+++ b/arch/powerpc/cpu/mpc8xx/immap.c
@@ -342,6 +342,26 @@  static int do_brginfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 0;
 }
 
+#ifdef CONFIG_CMD_REGINFO
+void print_reginfo(void)
+{
+	immap_t __iomem     *immap  = (immap_t __iomem *)CONFIG_SYS_IMMR;
+	sit8xx_t __iomem *timers = &immap->im_sit;
+
+	printf("\nSystem Configuration registers\n"
+		"\tIMMR\t0x%08X\n", mfspr(SPRN_IMMR));
+	do_siuinfo(NULL, 0, 0, NULL);
+
+	printf("Memory Controller Registers\n");
+	do_memcinfo(NULL, 0, 0, NULL);
+
+	printf("\nSystem Integration Timers\n");
+	printf("\tTBSCR\t0x%04X\tRTCSC\t0x%04X\n",
+	       in_be16(&timers->sit_tbscr), in_be16(&timers->sit_rtcsc));
+	printf("\tPISCR\t0x%04X\n", in_be16(&timers->sit_piscr));
+}
+#endif
+
 /***************************************************/
 
 U_BOOT_CMD(