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