Greg Ungerer | d894b89 | 2012-02-19 16:16:58 +1000 | [diff] [blame^] | 1 | /* |
| 2 | * reset.c -- common ColdFire SoC reset support |
| 3 | * |
| 4 | * (C) Copyright 2012, Greg Ungerer <gerg@uclinux.org> |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file COPYING in the main directory of this archive |
| 8 | * for more details. |
| 9 | */ |
| 10 | |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/io.h> |
| 14 | #include <asm/machdep.h> |
| 15 | #include <asm/coldfire.h> |
| 16 | #include <asm/mcfsim.h> |
| 17 | |
| 18 | void mcf_cpu_reset(void) |
| 19 | { |
| 20 | local_irq_disable(); |
| 21 | /* Set watchdog to soft reset, and enabled */ |
| 22 | __raw_writeb(0xc0, MCF_MBAR + MCFSIM_SYPCR); |
| 23 | for (;;) |
| 24 | /* wait for watchdog to timeout */; |
| 25 | } |
| 26 | |
| 27 | static int __init mcf_setup_reset(void) |
| 28 | { |
| 29 | mach_reset = mcf_cpu_reset; |
| 30 | return 0; |
| 31 | } |
| 32 | |
| 33 | arch_initcall(mcf_setup_reset); |