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>
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
/*
|
|
* arch/arm/mach-ebsa110/include/mach/system.h
|
|
*
|
|
* Copyright (C) 1996-2000 Russell King.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
#ifndef __ASM_ARCH_SYSTEM_H
|
|
#define __ASM_ARCH_SYSTEM_H
|
|
|
|
/*
|
|
* EBSA110 idling methodology:
|
|
*
|
|
* We can not execute the "wait for interrupt" instruction since that
|
|
* will stop our MCLK signal (which provides the clock for the glue
|
|
* logic, and therefore the timer interrupt).
|
|
*
|
|
* Instead, we spin, polling the IRQ_STAT register for the occurrence
|
|
* of any interrupt with core clock down to the memory clock.
|
|
*/
|
|
static inline void arch_idle(void)
|
|
{
|
|
const char *irq_stat = (char *)0xff000000;
|
|
|
|
/* disable clock switching */
|
|
asm volatile ("mcr p15, 0, ip, c15, c2, 2" : : : "cc");
|
|
|
|
/* wait for an interrupt to occur */
|
|
while (!*irq_stat);
|
|
|
|
/* enable clock switching */
|
|
asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
|
|
}
|
|
|
|
#define arch_reset(mode, cmd) soft_restart(0x80000000)
|
|
|
|
#endif
|