]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
powerpc, 8xx: move specific reginfo
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 6 Jul 2017 08:33:11 +0000 (10:33 +0200)
committerTom Rini <trini@konsulko.com>
Sat, 8 Jul 2017 19:55:30 +0000 (15:55 -0400)
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Heiko Schocher <hs@denx.de>
arch/powerpc/cpu/mpc8xx/Makefile
arch/powerpc/cpu/mpc8xx/reginfo.c [new file with mode: 0644]
cmd/reginfo.c

index eae02da6369a909ad27a83dddef979df8c87da48..b5b4bfafb96ecccdc9977cb282590e9ed363d32c 100644 (file)
@@ -13,6 +13,7 @@ obj-y += fec.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  += serial.o
 obj-y  += speed.o
 obj-y  += spi.o
diff --git a/arch/powerpc/cpu/mpc8xx/reginfo.c b/arch/powerpc/cpu/mpc8xx/reginfo.c
new file mode 100644 (file)
index 0000000..b5a9624
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * (C) Copyright 2000
+ * Subodh Nijsure, SkyStream Networks, snijsure@skystream.com
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <mpc8xx.h>
+
+void mpc8xx_reginfo(void)
+{
+       volatile immap_t     *immap  = (immap_t *)CONFIG_SYS_IMMR;
+       volatile memctl8xx_t *memctl = &immap->im_memctl;
+       volatile sysconf8xx_t *sysconf = &immap->im_siu_conf;
+       volatile sit8xx_t *timers = &immap->im_sit;
+
+       /* Hopefully more PowerPC  knowledgable people will add code to display
+        * other useful registers
+        */
+
+       printf ("\nSystem Configuration registers\n"
+
+               "\tIMMR\t0x%08X\n", get_immr(0));
+
+       printf("\tSIUMCR\t0x%08X", sysconf->sc_siumcr);
+       printf("\tSYPCR\t0x%08X\n",sysconf->sc_sypcr);
+
+       printf("\tSWT\t0x%08X",    sysconf->sc_swt);
+       printf("\tSWSR\t0x%04X\n", sysconf->sc_swsr);
+
+       printf("\tSIPEND\t0x%08X\tSIMASK\t0x%08X\n",
+               sysconf->sc_sipend, sysconf->sc_simask);
+       printf("\tSIEL\t0x%08X\tSIVEC\t0x%08X\n",
+               sysconf->sc_siel, sysconf->sc_sivec);
+       printf("\tTESR\t0x%08X\tSDCR\t0x%08X\n",
+               sysconf->sc_tesr, sysconf->sc_sdcr);
+
+       printf ("Memory Controller Registers\n"
+
+               "\tBR0\t0x%08X\tOR0\t0x%08X \n", memctl->memc_br0, memctl->memc_or0);
+       printf("\tBR1\t0x%08X\tOR1\t0x%08X \n", memctl->memc_br1, memctl->memc_or1);
+       printf("\tBR2\t0x%08X\tOR2\t0x%08X \n", memctl->memc_br2, memctl->memc_or2);
+       printf("\tBR3\t0x%08X\tOR3\t0x%08X \n", memctl->memc_br3, memctl->memc_or3);
+       printf("\tBR4\t0x%08X\tOR4\t0x%08X \n", memctl->memc_br4, memctl->memc_or4);
+       printf("\tBR5\t0x%08X\tOR5\t0x%08X \n", memctl->memc_br5, memctl->memc_or5);
+       printf("\tBR6\t0x%08X\tOR6\t0x%08X \n", memctl->memc_br6, memctl->memc_or6);
+       printf("\tBR7\t0x%08X\tOR7\t0x%08X \n", memctl->memc_br7, memctl->memc_or7);
+       printf ("\n"
+               "\tmamr\t0x%08X\tmbmr\t0x%08X \n",
+               memctl->memc_mamr, memctl->memc_mbmr );
+       printf("\tmstat\t0x%08X\tmptpr\t0x%08X \n",
+               memctl->memc_mstat, memctl->memc_mptpr );
+       printf("\tmdr\t0x%08X \n", memctl->memc_mdr);
+
+       printf ("\nSystem Integration Timers\n"
+               "\tTBSCR\t0x%08X\tRTCSC\t0x%08X \n",
+               timers->sit_tbscr, timers->sit_rtcsc);
+       printf("\tPISCR\t0x%08X \n", timers->sit_piscr);
+
+       /*
+        * May be some CPM info here?
+        */
+}
index 850f28cabccea611860046ec56069469509c94bc..b364cc899a00ac55c3d5a44b48a8b3d966bcc674 100644 (file)
@@ -8,7 +8,7 @@
 #include <common.h>
 #include <command.h>
 #if defined(CONFIG_8xx)
