mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-11 23:50:25 +00:00
e879c862fb
We only need to set the system up for a soft-restart if we're going to be doing a soft-restart. Provide a new function (soft_restart()) which does the setup and final call for this, and make platforms use it. Eliminate the call to setup_restart() from the default handler. This means that platforms arch_reset() function is no longer called with the page tables prepared for a soft-restart, and caches will still be enabled. Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Will Deacon <will.deacon@arm.com> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Viresh Kumar <viresh.kumar@st.com> Acked-by: Krzysztof Ha■asa <khc@pm.waw.pl> Acked-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Richard Purdie <richard.purdie@linuxfoundation.org> Acked-by: Wan ZongShun <mcuos.com@gmail.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
80 lines
2.0 KiB
C
80 lines
2.0 KiB
C
/*
|
|
* Copyright (C) 1999 ARM Limited
|
|
* Copyright (C) 2000 Deep Blue Solutions Ltd
|
|
* Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
|
|
* Copyright 2008 Juergen Beisert, kernel@pengutronix.de
|
|
* Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, yanok@emcraft.com
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/clk.h>
|
|
#include <linux/io.h>
|
|
#include <linux/err.h>
|
|
#include <linux/delay.h>
|
|
|
|
#include <mach/hardware.h>
|
|
#include <mach/common.h>
|
|
#include <asm/proc-fns.h>
|
|
#include <asm/system.h>
|
|
#include <asm/mach-types.h>
|
|
|
|
void (*imx_idle)(void) = NULL;
|
|
void __iomem *(*imx_ioremap)(unsigned long, size_t, unsigned int) = NULL;
|
|
|
|
static void __iomem *wdog_base;
|
|
|
|
/*
|
|
* Reset the system. It is called by machine_restart().
|
|
*/
|
|
void arch_reset(char mode, const char *cmd)
|
|
{
|
|
unsigned int wcr_enable;
|
|
|
|
#ifdef CONFIG_MACH_MX51_EFIKAMX
|
|
if (machine_is_mx51_efikamx()) {
|
|
mx51_efikamx_reset();
|
|
return;
|
|
}
|
|
#endif
|
|
|
|
if (cpu_is_mx1()) {
|
|
wcr_enable = (1 << 0);
|
|
} else {
|
|
struct clk *clk;
|
|
|
|
clk = clk_get_sys("imx2-wdt.0", NULL);
|
|
if (!IS_ERR(clk))
|
|
clk_enable(clk);
|
|
wcr_enable = (1 << 2);
|
|
}
|
|
|
|
/* Assert SRS signal */
|
|
__raw_writew(wcr_enable, wdog_base);
|
|
|
|
/* wait for reset to assert... */
|
|
mdelay(500);
|
|
|
|
printk(KERN_ERR "Watchdog reset failed to assert reset\n");
|
|
|
|
/* delay to allow the serial port to show the message */
|
|
mdelay(50);
|
|
|
|
/* we'll take a jump through zero as a poor second */
|
|
soft_restart(0);
|
|
}
|
|
|
|
void mxc_arch_reset_init(void __iomem *base)
|
|
{
|
|
wdog_base = base;
|
|
}
|