]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
Added "reginfo" command (Subodh Nijsure)
authorwdenk <wdenk>
Fri, 9 Feb 2001 11:18:16 +0000 (11:18 +0000)
committerwdenk <wdenk>
Fri, 9 Feb 2001 11:18:16 +0000 (11:18 +0000)
CHANGELOG
common/Makefile
common/cmd_reginfo.c [new file with mode: 0644]
common/command.c
include/cmd_confdefs.h
include/cmd_reginfo.h [new file with mode: 0644]

index e77f9e654802f6d8b82357b407aeff0a3f75bb98..69e43bd5a0b0d1a668602f2df5d3574b87e39922 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -61,6 +61,8 @@ To do:
 Modifications for 0.8.2:
 ======================================================================
 
+* Added "reginfo" command (Subodh Nijsure)
+
 * Fix problem for Walnut405 with bad use of "-mrelocatable" option
   when building envcrc
 
index 8c8f5e7caab1526ad46baf3a4d07e6deed73c28c..c82a1aaf1b96b007066c0cc143b802a5a72b0137 100644 (file)
@@ -32,7 +32,7 @@ COBJS = board.o main.o command.o \
          cmd_boot.o cmd_bootm.o cmd_cache.o \
          cmd_console.o cmd_eeprom.o cmd_flash.o \
          cmd_ide.o cmd_mem.o cmd_net.o \
-         cmd_nvedit.o cmd_pcmcia.o \
+         cmd_nvedit.o cmd_pcmcia.o cmd_reginfo.o \
          s_record.o dlmalloc.o \
          kgdb.o console.o lists.o devices.o flash.o cmd_i2c.o
 
diff --git a/common/cmd_reginfo.c b/common/cmd_reginfo.c
new file mode 100644 (file)
index 0000000..9286201
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * (C) Copyright 2000
+ * Subodh Nijsure, SkyStream Networks, snijsure@skystream.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <ppcboot.h>
+#include <command.h>
+#include <cmd_boot.h>
+#include <mpc8xx.h>
+
+#if (CONFIG_COMMANDS & CFG_CMD_REGINFO)
+
+void do_reginfo(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
+{
+       volatile immap_t     *immap  = (immap_t *)CFG_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");
+
+       printf("\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");
+
+       printf("\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");
+
+       printf("\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");
+       printf("\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?
+        */
+
+}
+
+#endif /* CFG_CMD_REGINFO */
index 510aa1e14c3c47dfc518fe562b0d8faad334489e..61528d61b72ae0454f996d9b8bc8ec7a02e6e3c0 100644 (file)
@@ -39,6 +39,7 @@
 #include <cmd_ide.h>
 #include <cmd_disk.h>
 #include <cmd_console.h>
+#include <cmd_reginfo.h>
 #include <cmd_pcmcia.h>
 
 #include <cmd_eeprom.h>
@@ -190,6 +191,7 @@ cmd_tbl_t cmd_tbl[] = {
        CMD_TBL_FLINFO
        CMD_TBL_BDINFO
        CMD_TBL_IMINFO
+       CMD_TBL_REGINFO
        CMD_TBL_PCIINFO
        CMD_TBL_IRQINFO
        CMD_TBL_CONINFO
index 12554ffb106ee7da09e0219a1320fcc100308f76..94c4b76d7cb792163287e9c09826af4f9bd4179e 100644 (file)
@@ -52,6 +52,7 @@
 #define        CFG_CMD_RUN     0x00040000      /* run command in env variable  */
 #define        CFG_CMD_ECHO    0x00080000      /* echo arguments               */
 #define        CFG_CMD_I2C     0x00100000      /* I2C serial bus support       */
+#define        CFG_CMD_REGINFO 0x00200000      /* Register dump                */
 
 #define CFG_CMD_ALL    0xFFFFFFFF      /* ALL commands                 */
 
@@ -66,7 +67,8 @@
                        CFG_CMD_EEPROM  | \
                        CFG_CMD_ASKENV  | \
                        CFG_CMD_ECHO    | \
-                       CFG_CMD_I2C     )
+                       CFG_CMD_I2C     | \
+                       CFG_CMD_REGINFO )
 
 /* Default configuration
  */
diff --git a/include/cmd_reginfo.h b/include/cmd_reginfo.h
new file mode 100644 (file)
index 0000000..9231866
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * (C) Copyright 2000
+ * Subodh Nijsure, SkyStream Networks, snijsure@skystream.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef        _CMD_REGINFO_H_
+#define        _CMD_REGINFO_H_
+
+#if (CONFIG_COMMANDS & CFG_CMD_REGINFO)
+
+#define        CMD_TBL_REGINFO MK_CMD_TBL_ENTRY(                                       \
+       "reginfo",      3,      2,      1,      do_reginfo,                     \
+       "reginfo - print register information\n",                               \
+),
+
+void do_reginfo (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]);
+
+#else
+#define CMD_TBL_REGINFO
+#endif /* CFG_CMD_REGINFO */
+
+#endif /* _CMD_REGINFO_H_ */