-#include <mpc8xx.h>
+void mpc8xx_reginfo(void);
 #elif defined(CONFIG_MPC86xx)
 extern void mpc86xx_reginfo(void);
 #elif defined(CONFIG_MPC85xx)
@@ -19,57 +19,7 @@ static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc,
                       char * const argv[])
 {
 #if defined(CONFIG_8xx)
-       volatile immap_t     *immap  = (immap_t *)CONFIG_SYS_IMMR;
-       volatile memctl8xx_t *memctl = &immap->im_memctl;
-       volatile sysconf8xx_t *sysconf = &immap->im_siu_conf;
-       volatile sit8xx_t *timers = &immap->im_sit;
-
-       /* Hopefully more PowerPC  knowledgable people will add code to display
-        * other useful registers
-        */
-
-       printf ("\nSystem Configuration registers\n"
-
-               "\tIMMR\t0x%08X\n", get_immr(0));
-
-       printf("\tSIUMCR\t0x%08X", sysconf->sc_siumcr);
-       printf("\tSYPCR\t0x%08X\n",sysconf->sc_sypcr);
-
-       printf("\tSWT\t0x%08X",    sysconf->sc_swt);
-       printf("\tSWSR\t0x%04X\n", sysconf->sc_swsr);
-
-       printf("\tSIPEND\t0x%08X\tSIMASK\t0x%08X\n",
-               sysconf->sc_sipend, sysconf->sc_simask);
-       printf("\tSIEL\t0x%08X\tSIVEC\t0x%08X\n",
-               sysconf->sc_siel, sysconf->sc_sivec);
-       printf("\tTESR\t0x%08X\tSDCR\t0x%08X\n",
-               sysconf->sc_tesr, sysconf->sc_sdcr);
-
-       printf ("Memory Controller Registers\n"
-
-               "\tBR0\t0x%08X\tOR0\t0x%08X \n", memctl->memc_br0, memctl->memc_or0);
-       printf("\tBR1\t0x%08X\tOR1\t0x%08X \n", memctl->memc_br1, memctl->memc_or1);
-       printf("\tBR2\t0x%08X\tOR2\t0x%08X \n", memctl->memc_br2, memctl->memc_or2);
-       printf("\tBR3\t0x%08X\tOR3\t0x%08X \n", memctl->memc_br3, memctl->memc_or3);
-       printf("\tBR4\t0x%08X\tOR4\t0x%08X \n", memctl->memc_br4, memctl->memc_or4);
-       printf("\tBR5\t0x%08X\tOR5\t0x%08X \n", memctl->memc_br5, memctl->memc_or5);
-       printf("\tBR6\t0x%08X\tOR6\t0x%08X \n", memctl->memc_br6, memctl->memc_or6);
-       printf("\tBR7\t0x%08X\tOR7\t0x%08X \n", memctl->memc_br7, memctl->memc_or7);
-       printf ("\n"
-               "\tmamr\t0x%08X\tmbmr\t0x%08X \n",
-               memctl->memc_mamr, memctl->memc_mbmr );
-       printf("\tmstat\t0x%08X\tmptpr\t0x%08X \n",
-               memctl->memc_mstat, memctl->memc_mptpr );
-       printf("\tmdr\t0x%08X \n", memctl->memc_mdr);
-
-       printf ("\nSystem Integration Timers\n"
-               "\tTBSCR\t0x%08X\tRTCSC\t0x%08X \n",
-               timers->sit_tbscr, timers->sit_rtcsc);
-       printf("\tPISCR\t0x%08X \n", timers->sit_piscr);
-
-       /*
-        * May be some CPM info here?
-        */
+       mpc8xx_reginfo();
 
 #elif defined(CONFIG_MPC86xx)
        mpc86xx_reginfo();