aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/fsl_soc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/sysdev/fsl_soc.c')
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index c765d7a5217b..be5e0bda2318 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -1298,3 +1298,41 @@ err:
1298 1298
1299 return spi_register_board_info(board_infos, num_board_infos); 1299 return spi_register_board_info(board_infos, num_board_infos);
1300} 1300}
1301
1302#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx)
1303static __be32 __iomem *rstcr;
1304
1305static int __init setup_rstcr(void)
1306{
1307 struct device_node *np;
1308 np = of_find_node_by_name(NULL, "global-utilities");
1309 if ((np && of_get_property(np, "fsl,has-rstcr", NULL))) {
1310 const u32 *prop = of_get_property(np, "reg", NULL);
1311 if (prop) {
1312 /* map reset control register
1313 * 0xE00B0 is offset of reset control register
1314 */
1315 rstcr = ioremap(get_immrbase() + *prop + 0xB0, 0xff);
1316 if (!rstcr)
1317 printk (KERN_EMERG "Error: reset control "
1318 "register not mapped!\n");
1319 }
1320 } else
1321 printk (KERN_INFO "rstcr compatible register does not exist!\n");
1322 if (np)
1323 of_node_put(np);
1324 return 0;
1325}
1326
1327arch_initcall(setup_rstcr);
1328
1329void fsl_rstcr_restart(char *cmd)
1330{
1331 local_irq_disable();
1332 if (rstcr)
1333 /* set reset control register */
1334 out_be32(rstcr, 0x2); /* HRESET_REQ */
1335
1336 while (1) ;
1337}
1338#endif