Blame view
common/cmd_reginfo.c
9.25 KB
e887afc9d Initial revision |
1 2 3 4 |
/* * (C) Copyright 2000 * Subodh Nijsure, SkyStream Networks, snijsure@skystream.com * |
1a4596601 Add GPL-2.0+ SPDX... |
5 |
* SPDX-License-Identifier: GPL-2.0+ |
e887afc9d Initial revision |
6 7 8 9 |
*/ #include <common.h> #include <command.h> |
e887afc9d Initial revision |
10 11 |
#if defined(CONFIG_8xx) #include <mpc8xx.h> |
78d2a6413 ppc4xx: Rework cm... |
12 13 |
#elif defined (CONFIG_4xx) extern void ppc4xx_reginfo(void); |
0db5bca80 * Patch by Martin... |
14 15 |
#elif defined (CONFIG_5xx) #include <mpc5xx.h> |
56523f128 * Patch by Martin... |
16 17 |
#elif defined (CONFIG_MPC5200) #include <mpc5xxx.h> |
4f93f8b1a 86xx: Add reginfo... |
18 19 |
#elif defined (CONFIG_MPC86xx) extern void mpc86xx_reginfo(void); |
199e262eb mpc85xx: Add regi... |
20 21 |
#elif defined(CONFIG_MPC85xx) extern void mpc85xx_reginfo(void); |
e887afc9d Initial revision |
22 |
#endif |
65c450b47 common/cmd_[i-z]*... |
23 |
|
088f1b199 common/cmd_*.c: s... |
24 25 |
static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
e887afc9d Initial revision |
26 27 |
{ #if defined(CONFIG_8xx) |
6d0f6bcf3 rename CFG_ macro... |
28 |
volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; |
e887afc9d Initial revision |
29 30 31 32 33 34 35 |
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 */ |
4b9206ed5 * Patches by Thom... |
36 37 38 |
printf (" System Configuration registers " |
e887afc9d Initial revision |
39 |
|
4b9206ed5 * Patches by Thom... |
40 41 |
"\tIMMR\t0x%08X ", get_immr(0)); |
e887afc9d Initial revision |
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
printf("\tSIUMCR\t0x%08X", sysconf->sc_siumcr); printf("\tSYPCR\t0x%08X ",sysconf->sc_sypcr); printf("\tSWT\t0x%08X", sysconf->sc_swt); printf("\tSWSR\t0x%04X ", sysconf->sc_swsr); printf("\tSIPEND\t0x%08X\tSIMASK\t0x%08X ", sysconf->sc_sipend, sysconf->sc_simask); printf("\tSIEL\t0x%08X\tSIVEC\t0x%08X ", sysconf->sc_siel, sysconf->sc_sivec); printf("\tTESR\t0x%08X\tSDCR\t0x%08X ", sysconf->sc_tesr, sysconf->sc_sdcr); |
4b9206ed5 * Patches by Thom... |
60 61 |
printf ("Memory Controller Registers " |
e887afc9d Initial revision |
62 |
|
4b9206ed5 * Patches by Thom... |
63 64 |
"\tBR0\t0x%08X\tOR0\t0x%08X ", memctl->memc_br0, memctl->memc_or0); |
e887afc9d Initial revision |
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
printf("\tBR1\t0x%08X\tOR1\t0x%08X ", memctl->memc_br1, memctl->memc_or1); printf("\tBR2\t0x%08X\tOR2\t0x%08X ", memctl->memc_br2, memctl->memc_or2); printf("\tBR3\t0x%08X\tOR3\t0x%08X ", memctl->memc_br3, memctl->memc_or3); printf("\tBR4\t0x%08X\tOR4\t0x%08X ", memctl->memc_br4, memctl->memc_or4); printf("\tBR5\t0x%08X\tOR5\t0x%08X ", memctl->memc_br5, memctl->memc_or5); printf("\tBR6\t0x%08X\tOR6\t0x%08X ", memctl->memc_br6, memctl->memc_or6); printf("\tBR7\t0x%08X\tOR7\t0x%08X ", memctl->memc_br7, memctl->memc_or7); |
4b9206ed5 * Patches by Thom... |
79 80 81 82 |
printf (" " "\tmamr\t0x%08X\tmbmr\t0x%08X ", |
e887afc9d Initial revision |
83 84 85 86 87 88 |
memctl->memc_mamr, memctl->memc_mbmr ); printf("\tmstat\t0x%08X\tmptpr\t0x%08X ", memctl->memc_mstat, memctl->memc_mptpr ); printf("\tmdr\t0x%08X ", memctl->memc_mdr); |
4b9206ed5 * Patches by Thom... |
89 90 91 92 93 |
printf (" System Integration Timers " "\tTBSCR\t0x%08X\tRTCSC\t0x%08X ", |
e887afc9d Initial revision |
94 95 96 97 98 99 100 |
timers->sit_tbscr, timers->sit_rtcsc); printf("\tPISCR\t0x%08X ", timers->sit_piscr); /* * May be some CPM info here? */ |
78d2a6413 ppc4xx: Rework cm... |
101 102 |
#elif defined (CONFIG_4xx) ppc4xx_reginfo(); |
0db5bca80 * Patch by Martin... |
103 |
#elif defined(CONFIG_5xx) |
e887afc9d Initial revision |
104 |
|
6d0f6bcf3 rename CFG_ macro... |
105 |
volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; |
0db5bca80 * Patch by Martin... |
106 107 108 109 110 |
volatile memctl5xx_t *memctl = &immap->im_memctl; volatile sysconf5xx_t *sysconf = &immap->im_siu_conf; volatile sit5xx_t *timers = &immap->im_sit; volatile car5xx_t *car = &immap->im_clkrst; volatile uimb5xx_t *uimb = &immap->im_uimb; |
4b9206ed5 * Patches by Thom... |
111 112 113 |
puts (" System Configuration registers "); |
0db5bca80 * Patch by Martin... |
114 115 116 117 118 119 120 121 122 123 |
printf("\tIMMR\t0x%08X\tSIUMCR\t0x%08X ", get_immr(0), sysconf->sc_siumcr); printf("\tSYPCR\t0x%08X\tSWSR\t0x%04X " ,sysconf->sc_sypcr, sysconf->sc_swsr); printf("\tSIPEND\t0x%08X\tSIMASK\t0x%08X ", sysconf->sc_sipend, sysconf->sc_simask); printf("\tSIEL\t0x%08X\tSIVEC\t0x%08X ", sysconf->sc_siel, sysconf->sc_sivec); printf("\tTESR\t0x%08X ", sysconf->sc_tesr); |
4b9206ed5 * Patches by Thom... |
124 125 126 |
puts (" Memory Controller Registers "); |
0db5bca80 * Patch by Martin... |
127 128 129 130 131 132 133 134 135 136 137 138 |
printf("\tBR0\t0x%08X\tOR0\t0x%08X ", memctl->memc_br0, memctl->memc_or0); printf("\tBR1\t0x%08X\tOR1\t0x%08X ", memctl->memc_br1, memctl->memc_or1); printf("\tBR2\t0x%08X\tOR2\t0x%08X ", memctl->memc_br2, memctl->memc_or2); printf("\tBR3\t0x%08X\tOR3\t0x%08X ", memctl->memc_br3, memctl->memc_or3); printf("\tDMBR\t0x%08X\tDMOR\t0x%08X ", memctl->memc_dmbr, memctl->memc_dmor ); printf("\tMSTAT\t0x%08X ", memctl->memc_mstat); |
4b9206ed5 * Patches by Thom... |
139 140 141 |
puts (" System Integration Timers "); |
0db5bca80 * Patch by Martin... |
142 143 144 145 |
printf("\tTBSCR\t0x%08X\tRTCSC\t0x%08X ", timers->sit_tbscr, timers->sit_rtcsc); printf("\tPISCR\t0x%08X ", timers->sit_piscr); |
4b9206ed5 * Patches by Thom... |
146 147 148 |
puts (" Clocks and Reset "); |
0db5bca80 * Patch by Martin... |
149 150 |
printf("\tSCCR\t0x%08X\tPLPRCR\t0x%08X ", car->car_sccr, car->car_plprcr); |
4b9206ed5 * Patches by Thom... |
151 152 153 |
puts (" U-Bus to IMB3 Bus Interface "); |
0db5bca80 * Patch by Martin... |
154 155 |
printf("\tUMCR\t0x%08X\tUIPEND\t0x%08X ", uimb->uimb_umcr, uimb->uimb_uipend); |
4b9206ed5 * Patches by Thom... |
156 157 158 |
puts (" "); |
56523f128 * Patch by Martin... |
159 160 161 162 163 |
#elif defined(CONFIG_MPC5200) puts (" MPC5200 registers "); |
6d0f6bcf3 rename CFG_ macro... |
164 165 |
printf ("MBAR=%08x ", CONFIG_SYS_MBAR); |
56523f128 * Patch by Martin... |
166 167 |
puts ("Memory map registers "); |
9b55a2536 Fix some more pri... |
168 169 |
printf ("\tCS0: start %08lX\tstop %08lX\tconfig %08lX\ten %d ", |
56523f128 * Patch by Martin... |
170 171 172 173 |
*(volatile ulong*)MPC5XXX_CS0_START, *(volatile ulong*)MPC5XXX_CS0_STOP, *(volatile ulong*)MPC5XXX_CS0_CFG, (*(volatile ulong*)MPC5XXX_ADDECR & 0x00010000) ? 1 : 0); |
9b55a2536 Fix some more pri... |
174 175 |
printf ("\tCS1: start %08lX\tstop %08lX\tconfig %08lX\ten %d ", |
56523f128 * Patch by Martin... |
176 177 178 179 |
*(volatile ulong*)MPC5XXX_CS1_START, *(volatile ulong*)MPC5XXX_CS1_STOP, *(volatile ulong*)MPC5XXX_CS1_CFG, (*(volatile ulong*)MPC5XXX_ADDECR & 0x00020000) ? 1 : 0); |
9b55a2536 Fix some more pri... |
180 181 |
printf ("\tCS2: start %08lX\tstop %08lX\tconfig %08lX\ten %d ", |
56523f128 * Patch by Martin... |
182 183 184 185 |
*(volatile ulong*)MPC5XXX_CS2_START, *(volatile ulong*)MPC5XXX_CS2_STOP, *(volatile ulong*)MPC5XXX_CS2_CFG, (*(volatile ulong*)MPC5XXX_ADDECR & 0x00040000) ? 1 : 0); |
9b55a2536 Fix some more pri... |
186 187 |
printf ("\tCS3: start %08lX\tstop %08lX\tconfig %08lX\ten %d ", |
56523f128 * Patch by Martin... |
188 189 190 191 |
*(volatile ulong*)MPC5XXX_CS3_START, *(volatile ulong*)MPC5XXX_CS3_STOP, *(volatile ulong*)MPC5XXX_CS3_CFG, (*(volatile ulong*)MPC5XXX_ADDECR & 0x00080000) ? 1 : 0); |
9b55a2536 Fix some more pri... |
192 193 |
printf ("\tCS4: start %08lX\tstop %08lX\tconfig %08lX\ten %d ", |
56523f128 * Patch by Martin... |
194 195 196 197 |
*(volatile ulong*)MPC5XXX_CS4_START, *(volatile ulong*)MPC5XXX_CS4_STOP, *(volatile ulong*)MPC5XXX_CS4_CFG, (*(volatile ulong*)MPC5XXX_ADDECR & 0x00100000) ? 1 : 0); |
9b55a2536 Fix some more pri... |
198 199 |
printf ("\tCS5: start %08lX\tstop %08lX\tconfig %08lX\ten %d ", |
56523f128 * Patch by Martin... |
200 201 202 203 |
*(volatile ulong*)MPC5XXX_CS5_START, *(volatile ulong*)MPC5XXX_CS5_STOP, *(volatile ulong*)MPC5XXX_CS5_CFG, (*(volatile ulong*)MPC5XXX_ADDECR & 0x00200000) ? 1 : 0); |
9b55a2536 Fix some more pri... |
204 205 |
printf ("\tCS6: start %08lX\tstop %08lX\tconfig %08lX\ten %d ", |
56523f128 * Patch by Martin... |
206 207 208 209 |
*(volatile ulong*)MPC5XXX_CS6_START, *(volatile ulong*)MPC5XXX_CS6_STOP, *(volatile ulong*)MPC5XXX_CS6_CFG, (*(volatile ulong*)MPC5XXX_ADDECR & 0x04000000) ? 1 : 0); |
9b55a2536 Fix some more pri... |
210 211 |
printf ("\tCS7: start %08lX\tstop %08lX\tconfig %08lX\ten %d ", |
56523f128 * Patch by Martin... |
212 213 214 215 |
*(volatile ulong*)MPC5XXX_CS7_START, *(volatile ulong*)MPC5XXX_CS7_STOP, *(volatile ulong*)MPC5XXX_CS7_CFG, (*(volatile ulong*)MPC5XXX_ADDECR & 0x08000000) ? 1 : 0); |
9b55a2536 Fix some more pri... |
216 217 |
printf ("\tBOOTCS: start %08lX\tstop %08lX\tconfig %08lX\ten %d ", |
56523f128 * Patch by Martin... |
218 219 220 221 |
*(volatile ulong*)MPC5XXX_BOOTCS_START, *(volatile ulong*)MPC5XXX_BOOTCS_STOP, *(volatile ulong*)MPC5XXX_BOOTCS_CFG, (*(volatile ulong*)MPC5XXX_ADDECR & 0x02000000) ? 1 : 0); |
9b55a2536 Fix some more pri... |
222 223 |
printf ("\tSDRAMCS0: %08lX ", |
56523f128 * Patch by Martin... |
224 |
*(volatile ulong*)MPC5XXX_SDRAM_CS0CFG); |
9b55a2536 Fix some more pri... |
225 226 |
printf ("\tSDRAMCS1: %08lX ", |
56523f128 * Patch by Martin... |
227 |
*(volatile ulong*)MPC5XXX_SDRAM_CS1CFG); |
4f93f8b1a 86xx: Add reginfo... |
228 229 |
#elif defined(CONFIG_MPC86xx) mpc86xx_reginfo(); |
97c26e006 add Blackfin-spec... |
230 |
|
199e262eb mpc85xx: Add regi... |
231 232 |
#elif defined(CONFIG_MPC85xx) mpc85xx_reginfo(); |
97c26e006 add Blackfin-spec... |
233 234 235 236 |
#elif defined(CONFIG_BLACKFIN) puts(" System Configuration registers "); |
a2979dcdb blackfin: bf60x: ... |
237 |
#ifndef __ADSPBF60x__ |
97c26e006 add Blackfin-spec... |
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
puts(" PLL Registers "); printf("\tPLL_DIV: 0x%04x PLL_CTL: 0x%04x ", bfin_read_PLL_DIV(), bfin_read_PLL_CTL()); printf("\tPLL_STAT: 0x%04x PLL_LOCKCNT: 0x%04x ", bfin_read_PLL_STAT(), bfin_read_PLL_LOCKCNT()); printf("\tVR_CTL: 0x%04x ", bfin_read_VR_CTL()); puts(" EBIU AMC Registers "); printf("\tEBIU_AMGCTL: 0x%04x ", bfin_read_EBIU_AMGCTL()); printf("\tEBIU_AMBCTL0: 0x%08x EBIU_AMBCTL1: 0x%08x ", bfin_read_EBIU_AMBCTL0(), bfin_read_EBIU_AMBCTL1()); # ifdef EBIU_MODE printf("\tEBIU_MBSCTL: 0x%08x EBIU_ARBSTAT: 0x%08x ", bfin_read_EBIU_MBSCTL(), bfin_read_EBIU_ARBSTAT()); printf("\tEBIU_MODE: 0x%08x EBIU_FCTL: 0x%08x ", bfin_read_EBIU_MODE(), bfin_read_EBIU_FCTL()); # endif # ifdef EBIU_RSTCTL puts(" EBIU DDR Registers "); printf("\tEBIU_DDRCTL0: 0x%08x EBIU_DDRCTL1: 0x%08x ", bfin_read_EBIU_DDRCTL0(), bfin_read_EBIU_DDRCTL1()); printf("\tEBIU_DDRCTL2: 0x%08x EBIU_DDRCTL3: 0x%08x ", bfin_read_EBIU_DDRCTL2(), bfin_read_EBIU_DDRCTL3()); printf("\tEBIU_DDRQUE: 0x%08x EBIU_RSTCTL 0x%04x ", bfin_read_EBIU_DDRQUE(), bfin_read_EBIU_RSTCTL()); printf("\tEBIU_ERRADD: 0x%08x EBIU_ERRMST: 0x%04x ", bfin_read_EBIU_ERRADD(), bfin_read_EBIU_ERRMST()); # else puts(" EBIU SDC Registers "); printf("\tEBIU_SDRRC: 0x%04x EBIU_SDBCTL: 0x%04x ", bfin_read_EBIU_SDRRC(), bfin_read_EBIU_SDBCTL()); printf("\tEBIU_SDSTAT: 0x%04x EBIU_SDGCTL: 0x%08x ", bfin_read_EBIU_SDSTAT(), bfin_read_EBIU_SDGCTL()); # endif |
a2979dcdb blackfin: bf60x: ... |
294 295 296 297 298 299 300 301 302 303 |
#else puts(" CGU Registers "); printf("\tCGU_DIV: 0x%08x CGU_CTL: 0x%08x ", bfin_read_CGU_DIV(), bfin_read_CGU_CTL()); printf("\tCGU_STAT: 0x%08x CGU_LOCKCNT: 0x%08x ", bfin_read_CGU_STAT(), bfin_read_CGU_CLKOUTSEL()); |
97c26e006 add Blackfin-spec... |
304 |
|
a2979dcdb blackfin: bf60x: ... |
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
puts(" SMC DDR Registers "); printf("\tDDR_CFG: 0x%08x DDR_TR0: 0x%08x ", bfin_read_DMC0_CFG(), bfin_read_DMC0_TR0()); printf("\tDDR_TR1: 0x%08x DDR_TR2: 0x%08x ", bfin_read_DMC0_TR1(), bfin_read_DMC0_TR2()); printf("\tDDR_MR: 0x%08x DDR_EMR1: 0x%08x ", bfin_read_DMC0_MR(), bfin_read_DMC0_EMR1()); printf("\tDDR_CTL: 0x%08x DDR_STAT: 0x%08x ", bfin_read_DMC0_CTL(), bfin_read_DMC0_STAT()); printf("\tDDR_DLLCTL:0x%08x ", bfin_read_DMC0_DLLCTL()); #endif |
9e04a8138 Merge branch 'mas... |
323 |
#endif /* CONFIG_BLACKFIN */ |
4f93f8b1a 86xx: Add reginfo... |
324 |
|
e887afc9d Initial revision |
325 326 |
return 0; } |
8bde7f776 * Code cleanup: |
327 |
/**************************************************/ |
97c26e006 add Blackfin-spec... |
328 |
#if defined(CONFIG_CMD_REGINFO) |
0d4983930 Patch by Kenneth ... |
329 |
U_BOOT_CMD( |
53677ef18 Big white-space c... |
330 |
reginfo, 2, 1, do_reginfo, |
2fb2604d5 Command usage cle... |
331 |
"print register information", |
a89c33db9 General help mess... |
332 |
"" |
8bde7f776 * Code cleanup: |
333 334 |
); #endif |