wdenk | e887afc | 2002-08-27 09:44:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2000 |
| 3 | * Subodh Nijsure, SkyStream Networks, snijsure@skystream.com |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | e887afc | 2002-08-27 09:44:07 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <command.h> |
Heiko Schocher | 5b8e76c | 2017-06-07 17:33:09 +0200 | [diff] [blame] | 10 | #if defined (CONFIG_4xx) |
Niklaus Giger | 78d2a64 | 2009-10-04 20:04:21 +0200 | [diff] [blame] | 11 | extern void ppc4xx_reginfo(void); |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 12 | #elif defined (CONFIG_MPC5200) |
| 13 | #include <mpc5xxx.h> |
Becky Bruce | 4f93f8b | 2008-01-23 16:31:06 -0600 | [diff] [blame] | 14 | #elif defined (CONFIG_MPC86xx) |
| 15 | extern void mpc86xx_reginfo(void); |
Becky Bruce | 199e262 | 2010-06-17 11:37:25 -0500 | [diff] [blame] | 16 | #elif defined(CONFIG_MPC85xx) |
| 17 | extern void mpc85xx_reginfo(void); |
wdenk | e887afc | 2002-08-27 09:44:07 +0000 | [diff] [blame] | 18 | #endif |
Jon Loeliger | 65c450b | 2007-06-11 19:01:54 -0500 | [diff] [blame] | 19 | |
Kim Phillips | 088f1b1 | 2012-10-29 13:34:31 +0000 | [diff] [blame] | 20 | static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc, |
| 21 | char * const argv[]) |
wdenk | e887afc | 2002-08-27 09:44:07 +0000 | [diff] [blame] | 22 | { |
Heiko Schocher | 5b8e76c | 2017-06-07 17:33:09 +0200 | [diff] [blame] | 23 | #if defined (CONFIG_4xx) |
Niklaus Giger | 78d2a64 | 2009-10-04 20:04:21 +0200 | [diff] [blame] | 24 | ppc4xx_reginfo(); |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 25 | #elif defined(CONFIG_MPC5200) |
| 26 | puts ("\nMPC5200 registers\n"); |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 27 | printf ("MBAR=%08x\n", CONFIG_SYS_MBAR); |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 28 | puts ("Memory map registers\n"); |
Wolfgang Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 29 | printf ("\tCS0: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 30 | *(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 Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 34 | printf ("\tCS1: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 35 | *(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 Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 39 | printf ("\tCS2: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 40 | *(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 Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 44 | printf ("\tCS3: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 45 | *(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 Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 49 | printf ("\tCS4: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 50 | *(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 Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 54 | printf ("\tCS5: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 55 | *(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 Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 59 | printf ("\tCS6: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 60 | *(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 Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 64 | printf ("\tCS7: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 65 | *(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 Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 69 | printf ("\tBOOTCS: start %08lX\tstop %08lX\tconfig %08lX\ten %d\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 70 | *(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 Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 74 | printf ("\tSDRAMCS0: %08lX\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 75 | *(volatile ulong*)MPC5XXX_SDRAM_CS0CFG); |
Wolfgang Denk | 9b55a25 | 2008-07-11 01:16:00 +0200 | [diff] [blame] | 76 | printf ("\tSDRAMCS1: %08lX\n", |
wdenk | 56523f1 | 2004-07-11 17:40:54 +0000 | [diff] [blame] | 77 | *(volatile ulong*)MPC5XXX_SDRAM_CS1CFG); |
Becky Bruce | 4f93f8b | 2008-01-23 16:31:06 -0600 | [diff] [blame] | 78 | #elif defined(CONFIG_MPC86xx) |
| 79 | mpc86xx_reginfo(); |
Mike Frysinger | 97c26e0 | 2008-02-04 19:26:56 -0500 | [diff] [blame] | 80 | |
Becky Bruce | 199e262 | 2010-06-17 11:37:25 -0500 | [diff] [blame] | 81 | #elif defined(CONFIG_MPC85xx) |
| 82 | mpc85xx_reginfo(); |
Sonic Zhang | a2979dc | 2012-08-16 11:56:14 +0800 | [diff] [blame] | 83 | #endif |
Becky Bruce | 4f93f8b | 2008-01-23 16:31:06 -0600 | [diff] [blame] | 84 | |
wdenk | e887afc | 2002-08-27 09:44:07 +0000 | [diff] [blame] | 85 | return 0; |
| 86 | } |
| 87 | |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 88 | /**************************************************/ |
| 89 | |
Mike Frysinger | 97c26e0 | 2008-02-04 19:26:56 -0500 | [diff] [blame] | 90 | #if defined(CONFIG_CMD_REGINFO) |
wdenk | 0d49839 | 2003-07-01 21:06:45 +0000 | [diff] [blame] | 91 | U_BOOT_CMD( |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 92 | reginfo, 2, 1, do_reginfo, |
Peter Tyser | 2fb2604 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 93 | "print register information", |
Wolfgang Denk | a89c33d | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 94 | "" |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 95 | ); |
| 96 | #endif |