xref: /rk3399_rockchip-uboot/arch/powerpc/cpu/mpc8xx/reginfo.c (revision ba3da7348ac9aaa1cc0a9ccbc8b3c9367d87ca4b)
1d7949665SChristophe Leroy /*
2d7949665SChristophe Leroy  * (C) Copyright 2000
3d7949665SChristophe Leroy  * Subodh Nijsure, SkyStream Networks, snijsure@skystream.com
4d7949665SChristophe Leroy  *
5d7949665SChristophe Leroy  * SPDX-License-Identifier:	GPL-2.0+
6d7949665SChristophe Leroy  */
7d7949665SChristophe Leroy 
8d7949665SChristophe Leroy #include <common.h>
9d7949665SChristophe Leroy #include <mpc8xx.h>
10*ba3da734SChristophe Leroy #include <asm/io.h>
11d7949665SChristophe Leroy 
12d7949665SChristophe Leroy void mpc8xx_reginfo(void)
13d7949665SChristophe Leroy {
14*ba3da734SChristophe Leroy 	immap_t __iomem     *immap  = (immap_t __iomem *)CONFIG_SYS_IMMR;
15*ba3da734SChristophe Leroy 	memctl8xx_t __iomem *memctl = &immap->im_memctl;
16*ba3da734SChristophe Leroy 	sysconf8xx_t __iomem *sysconf = &immap->im_siu_conf;
17*ba3da734SChristophe Leroy 	sit8xx_t __iomem *timers = &immap->im_sit;
18d7949665SChristophe Leroy 
19d7949665SChristophe Leroy 	/* Hopefully more PowerPC  knowledgable people will add code to display
20d7949665SChristophe Leroy 	 * other useful registers
21d7949665SChristophe Leroy 	 */
22d7949665SChristophe Leroy 
23d7949665SChristophe Leroy 	printf ("\nSystem Configuration registers\n"
24d7949665SChristophe Leroy 		"\tIMMR\t0x%08X\n", get_immr(0));
25d7949665SChristophe Leroy 
26*ba3da734SChristophe Leroy 	printf("\tSIUMCR\t0x%08X", in_be32(&sysconf->sc_siumcr));
27*ba3da734SChristophe Leroy 	printf("\tSYPCR\t0x%08X\n", in_be32(&sysconf->sc_sypcr));
28d7949665SChristophe Leroy 
29*ba3da734SChristophe Leroy 	printf("\tSWT\t0x%08X", in_be32(&sysconf->sc_swt));
30*ba3da734SChristophe Leroy 	printf("\tSWSR\t0x%04X\n", in_be16(&sysconf->sc_swsr));
31d7949665SChristophe Leroy 
32d7949665SChristophe Leroy 	printf("\tSIPEND\t0x%08X\tSIMASK\t0x%08X\n",
33*ba3da734SChristophe Leroy 	       in_be32(&sysconf->sc_sipend), in_be32(&sysconf->sc_simask));
34d7949665SChristophe Leroy 	printf("\tSIEL\t0x%08X\tSIVEC\t0x%08X\n",
35*ba3da734SChristophe Leroy 	       in_be32(&sysconf->sc_siel), in_be32(&sysconf->sc_sivec));
36d7949665SChristophe Leroy 	printf("\tTESR\t0x%08X\tSDCR\t0x%08X\n",
37*ba3da734SChristophe Leroy 	       in_be32(&sysconf->sc_tesr), in_be32(&sysconf->sc_sdcr));
38d7949665SChristophe Leroy 
39*ba3da734SChristophe Leroy 	printf("Memory Controller Registers\n");
40*ba3da734SChristophe Leroy 	printf("\tBR0\t0x%08X\tOR0\t0x%08X\n", in_be32(&memctl->memc_br0),
41*ba3da734SChristophe Leroy 	       in_be32(&memctl->memc_or0));
42*ba3da734SChristophe Leroy 	printf("\tBR1\t0x%08X\tOR1\t0x%08X\n", in_be32(&memctl->memc_br1),
43*ba3da734SChristophe Leroy 	       in_be32(&memctl->memc_or1));
44*ba3da734SChristophe Leroy 	printf("\tBR2\t0x%08X\tOR2\t0x%08X\n", in_be32(&memctl->memc_br2),
45*ba3da734SChristophe Leroy 	       in_be32(&memctl->memc_or2));
46*ba3da734SChristophe Leroy 	printf("\tBR3\t0x%08X\tOR3\t0x%08X\n", in_be32(&memctl->memc_br3),
47*ba3da734SChristophe Leroy 	       in_be32(&memctl->memc_or3));
48*ba3da734SChristophe Leroy 	printf("\tBR4\t0x%08X\tOR4\t0x%08X\n", in_be32(&memctl->memc_br4),
49*ba3da734SChristophe Leroy 	       in_be32(&memctl->memc_or4));
50*ba3da734SChristophe Leroy 	printf("\tBR5\t0x%08X\tOR5\t0x%08X\n", in_be32(&memctl->memc_br5),
51*ba3da734SChristophe Leroy 	       in_be32(&memctl->memc_or5));
52*ba3da734SChristophe Leroy 	printf("\tBR6\t0x%08X\tOR6\t0x%08X\n", in_be32(&memctl->memc_br6),
53*ba3da734SChristophe Leroy 	       in_be32(&memctl->memc_or6));
54*ba3da734SChristophe Leroy 	printf("\tBR7\t0x%08X\tOR7\t0x%08X\n", in_be32(&memctl->memc_br7),
55*ba3da734SChristophe Leroy 	       in_be32(&memctl->memc_or7));
56*ba3da734SChristophe Leroy 	printf("\n\tmamr\t0x%08X\tmbmr\t0x%08X\n", in_be32(&memctl->memc_mamr),
57*ba3da734SChristophe Leroy 	       in_be32(&memctl->memc_mbmr));
58*ba3da734SChristophe Leroy 	printf("\tmstat\t0x%04X\tmptpr\t0x%04X\n", in_be16(&memctl->memc_mstat),
59*ba3da734SChristophe Leroy 	       in_be16(&memctl->memc_mptpr));
60*ba3da734SChristophe Leroy 	printf("\tmdr\t0x%08X\n", in_be32(&memctl->memc_mdr));
61d7949665SChristophe Leroy 
62*ba3da734SChristophe Leroy 	printf("\nSystem Integration Timers\n");
63*ba3da734SChristophe Leroy 	printf("\tTBSCR\t0x%04X\tRTCSC\t0x%04X\n",
64*ba3da734SChristophe Leroy 	       in_be16(&timers->sit_tbscr), in_be16(&timers->sit_rtcsc));
65*ba3da734SChristophe Leroy 	printf("\tPISCR\t0x%04X\n", in_be16(&timers->sit_piscr));
66d7949665SChristophe Leroy 
67d7949665SChristophe Leroy 	/*
68d7949665SChristophe Leroy 	 * May be some CPM info here?
69d7949665SChristophe Leroy 	 */
70d7949665SChristophe Leroy }
71