diff options
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 38 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.h | 1 |
2 files changed, 39 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) | ||
1303 | static __be32 __iomem *rstcr; | ||
1304 | |||
1305 | static 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 | |||
1327 | arch_initcall(setup_rstcr); | ||
1328 | |||
1329 | void 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 | ||
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h index 618d91d1e103..63e7db30a4cd 100644 --- a/arch/powerpc/sysdev/fsl_soc.h +++ b/arch/powerpc/sysdev/fsl_soc.h | |||
@@ -15,5 +15,6 @@ extern int fsl_spi_init(struct spi_board_info *board_infos, | |||
15 | void (*activate_cs)(u8 cs, u8 polarity), | 15 | void (*activate_cs)(u8 cs, u8 polarity), |
16 | void (*deactivate_cs)(u8 cs, u8 polarity)); | 16 | void (*deactivate_cs)(u8 cs, u8 polarity)); |
17 | 17 | ||
18 | extern void fsl_rstcr_restart(char *cmd); | ||
18 | #endif | 19 | #endif |
19 | #endif | 20 | #endif |