blob: 6918a9edf552f1a5efaf71223029e8f3a55611ca [file] [log] [blame]
wdenke887afc2002-08-27 09:44:07 +00001/*
2 * (C) Copyright 2000
3 * Subodh Nijsure, SkyStream Networks, snijsure@skystream.com
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenke887afc2002-08-27 09:44:07 +00006 */
7
8#include <common.h>
9#include <command.h>
Heiko Schocher5b8e76c2017-06-07 17:33:09 +020010#if defined (CONFIG_4xx)
Niklaus Giger78d2a642009-10-04 20:04:21 +020011extern void ppc4xx_reginfo(void);
wdenk56523f12004-07-11 17:40:54 +000012#elif defined (CONFIG_MPC5200)
13#include <mpc5xxx.h>
Becky Bruce4f93f8b2008-01-23 16:31:06 -060014#elif defined (CONFIG_MPC86xx)
15extern void mpc86xx_reginfo(void);
Becky Bruce199e2622010-06-17 11:37:25 -050016#elif defined(CONFIG_MPC85xx)
17extern void mpc85xx_reginfo(void);
wdenke887afc2002-08-27 09:44:07 +000018#endif
Jon Loeliger65c450b2007-06-11 19:01:54 -050019
Kim Phillips088f1b12012-10-29 13:34:31 +000020static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc,
21 char * const argv[])
wdenke887afc2002-08-27 09:44:07 +000022{
Heiko Schocher5b8e76c2017-06-07 17:33:09 +020023#if defined (CONFIG_4xx)
Niklaus Giger78d2a642009-10-04 20:04:21 +020024 ppc4xx_reginfo();
wdenk56523f12004-07-11 17:40:54 +000025#elif defined(CONFIG_MPC5200)
26 puts ("\nMPC5200 registers\n");
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020027 printf ("MBAR=%08x\n", CONFIG_SYS_MBAR);
wdenk56523f12004-07-11 17:40:54 +000028 puts ("Memory map registers\n");
Wolfgang Denk9b55a252008-07-11 01:16:00 +020029 printf ("\tCS0: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
wdenk56523f12004-07-11 17:40:54 +000030 *(volatile ulong*)MPC5XXX_CS0_START,
31 *(volatile ulong*)MPC5XXX_CS0_STOP,
32 *(volatile ulong*)MPC5XXX_CS0_CFG,
33 (*(volatile ulong*)MPC5XXX_ADDECR & 0x00010000) ? 1 : 0);
Wolfgang Denk9b55a252008-07-11 01:16:00 +020034 printf ("\tCS1: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
wdenk56523f12004-07-11 17:40:54 +000035 *(volatile ulong*)MPC5XXX_CS1_START,
36 *(volatile ulong*)MPC5XXX_CS1_STOP,
37 *(volatile ulong*)MPC5XXX_CS1_CFG,
38 (*(volatile ulong*)MPC5XXX_ADDECR & 0x00020000) ? 1 : 0);
Wolfgang Denk9b55a252008-07-11 01:16:00 +020039 printf ("\tCS2: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
wdenk56523f12004-07-11 17:40:54 +000040 *(volatile ulong*)MPC5XXX_CS2_START,
41 *(volatile ulong*)MPC5XXX_CS2_STOP,
42 *(volatile ulong*)MPC5XXX_CS2_CFG,
43 (*(volatile ulong*)MPC5XXX_ADDECR & 0x00040000) ? 1 : 0);
Wolfgang Denk9b55a252008-07-11 01:16:00 +020044 printf ("\tCS3: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
wdenk56523f12004-07-11 17:40:54 +000045 *(volatile ulong*)MPC5XXX_CS3_START,
46 *(volatile ulong*)MPC5XXX_CS3_STOP,
47 *(volatile ulong*)MPC5XXX_CS3_CFG,
48 (*(volatile ulong*)MPC5XXX_ADDECR & 0x00080000) ? 1 : 0);
Wolfgang Denk9b55a252008-07-11 01:16:00 +020049 printf ("\tCS4: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
wdenk56523f12004-07-11 17:40:54 +000050 *(volatile ulong*)MPC5XXX_CS4_START,
51 *(volatile ulong*)MPC5XXX_CS4_STOP,
52 *(volatile ulong*)MPC5XXX_CS4_CFG,
53 (*(volatile ulong*)MPC5XXX_ADDECR & 0x00100000) ? 1 : 0);
Wolfgang Denk9b55a252008-07-11 01:16:00 +020054 printf ("\tCS5: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
wdenk56523f12004-07-11 17:40:54 +000055 *(volatile ulong*)MPC5XXX_CS5_START,
56 *(volatile ulong*)MPC5XXX_CS5_STOP,
57 *(volatile ulong*)MPC5XXX_CS5_CFG,
58 (*(volatile ulong*)MPC5XXX_ADDECR & 0x00200000) ? 1 : 0);
Wolfgang Denk9b55a252008-07-11 01:16:00 +020059 printf ("\tCS6: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
wdenk56523f12004-07-11 17:40:54 +000060 *(volatile ulong*)MPC5XXX_CS6_START,
61 *(volatile ulong*)MPC5XXX_CS6_STOP,
62 *(volatile ulong*)MPC5XXX_CS6_CFG,
63 (*(volatile ulong*)MPC5XXX_ADDECR & 0x04000000) ? 1 : 0);
Wolfgang Denk9b55a252008-07-11 01:16:00 +020064 printf ("\tCS7: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
wdenk56523f12004-07-11 17:40:54 +000065 *(volatile ulong*)MPC5XXX_CS7_START,
66 *(volatile ulong*)MPC5XXX_CS7_STOP,
67 *(volatile ulong*)MPC5XXX_CS7_CFG,
68 (*(volatile ulong*)MPC5XXX_ADDECR & 0x08000000) ? 1 : 0);
Wolfgang Denk9b55a252008-07-11 01:16:00 +020069 printf ("\tBOOTCS: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n",
wdenk56523f12004-07-11 17:40:54 +000070 *(volatile ulong*)MPC5XXX_BOOTCS_START,
71 *(volatile ulong*)MPC5XXX_BOOTCS_STOP,
72 *(volatile ulong*)MPC5XXX_BOOTCS_CFG,
73 (*(volatile ulong*)MPC5XXX_ADDECR & 0x02000000) ? 1 : 0);
Wolfgang Denk9b55a252008-07-11 01:16:00 +020074 printf ("\tSDRAMCS0: %08lX\n",
wdenk56523f12004-07-11 17:40:54 +000075 *(volatile ulong*)MPC5XXX_SDRAM_CS0CFG);
Wolfgang Denk9b55a252008-07-11 01:16:00 +020076 printf ("\tSDRAMCS1: %08lX\n",
wdenk56523f12004-07-11 17:40:54 +000077 *(volatile ulong*)MPC5XXX_SDRAM_CS1CFG);
Becky Bruce4f93f8b2008-01-23 16:31:06 -060078#elif defined(CONFIG_MPC86xx)
79 mpc86xx_reginfo();
Mike Frysinger97c26e02008-02-04 19:26:56 -050080
Becky Bruce199e2622010-06-17 11:37:25 -050081#elif defined(CONFIG_MPC85xx)
82 mpc85xx_reginfo();
Sonic Zhanga2979dc2012-08-16 11:56:14 +080083#endif
Becky Bruce4f93f8b2008-01-23 16:31:06 -060084
wdenke887afc2002-08-27 09:44:07 +000085 return 0;
86}
87
wdenk8bde7f72003-06-27 21:31:46 +000088 /**************************************************/
89
Mike Frysinger97c26e02008-02-04 19:26:56 -050090#if defined(CONFIG_CMD_REGINFO)
wdenk0d498392003-07-01 21:06:45 +000091U_BOOT_CMD(
Wolfgang Denk53677ef2008-05-20 16:00:29 +020092 reginfo, 2, 1, do_reginfo,
Peter Tyser2fb26042009-01-27 18:03:12 -060093 "print register information",
Wolfgang Denka89c33d2009-05-24 17:06:54 +020094 ""
wdenk8bde7f72003-06-27 21:31:46 +000095);
96#endif