diff options
author | Liang Li <Liang.Li@windriver.com> | 2009-08-14 10:36:14 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-08-24 21:48:12 -0400 |
commit | 7792da8567a70be3280c8eef916334e6923815e3 (patch) | |
tree | 8d792c7b995502493306c496cdac39856e1f689b /arch | |
parent | 944ac03804c4c9c0879347098ea458fd57f38687 (diff) |
powerpc/85xx: sbc8560 - Fix warm reboot with board specific reset function
The existing fsl_rstcr_restart function is not applicable to the
mpc8560. The Global Utilities Block on this earlier CPU doesn't have
the control/reset register at 0xe00b0. This implements a board
specific reset function that uses the RCR(Reset Control Register) of
the sbc8560's EPLD to do a reset.
Signed-off-by: Liang Li <Liang.Li@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/85xx/sbc8560.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c index cc27807a8b64..a5ad1c7794bf 100644 --- a/arch/powerpc/platforms/85xx/sbc8560.c +++ b/arch/powerpc/platforms/85xx/sbc8560.c | |||
@@ -267,6 +267,43 @@ arch_initcall(sbc8560_rtc_init); | |||
267 | 267 | ||
268 | #endif /* M48T59 */ | 268 | #endif /* M48T59 */ |
269 | 269 | ||
270 | static __u8 __iomem *brstcr; | ||
271 | |||
272 | static int __init sbc8560_bdrstcr_init(void) | ||
273 | { | ||
274 | struct device_node *np; | ||
275 | struct resource res; | ||
276 | |||
277 | np = of_find_compatible_node(NULL, NULL, "wrs,sbc8560-brstcr"); | ||
278 | if (np == NULL) { | ||
279 | printk(KERN_WARNING "sbc8560: No board specific RSTCR in DTB.\n"); | ||
280 | return -ENODEV; | ||
281 | } | ||
282 | |||
283 | of_address_to_resource(np, 0, &res); | ||
284 | |||
285 | printk(KERN_INFO "sbc8560: Found BRSTCR at i/o 0x%x\n", res.start); | ||
286 | |||
287 | brstcr = ioremap(res.start, res.end - res.start); | ||
288 | if(!brstcr) | ||
289 | printk(KERN_WARNING "sbc8560: ioremap of brstcr failed.\n"); | ||
290 | |||
291 | of_node_put(np); | ||
292 | |||
293 | return 0; | ||
294 | } | ||
295 | |||
296 | arch_initcall(sbc8560_bdrstcr_init); | ||
297 | |||
298 | void sbc8560_rstcr_restart(char * cmd) | ||
299 | { | ||
300 | local_irq_disable(); | ||
301 | if(brstcr) | ||
302 | clrbits8(brstcr, 0x80); | ||
303 | |||
304 | while(1); | ||
305 | } | ||
306 | |||
270 | define_machine(sbc8560) { | 307 | define_machine(sbc8560) { |
271 | .name = "SBC8560", | 308 | .name = "SBC8560", |
272 | .probe = sbc8560_probe, | 309 | .probe = sbc8560_probe, |
@@ -274,7 +311,7 @@ define_machine(sbc8560) { | |||
274 | .init_IRQ = sbc8560_pic_init, | 311 | .init_IRQ = sbc8560_pic_init, |
275 | .show_cpuinfo = sbc8560_show_cpuinfo, | 312 | .show_cpuinfo = sbc8560_show_cpuinfo, |
276 | .get_irq = mpic_get_irq, | 313 | .get_irq = mpic_get_irq, |
277 | .restart = fsl_rstcr_restart, | 314 | .restart = sbc8560_rstcr_restart, |
278 | .calibrate_decr = generic_calibrate_decr, | 315 | .calibrate_decr = generic_calibrate_decr, |
279 | .progress = udbg_progress, | 316 | .progress = udbg_progress, |
280 | }; | 317 | }; |