blob: 5ed78d3546d228da2c08568d2bad6fe1605aa4aa [file] [log] [blame]
Greg Ungererd894b892012-02-19 16:16:58 +10001/*
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
18void 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
27static int __init mcf_setup_reset(void)
28{
29 mach_reset = mcf_cpu_reset;
30 return 0;
31}
32
33arch_initcall(mcf_setup_reset);