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 | d79de1d | 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> |
Christophe Leroy | 069fa83 | 2017-07-06 10:23:22 +0200 | [diff] [blame^] | 10 | #if defined(CONFIG_8xx) |
| 11 | #include <mpc8xx.h> |
| 12 | #elif defined(CONFIG_MPC86xx) |
Becky Bruce | b0b3094 | 2008-01-23 16:31:06 -0600 | [diff] [blame] | 13 | extern void mpc86xx_reginfo(void); |
Becky Bruce | ee888da | 2010-06-17 11:37:25 -0500 | [diff] [blame] | 14 | #elif defined(CONFIG_MPC85xx) |
| 15 | extern void mpc85xx_reginfo(void); |
wdenk | e887afc | 2002-08-27 09:44:07 +0000 | [diff] [blame] | 16 | #endif |
Jon Loeliger | 3de8b24 | 2007-06-11 19:01:54 -0500 | [diff] [blame] | 17 | |
Kim Phillips | dc00a68 | 2012-10-29 13:34:31 +0000 | [diff] [blame] | 18 | static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc, |
| 19 | char * const argv[]) |
wdenk | e887afc | 2002-08-27 09:44:07 +0000 | [diff] [blame] | 20 | { |
Christophe Leroy | 069fa83 | 2017-07-06 10:23:22 +0200 | [diff] [blame^] | 21 | #if defined(CONFIG_8xx) |
| 22 | volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; |
| 23 | volatile memctl8xx_t *memctl = &immap->im_memctl; |
| 24 | volatile sysconf8xx_t *sysconf = &immap->im_siu_conf; |
| 25 | volatile sit8xx_t *timers = &immap->im_sit; |
| 26 | |
| 27 | /* Hopefully more PowerPC knowledgable people will add code to display |
| 28 | * other useful registers |
| 29 | */ |
| 30 | |
| 31 | printf ("\nSystem Configuration registers\n" |
| 32 | |
| 33 | "\tIMMR\t0x%08X\n", get_immr(0)); |
| 34 | |
| 35 | printf("\tSIUMCR\t0x%08X", sysconf->sc_siumcr); |
| 36 | printf("\tSYPCR\t0x%08X\n",sysconf->sc_sypcr); |
| 37 | |
| 38 | printf("\tSWT\t0x%08X", sysconf->sc_swt); |
| 39 | printf("\tSWSR\t0x%04X\n", sysconf->sc_swsr); |
| 40 | |
| 41 | printf("\tSIPEND\t0x%08X\tSIMASK\t0x%08X\n", |
| 42 | sysconf->sc_sipend, sysconf->sc_simask); |
| 43 | printf("\tSIEL\t0x%08X\tSIVEC\t0x%08X\n", |
| 44 | sysconf->sc_siel, sysconf->sc_sivec); |
| 45 | printf("\tTESR\t0x%08X\tSDCR\t0x%08X\n", |
| 46 | sysconf->sc_tesr, sysconf->sc_sdcr); |
| 47 | |
| 48 | printf ("Memory Controller Registers\n" |
| 49 | |
| 50 | "\tBR0\t0x%08X\tOR0\t0x%08X \n", memctl->memc_br0, memctl->memc_or0); |
| 51 | printf("\tBR1\t0x%08X\tOR1\t0x%08X \n", memctl->memc_br1, memctl->memc_or1); |
| 52 | printf("\tBR2\t0x%08X\tOR2\t0x%08X \n", memctl->memc_br2, memctl->memc_or2); |
| 53 | printf("\tBR3\t0x%08X\tOR3\t0x%08X \n", memctl->memc_br3, memctl->memc_or3); |
| 54 | printf("\tBR4\t0x%08X\tOR4\t0x%08X \n", memctl->memc_br4, memctl->memc_or4); |
| 55 | printf("\tBR5\t0x%08X\tOR5\t0x%08X \n", memctl->memc_br5, memctl->memc_or5); |
| 56 | printf("\tBR6\t0x%08X\tOR6\t0x%08X \n", memctl->memc_br6, memctl->memc_or6); |
| 57 | printf("\tBR7\t0x%08X\tOR7\t0x%08X \n", memctl->memc_br7, memctl->memc_or7); |
| 58 | printf ("\n" |
| 59 | "\tmamr\t0x%08X\tmbmr\t0x%08X \n", |
| 60 | memctl->memc_mamr, memctl->memc_mbmr ); |
| 61 | printf("\tmstat\t0x%08X\tmptpr\t0x%08X \n", |
| 62 | memctl->memc_mstat, memctl->memc_mptpr ); |
| 63 | printf("\tmdr\t0x%08X \n", memctl->memc_mdr); |
| 64 | |
| 65 | printf ("\nSystem Integration Timers\n" |
| 66 | "\tTBSCR\t0x%08X\tRTCSC\t0x%08X \n", |
| 67 | timers->sit_tbscr, timers->sit_rtcsc); |
| 68 | printf("\tPISCR\t0x%08X \n", timers->sit_piscr); |
| 69 | |
| 70 | /* |
| 71 | * May be some CPM info here? |
| 72 | */ |
| 73 | |
| 74 | #elif defined(CONFIG_MPC86xx) |
Becky Bruce | b0b3094 | 2008-01-23 16:31:06 -0600 | [diff] [blame] | 75 | mpc86xx_reginfo(); |
Mike Frysinger | 030f345 | 2008-02-04 19:26:56 -0500 | [diff] [blame] | 76 | |
Becky Bruce | ee888da | 2010-06-17 11:37:25 -0500 | [diff] [blame] | 77 | #elif defined(CONFIG_MPC85xx) |
| 78 | mpc85xx_reginfo(); |
Sonic Zhang | a99f03e | 2012-08-16 11:56:14 +0800 | [diff] [blame] | 79 | #endif |
Becky Bruce | b0b3094 | 2008-01-23 16:31:06 -0600 | [diff] [blame] | 80 | |
wdenk | e887afc | 2002-08-27 09:44:07 +0000 | [diff] [blame] | 81 | return 0; |
| 82 | } |
| 83 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 84 | /**************************************************/ |
| 85 | |
Mike Frysinger | 030f345 | 2008-02-04 19:26:56 -0500 | [diff] [blame] | 86 | #if defined(CONFIG_CMD_REGINFO) |
wdenk | f287a24 | 2003-07-01 21:06:45 +0000 | [diff] [blame] | 87 | U_BOOT_CMD( |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 88 | reginfo, 2, 1, do_reginfo, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 89 | "print register information", |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 90 | "" |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 91 | ); |
| 92 | #endif |