/*1* reset.c -- common ColdFire SoC reset support2*3* (C) Copyright 2012, Greg Ungerer <[email protected]>4*5* This file is subject to the terms and conditions of the GNU General Public6* License. See the file COPYING in the main directory of this archive7* for more details.8*/910#include <linux/kernel.h>11#include <linux/init.h>12#include <linux/io.h>13#include <asm/machdep.h>14#include <asm/coldfire.h>15#include <asm/mcfsim.h>1617/*18* There are 2 common methods amongst the ColdFure parts for reseting19* the CPU. But there are couple of exceptions, the 5272 and the 547x20* have something completely special to them, and we let their specific21* subarch code handle them.22*/2324#ifdef MCFSIM_SYPCR25static void mcf_cpu_reset(void)26{27local_irq_disable();28/* Set watchdog to soft reset, and enabled */29__raw_writeb(0xc0, MCFSIM_SYPCR);30for (;;)31/* wait for watchdog to timeout */;32}33#endif3435#ifdef MCF_RCR36static void mcf_cpu_reset(void)37{38local_irq_disable();39__raw_writeb(MCF_RCR_SWRESET, MCF_RCR);40}41#endif4243static int __init mcf_setup_reset(void)44{45mach_reset = mcf_cpu_reset;46return 0;47}4849arch_initcall(mcf_setup_reset);505152