Commit 34e5f4f1 authored by Russell King's avatar Russell King

Merge branches 'debug' and 'idle' into for-armsoc

parents e76f4750 a570067d
...@@ -110,6 +110,7 @@ extern void cpu_init(void); ...@@ -110,6 +110,7 @@ extern void cpu_init(void);
void soft_restart(unsigned long); void soft_restart(unsigned long);
extern void (*arm_pm_restart)(char str, const char *cmd); extern void (*arm_pm_restart)(char str, const char *cmd);
extern void (*arm_pm_idle)(void);
#define UDBG_UNDEFINED (1 << 0) #define UDBG_UNDEFINED (1 << 0)
#define UDBG_SYSCALL (1 << 1) #define UDBG_SYSCALL (1 << 1)
......
...@@ -61,8 +61,6 @@ extern void setup_mm_for_reboot(void); ...@@ -61,8 +61,6 @@ extern void setup_mm_for_reboot(void);
static volatile int hlt_counter; static volatile int hlt_counter;
#include <mach/system.h>
void disable_hlt(void) void disable_hlt(void)
{ {
hlt_counter++; hlt_counter++;
...@@ -181,13 +179,17 @@ void cpu_idle_wait(void) ...@@ -181,13 +179,17 @@ void cpu_idle_wait(void)
EXPORT_SYMBOL_GPL(cpu_idle_wait); EXPORT_SYMBOL_GPL(cpu_idle_wait);
/* /*
* This is our default idle handler. We need to disable * This is our default idle handler.
* interrupts here to ensure we don't miss a wakeup call.
*/ */
void (*arm_pm_idle)(void);
static void default_idle(void) static void default_idle(void)
{ {
if (!need_resched()) if (arm_pm_idle)
arch_idle(); arm_pm_idle();
else
cpu_do_idle();
local_irq_enable(); local_irq_enable();
} }
...@@ -215,6 +217,10 @@ void cpu_idle(void) ...@@ -215,6 +217,10 @@ void cpu_idle(void)
cpu_die(); cpu_die();
#endif #endif
/*
* We need to disable interrupts here
* to ensure we don't miss a wakeup call.
*/
local_irq_disable(); local_irq_disable();
#ifdef CONFIG_PL310_ERRATA_769419 #ifdef CONFIG_PL310_ERRATA_769419
wmb(); wmb();
...@@ -222,19 +228,18 @@ void cpu_idle(void) ...@@ -222,19 +228,18 @@ void cpu_idle(void)
if (hlt_counter) { if (hlt_counter) {
local_irq_enable(); local_irq_enable();
cpu_relax(); cpu_relax();
} else { } else if (!need_resched()) {
stop_critical_timings(); stop_critical_timings();
if (cpuidle_idle_call()) if (cpuidle_idle_call())
pm_idle(); pm_idle();
start_critical_timings(); start_critical_timings();
/* /*
* This will eventually be removed - pm_idle * pm_idle functions must always
* functions should always return with IRQs * return with IRQs enabled.
* enabled.
*/ */
WARN_ON(irqs_disabled()); WARN_ON(irqs_disabled());
} else
local_irq_enable(); local_irq_enable();
}
} }
leds_event(led_idle_end); leds_event(led_idle_end);
rcu_idle_exit(); rcu_idle_exit();
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <asm/proc-fns.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -314,6 +315,12 @@ static struct at91_gpio_bank at91cap9_gpio[] __initdata = { ...@@ -314,6 +315,12 @@ static struct at91_gpio_bank at91cap9_gpio[] __initdata = {
} }
}; };
static void at91cap9_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
}
static void at91cap9_restart(char mode, const char *cmd) static void at91cap9_restart(char mode, const char *cmd)
{ {
at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
...@@ -337,6 +344,7 @@ static void __init at91cap9_ioremap_registers(void) ...@@ -337,6 +344,7 @@ static void __init at91cap9_ioremap_registers(void)
static void __init at91cap9_initialize(void) static void __init at91cap9_initialize(void)
{ {
arm_pm_idle = at91cap9_idle;
arm_pm_restart = at91cap9_restart; arm_pm_restart = at91cap9_restart;
at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1);
......
...@@ -289,6 +289,15 @@ static struct at91_gpio_bank at91rm9200_gpio[] __initdata = { ...@@ -289,6 +289,15 @@ static struct at91_gpio_bank at91rm9200_gpio[] __initdata = {
} }
}; };
static void at91rm9200_idle(void)
{
/*
* Disable the processor clock. The processor will be automatically
* re-enabled by an interrupt or by a reset.
*/
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
}
static void at91rm9200_restart(char mode, const char *cmd) static void at91rm9200_restart(char mode, const char *cmd)
{ {
/* /*
...@@ -314,6 +323,7 @@ static void __init at91rm9200_ioremap_registers(void) ...@@ -314,6 +323,7 @@ static void __init at91rm9200_ioremap_registers(void)
static void __init at91rm9200_initialize(void) static void __init at91rm9200_initialize(void)
{ {
arm_pm_idle = at91rm9200_idle;
arm_pm_restart = at91rm9200_restart; arm_pm_restart = at91rm9200_restart;
at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1) at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
| (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3) | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <asm/proc-fns.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -327,8 +328,15 @@ static void __init at91sam9260_ioremap_registers(void) ...@@ -327,8 +328,15 @@ static void __init at91sam9260_ioremap_registers(void)
at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC); at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC);
} }
static void at91sam9260_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
}
static void __init at91sam9260_initialize(void) static void __init at91sam9260_initialize(void)
{ {
arm_pm_idle = at91sam9260_idle;
arm_pm_restart = at91sam9_alt_restart; arm_pm_restart = at91sam9_alt_restart;
at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
| (1 << AT91SAM9260_ID_IRQ2); | (1 << AT91SAM9260_ID_IRQ2);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <asm/proc-fns.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -285,8 +286,15 @@ static void __init at91sam9261_ioremap_registers(void) ...@@ -285,8 +286,15 @@ static void __init at91sam9261_ioremap_registers(void)
at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC); at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC);
} }
static void at91sam9261_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
}
static void __init at91sam9261_initialize(void) static void __init at91sam9261_initialize(void)
{ {
arm_pm_idle = at91sam9261_idle;
arm_pm_restart = at91sam9_alt_restart; arm_pm_restart = at91sam9_alt_restart;
at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
| (1 << AT91SAM9261_ID_IRQ2); | (1 << AT91SAM9261_ID_IRQ2);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <asm/proc-fns.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -306,8 +307,15 @@ static void __init at91sam9263_ioremap_registers(void) ...@@ -306,8 +307,15 @@ static void __init at91sam9263_ioremap_registers(void)
at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1); at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1);
} }
static void at91sam9263_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
}
static void __init at91sam9263_initialize(void) static void __init at91sam9263_initialize(void)
{ {
arm_pm_idle = at91sam9263_idle;
arm_pm_restart = at91sam9_alt_restart; arm_pm_restart = at91sam9_alt_restart;
at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
......
...@@ -318,6 +318,12 @@ static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = { ...@@ -318,6 +318,12 @@ static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = {
} }
}; };
static void at91sam9g45_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
}
static void at91sam9g45_restart(char mode, const char *cmd) static void at91sam9g45_restart(char mode, const char *cmd)
{ {
at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
...@@ -342,6 +348,7 @@ static void __init at91sam9g45_ioremap_registers(void) ...@@ -342,6 +348,7 @@ static void __init at91sam9g45_ioremap_registers(void)
static void __init at91sam9g45_initialize(void) static void __init at91sam9g45_initialize(void)
{ {
arm_pm_idle = at91sam9g45_idle;
arm_pm_restart = at91sam9g45_restart; arm_pm_restart = at91sam9g45_restart;
at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0); at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <asm/proc-fns.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -290,8 +291,15 @@ static void __init at91sam9rl_ioremap_registers(void) ...@@ -290,8 +291,15 @@ static void __init at91sam9rl_ioremap_registers(void)
at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC); at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC);
} }
static void at91sam9rl_idle(void)
{
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
cpu_do_idle();
}
static void __init at91sam9rl_initialize(void) static void __init at91sam9rl_initialize(void)
{ {
arm_pm_idle = at91sam9rl_idle;
arm_pm_restart = at91sam9_alt_restart; arm_pm_restart = at91sam9_alt_restart;
at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <asm/proc-fns.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <mach/at91x40.h> #include <mach/at91x40.h>
#include <mach/at91_st.h> #include <mach/at91_st.h>
...@@ -37,8 +38,19 @@ unsigned long clk_get_rate(struct clk *clk) ...@@ -37,8 +38,19 @@ unsigned long clk_get_rate(struct clk *clk)
return AT91X40_MASTER_CLOCK; return AT91X40_MASTER_CLOCK;
} }
static void at91x40_idle(void)
{
/*
* Disable the processor clock. The processor will be automatically
* re-enabled by an interrupt or by a reset.
*/
at91_sys_write(AT91_PS_CR, AT91_PS_CR_CPU);
cpu_do_idle();
}
void __init at91x40_initialize(unsigned long main_clock) void __init at91x40_initialize(unsigned long main_clock)
{ {
arm_pm_idle = at91x40_idle;
at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1) at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1)
| (1 << AT91X40_ID_IRQ2); | (1 << AT91X40_ID_IRQ2);
} }
......
/*
* arch/arm/mach-at91/include/mach/system.h
*
* Copyright (C) 2003 SAN People
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#include <mach/hardware.h>
#include <mach/at91_st.h>
#include <mach/at91_dbgu.h>
#include <mach/at91_pmc.h>
static inline void arch_idle(void)
{
/*
* Disable the processor clock. The processor will be automatically
* re-enabled by an interrupt or by a reset.
*/
#ifdef AT91_PS
at91_sys_write(AT91_PS_CR, AT91_PS_CR_CPU);
#else
at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
#endif
#ifndef CONFIG_CPU_ARM920T
/*
* Set the processor (CP15) into 'Wait for Interrupt' mode.
* Post-RM9200 processors need this in conjunction with the above
* to save power when idle.
*/
cpu_do_idle();
#endif
}
#endif
/*
*
* Copyright (C) 1999 ARM Limited
* Copyright (C) 2000 Deep Blue Solutions Ltd
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif
...@@ -225,3 +225,19 @@ void clps711x_restart(char mode, const char *cmd) ...@@ -225,3 +225,19 @@ void clps711x_restart(char mode, const char *cmd)
{ {
soft_restart(0); soft_restart(0);
} }
static void clps711x_idle(void)
{
clps_writel(1, HALT);
__asm__ __volatile__(
"mov r0, r0\n\
mov r0, r0");
}
static int __init clps711x_idle_init(void)
{
arm_pm_idle = clps711x_idle;
return 0;
}
arch_initcall(clps711x_idle_init);
/*
* arch/arm/mach-clps711x/include/mach/system.h
*
* Copyright (C) 2000 Deep Blue Solutions Ltd
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#include <linux/io.h>
#include <mach/hardware.h>
#include <asm/hardware/clps7111.h>
static inline void arch_idle(void)
{
clps_writel(1, HALT);
__asm__ __volatile__(
"mov r0, r0\n\
mov r0, r0");
}
#endif
/*
* Copyright 2000 Deep Blue Solutions Ltd
* Copyright 2003 ARM Limited
* Copyright 2008 Cavium Networks
*
* This file 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 __MACH_SYSTEM_H
#define __MACH_SYSTEM_H
#include <asm/proc-fns.h>
static inline void arch_idle(void)
{
/*
* This should do all the clock switching
* and wait for interrupt tricks
*/
cpu_do_idle();
}
#endif
/*
* DaVinci system defines
*
* Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
*
* 2007 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#include <mach/common.h>
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif /* __ASM_ARCH_SYSTEM_H */
/*
* arch/arm/mach-dove/include/mach/system.h
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif
...@@ -271,8 +271,33 @@ static struct platform_device *ebsa110_devices[] = { ...@@ -271,8 +271,33 @@ static struct platform_device *ebsa110_devices[] = {
&am79c961_device, &am79c961_device,
}; };
/*
* 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 void ebsa110_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");
}
static int __init ebsa110_init(void) static int __init ebsa110_init(void)
{ {
arm_pm_idle = ebsa110_idle;
return platform_add_devices(ebsa110_devices, ARRAY_SIZE(ebsa110_devices)); return platform_add_devices(ebsa110_devices, ARRAY_SIZE(ebsa110_devices));
} }
......
/*
* 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");
}
#endif
/*
* arch/arm/mach-ep93xx/include/mach/system.h
*/
static inline void arch_idle(void)
{
cpu_do_idle();
}
...@@ -201,14 +201,6 @@ static struct map_desc exynos4_iodesc1[] __initdata = { ...@@ -201,14 +201,6 @@ static struct map_desc exynos4_iodesc1[] __initdata = {
}, },
}; };
static void exynos_idle(void)
{
if (!need_resched())
cpu_do_idle();
local_irq_enable();
}
void exynos4_restart(char mode, const char *cmd) void exynos4_restart(char mode, const char *cmd)
{ {
__raw_writel(0x1, S5P_SWRESET); __raw_writel(0x1, S5P_SWRESET);
...@@ -467,10 +459,6 @@ early_initcall(exynos4_l2x0_cache_init); ...@@ -467,10 +459,6 @@ early_initcall(exynos4_l2x0_cache_init);
int __init exynos_init(void) int __init exynos_init(void)
{ {
printk(KERN_INFO "EXYNOS: Initializing architecture\n"); printk(KERN_INFO "EXYNOS: Initializing architecture\n");
/* set idle function */
pm_idle = exynos_idle;
return device_register(&exynos4_dev); return device_register(&exynos4_dev);
} }
......
/* linux/arch/arm/mach-exynos4/include/mach/system.h
*
* Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* EXYNOS4 - system support header
*
* 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 __FILE__
static void arch_idle(void)
{
/* nothing here yet */
}
#endif /* __ASM_ARCH_SYSTEM_H */
/*
* arch/arm/mach-footbridge/include/mach/system.h
*
* Copyright (C) 1996-1999 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.
*/
static inline void arch_idle(void)
{
cpu_do_idle();
}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Object file lists. # Object file lists.
obj-y := irq.o mm.o time.o devices.o gpio.o obj-y := irq.o mm.o time.o devices.o gpio.o idle.o
# Board-specific support # Board-specific support
obj-$(CONFIG_MACH_NAS4220B) += board-nas4220b.o obj-$(CONFIG_MACH_NAS4220B) += board-nas4220b.o
......
/*
* arch/arm/mach-gemini/idle.c
*/
#include <linux/init.h>
#include <asm/system.h>
#include <asm/proc-fns.h>
static void gemini_idle(void)
{
/*
* Because of broken hardware we have to enable interrupts or the CPU
* will never wakeup... Acctualy it is not very good to enable
* interrupts first since scheduler can miss a tick, but there is
* no other way around this. Platforms that needs it for power saving
* should call enable_hlt() in init code, since by default it is
* disabled.
*/
local_irq_enable();
cpu_do_idle();
}
static int __init gemini_idle_init(void)
{
arm_pm_idle = gemini_idle;
return 0;
}
arch_initcall(gemini_idle_init);
...@@ -14,20 +14,6 @@ ...@@ -14,20 +14,6 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/global_reg.h> #include <mach/global_reg.h>
static inline void arch_idle(void)
{
/*
* Because of broken hardware we have to enable interrupts or the CPU
* will never wakeup... Acctualy it is not very good to enable
* interrupts here since scheduler can miss a tick, but there is
* no other way around this. Platforms that needs it for power saving
* should call enable_hlt() in init code, since by default it is
* disabled.
*/
local_irq_enable();
cpu_do_idle();
}
static inline void arch_reset(char mode, const char *cmd) static inline void arch_reset(char mode, const char *cmd)
{ {
__raw_writel(RESET_GLOBAL | RESET_CPU1, __raw_writel(RESET_GLOBAL | RESET_CPU1,
......
...@@ -73,8 +73,8 @@ void __init gemini_init_irq(void) ...@@ -73,8 +73,8 @@ void __init gemini_init_irq(void)
unsigned int i, mode = 0, level = 0; unsigned int i, mode = 0, level = 0;
/* /*
* Disable arch_idle() by default since it is buggy * Disable the idle handler by default since it is buggy
* For more info see arch/arm/mach-gemini/include/mach/system.h * For more info see arch/arm/mach-gemini/idle.c
*/ */
disable_hlt(); disable_hlt();
......
...@@ -247,3 +247,21 @@ void h720x_restart(char mode, const char *cmd) ...@@ -247,3 +247,21 @@ void h720x_restart(char mode, const char *cmd)
{ {
CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET; CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
} }
static void h720x__idle(void)
{
CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_IDLE;
nop();
nop();
CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_RUN;
nop();
nop();
}
static int __init h720x_idle_init(void)
{
arm_pm_idle = h720x__idle;
return 0;
}
arch_initcall(h720x_idle_init);
/*
* arch/arm/mach-h720x/include/mach/system.h
*
* Copyright (C) 2001-2002 Jungjun Kim, Hynix Semiconductor Inc.
*
* 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.
* arch/arm/mach-h720x/include/mach/system.h
*
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#include <mach/hardware.h>
static void arch_idle(void)
{
CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_IDLE;
nop();
nop();
CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_RUN;
nop();
nop();
}
#endif
/*
* Copyright 2010-2011 Calxeda, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MACH_SYSTEM_H
#define __MACH_SYSTEM_H
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif
...@@ -34,31 +34,29 @@ static void imx3_idle(void) ...@@ -34,31 +34,29 @@ static void imx3_idle(void)
{ {
unsigned long reg = 0; unsigned long reg = 0;
if (!need_resched()) __asm__ __volatile__(
__asm__ __volatile__( /* disable I and D cache */
/* disable I and D cache */ "mrc p15, 0, %0, c1, c0, 0\n"
"mrc p15, 0, %0, c1, c0, 0\n" "bic %0, %0, #0x00001000\n"
"bic %0, %0, #0x00001000\n" "bic %0, %0, #0x00000004\n"
"bic %0, %0, #0x00000004\n" "mcr p15, 0, %0, c1, c0, 0\n"
"mcr p15, 0, %0, c1, c0, 0\n" /* invalidate I cache */
/* invalidate I cache */ "mov %0, #0\n"
"mov %0, #0\n" "mcr p15, 0, %0, c7, c5, 0\n"
"mcr p15, 0, %0, c7, c5, 0\n" /* clear and invalidate D cache */
/* clear and invalidate D cache */ "mov %0, #0\n"
"mov %0, #0\n" "mcr p15, 0, %0, c7, c14, 0\n"
"mcr p15, 0, %0, c7, c14, 0\n" /* WFI */
/* WFI */ "mov %0, #0\n"
"mov %0, #0\n" "mcr p15, 0, %0, c7, c0, 4\n"
"mcr p15, 0, %0, c7, c0, 4\n" "nop\n" "nop\n" "nop\n" "nop\n"
"nop\n" "nop\n" "nop\n" "nop\n" "nop\n" "nop\n" "nop\n"
"nop\n" "nop\n" "nop\n" /* enable I and D cache */
/* enable I and D cache */ "mrc p15, 0, %0, c1, c0, 0\n"
"mrc p15, 0, %0, c1, c0, 0\n" "orr %0, %0, #0x00001000\n"
"orr %0, %0, #0x00001000\n" "orr %0, %0, #0x00000004\n"
"orr %0, %0, #0x00000004\n" "mcr p15, 0, %0, c1, c0, 0\n"
"mcr p15, 0, %0, c1, c0, 0\n" : "=r" (reg));
: "=r" (reg));
local_irq_enable();
} }
static void __iomem *imx3_ioremap(unsigned long phys_addr, size_t size, static void __iomem *imx3_ioremap(unsigned long phys_addr, size_t size,
...@@ -134,8 +132,8 @@ void __init imx31_init_early(void) ...@@ -134,8 +132,8 @@ void __init imx31_init_early(void)
{ {
mxc_set_cpu_type(MXC_CPU_MX31); mxc_set_cpu_type(MXC_CPU_MX31);
mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR)); mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR));
pm_idle = imx3_idle;
imx_ioremap = imx3_ioremap; imx_ioremap = imx3_ioremap;
arm_pm_idle = imx3_idle;
} }
void __init mx31_init_irq(void) void __init mx31_init_irq(void)
...@@ -197,7 +195,7 @@ void __init imx35_init_early(void) ...@@ -197,7 +195,7 @@ void __init imx35_init_early(void)
mxc_set_cpu_type(MXC_CPU_MX35); mxc_set_cpu_type(MXC_CPU_MX35);
mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR)); mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR));
mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR)); mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR));
pm_idle = imx3_idle; arm_pm_idle = imx3_idle;
imx_ioremap = imx3_ioremap; imx_ioremap = imx3_ioremap;
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/io.h> #include <linux/io.h>
#include <mach/system.h>
#include <mach/hardware.h> #include <mach/hardware.h>
static int mx27_suspend_enter(suspend_state_t state) static int mx27_suspend_enter(suspend_state_t state)
...@@ -23,7 +22,7 @@ static int mx27_suspend_enter(suspend_state_t state) ...@@ -23,7 +22,7 @@ static int mx27_suspend_enter(suspend_state_t state)
cscr &= 0xFFFFFFFC; cscr &= 0xFFFFFFFC;
__raw_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR)); __raw_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR));
/* Executes WFI */ /* Executes WFI */
arch_idle(); cpu_do_idle();
break; break;
default: default:
......
/*
* arch/arm/mach-integrator/include/mach/system.h
*
* Copyright (C) 1999 ARM Limited
* Copyright (C) 2000 Deep Blue Solutions Ltd
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
/*
* This should do all the clock switching
* and wait for interrupt tricks
*/
cpu_do_idle();
}
#endif
/*
* arch/arm/mach-iop13xx/include/mach/system.h
*
* Copyright (C) 2004 Intel Corp.
*
* 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.
*/
static inline void arch_idle(void)
{
cpu_do_idle();
}
/*
* arch/arm/mach-iop32x/include/mach/system.h
*
* Copyright (C) 2001 MontaVista Software, Inc.
*
* 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.
*/
static inline void arch_idle(void)
{
cpu_do_idle();
}
/*
* arch/arm/mach-iop33x/include/mach/system.h
*
* Copyright (C) 2001 MontaVista Software, Inc.
*
* 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.
*/
static inline void arch_idle(void)
{
cpu_do_idle();
}
/*
* arch/arm/mach-ixp2000/include/mach/system.h
*
* Copyright (C) 2002 Intel Corp.
* Copyricht (C) 2003-2005 MontaVista Software, Inc.
*
* 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.
*/
static inline void arch_idle(void)
{
cpu_do_idle();
}
...@@ -441,6 +441,9 @@ static struct platform_device *ixp23xx_devices[] __initdata = { ...@@ -441,6 +441,9 @@ static struct platform_device *ixp23xx_devices[] __initdata = {
void __init ixp23xx_sys_init(void) void __init ixp23xx_sys_init(void)
{ {
/* by default, the idle code is disabled */
disable_hlt();
*IXP23XX_EXP_UNIT_FUSE |= 0xf; *IXP23XX_EXP_UNIT_FUSE |= 0xf;
platform_add_devices(ixp23xx_devices, ARRAY_SIZE(ixp23xx_devices)); platform_add_devices(ixp23xx_devices, ARRAY_SIZE(ixp23xx_devices));
} }
......
/*
* arch/arm/mach-ixp23xx/include/mach/system.h
*
* Copyright (C) 2003 Intel Corporation.
*
* 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.
*/
static inline void arch_idle(void)
{
#if 0
if (!hlt_counter)
cpu_do_idle();
#endif
}
...@@ -236,6 +236,12 @@ void __init ixp4xx_init_irq(void) ...@@ -236,6 +236,12 @@ void __init ixp4xx_init_irq(void)
{ {
int i = 0; int i = 0;
/*
* ixp4xx does not implement the XScale PWRMODE register
* so it must not call cpu_do_idle().
*/
disable_hlt();
/* Route all sources to IRQ instead of FIQ */ /* Route all sources to IRQ instead of FIQ */
*IXP4XX_ICLR = 0x0; *IXP4XX_ICLR = 0x0;
......
/*
* arch/arm/mach-ixp4xx/include/mach/system.h
*
* Copyright (C) 2002 Intel Corporation.
*
* 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.
*
*/
static inline void arch_idle(void)
{
/* ixp4xx does not implement the XScale PWRMODE register,
* so it must not call cpu_do_idle() here.
*/
#if 0
cpu_do_idle();
#endif
}
/*
* arch/arm/mach-kirkwood/include/mach/system.h
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif
/*
* arch/arm/mach-s3c2410/include/mach/system.h
*
* Copyright (C) 2006 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* KS8695 - System function defines and includes
*
* 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
static void arch_idle(void)
{
/*
* This should do all the clock switching
* and wait for interrupt tricks,
*/
cpu_do_idle();
}
#endif
/*
* arch/arm/mach-lpc32xx/include/mach/system.h
*
* Author: Kevin Wells <kevin.wells@nxp.com>
*
* Copyright (C) 2010 NXP Semiconductors
*
* 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.
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static void arch_idle(void)
{
cpu_do_idle();
}
#endif
/*
* linux/arch/arm/mach-mmp/include/mach/system.h
*
* 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_MACH_SYSTEM_H
#define __ASM_MACH_SYSTEM_H
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif /* __ASM_MACH_SYSTEM_H */
/* arch/arm/mach-msm/include/mach/idle.S /* arch/arm/mach-msm/idle.c
* *
* Idle processing for MSM7K - work around bugs with SWFI. * Idle processing for MSM7K - work around bugs with SWFI.
* *
* Copyright (c) 2007 QUALCOMM Incorporated. * Copyright (c) 2007 QUALCOMM Incorporated.
* Copyright (C) 2007 Google, Inc. * Copyright (C) 2007 Google, Inc.
* *
* This software is licensed under the terms of the GNU General Public * This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and * License version 2, as published by the Free Software Foundation, and
...@@ -14,23 +14,36 @@ ...@@ -14,23 +14,36 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
*/ */
#include <linux/linkage.h>
#include <asm/assembler.h>
ENTRY(arch_idle) #include <linux/init.h>
#include <asm/system.h>
static void msm_idle(void)
{
#ifdef CONFIG_MSM7X00A_IDLE #ifdef CONFIG_MSM7X00A_IDLE
mrc p15, 0, r1, c1, c0, 0 /* read current CR */ asm volatile (
bic r0, r1, #(1 << 2) /* clear dcache bit */
bic r0, r0, #(1 << 12) /* clear icache bit */ "mrc p15, 0, r1, c1, c0, 0 /* read current CR */ \n\t"
mcr p15, 0, r0, c1, c0, 0 /* disable d/i cache */ "bic r0, r1, #(1 << 2) /* clear dcache bit */ \n\t"
"bic r0, r0, #(1 << 12) /* clear icache bit */ \n\t"
"mcr p15, 0, r0, c1, c0, 0 /* disable d/i cache */ \n\t"
"mov r0, #0 /* prepare wfi value */ \n\t"
"mcr p15, 0, r0, c7, c10, 0 /* flush the cache */ \n\t"
"mcr p15, 0, r0, c7, c10, 4 /* memory barrier */ \n\t"
"mcr p15, 0, r0, c7, c0, 4 /* wait for interrupt */ \n\t"
mov r0, #0 /* prepare wfi value */ "mcr p15, 0, r1, c1, c0, 0 /* restore d/i cache */ \n\t"
mcr p15, 0, r0, c7, c10, 0 /* flush the cache */
mcr p15, 0, r0, c7, c10, 4 /* memory barrier */
mcr p15, 0, r0, c7, c0, 4 /* wait for interrupt */
mcr p15, 0, r1, c1, c0, 0 /* restore d/i cache */ : : : "r0","r1" );
#endif #endif
mov pc, lr }
static int __init msm_idle_init(void)
{
arm_pm_idle = msm_idle;
return 0;
}
arch_initcall(msm_idle_init);
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
*/ */
void arch_idle(void);
/* low level hardware reset hook -- for example, hitting the /* low level hardware reset hook -- for example, hitting the
* PSHOLD line on the PMIC to hard reset the system * PSHOLD line on the PMIC to hard reset the system
......
/*
* arch/arm/mach-mv78xx0/include/mach/system.h
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif
...@@ -26,23 +26,17 @@ static struct clk *gpc_dvfs_clk; ...@@ -26,23 +26,17 @@ static struct clk *gpc_dvfs_clk;
static void imx5_idle(void) static void imx5_idle(void)
{ {
if (!need_resched()) { /* gpc clock is needed for SRPG */
/* gpc clock is needed for SRPG */ if (gpc_dvfs_clk == NULL) {
if (gpc_dvfs_clk == NULL) { gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs");
gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs"); if (IS_ERR(gpc_dvfs_clk))
if (IS_ERR(gpc_dvfs_clk)) return;
goto err0;
}
clk_enable(gpc_dvfs_clk);
mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
if (tzic_enable_wake())
goto err1;
cpu_do_idle();
err1:
clk_disable(gpc_dvfs_clk);
} }
err0: clk_enable(gpc_dvfs_clk);
local_irq_enable(); mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
if (tzic_enable_wake() != 0)
cpu_do_idle();
clk_disable(gpc_dvfs_clk);
} }
/* /*
...@@ -108,7 +102,7 @@ void __init imx51_init_early(void) ...@@ -108,7 +102,7 @@ void __init imx51_init_early(void)
mxc_set_cpu_type(MXC_CPU_MX51); mxc_set_cpu_type(MXC_CPU_MX51);
mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR)); mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR));
mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG1_BASE_ADDR)); mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG1_BASE_ADDR));
pm_idle = imx5_idle; arm_pm_idle = imx5_idle;
} }
void __init imx53_init_early(void) void __init imx53_init_early(void)
......
/*
* Copyright (C) 1999 ARM Limited
* Copyright (C) 2000 Deep Blue Solutions Ltd
* Copyright 2004-2008 Freescale Semiconductor, Inc. All Rights Reserved.
*
* 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.
*/
#ifndef __MACH_MXS_SYSTEM_H__
#define __MACH_MXS_SYSTEM_H__
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif /* __MACH_MXS_SYSTEM_H__ */
...@@ -15,13 +15,12 @@ ...@@ -15,13 +15,12 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/io.h> #include <linux/io.h>
#include <mach/system.h>
static int mxs_suspend_enter(suspend_state_t state) static int mxs_suspend_enter(suspend_state_t state)
{ {
switch (state) { switch (state) {
case PM_SUSPEND_MEM: case PM_SUSPEND_MEM:
arch_idle(); cpu_do_idle();
break; break;
default: default:
......
/*
* arch/arm/mach-netx/include/mach/system.h
*
* Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
*
* 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.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif
/*
* mach-nomadik/include/mach/system.h
*
* Copyright (C) 2008 STMicroelectronics
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
/*
* This should do all the clock switching
* and wait for interrupt tricks
*/
cpu_do_idle();
}
#endif
/*
* arch/arm/mach-omap1/include/mach/system.h
*/
#include <plat/system.h>
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
#include <linux/sysfs.h> #include <linux/sysfs.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/atomic.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <linux/atomic.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
...@@ -108,13 +108,7 @@ void omap1_pm_idle(void) ...@@ -108,13 +108,7 @@ void omap1_pm_idle(void)
__u32 use_idlect1 = arm_idlect1_mask; __u32 use_idlect1 = arm_idlect1_mask;
int do_sleep = 0; int do_sleep = 0;
local_irq_disable();
local_fiq_disable(); local_fiq_disable();
if (need_resched()) {
local_fiq_enable();
local_irq_enable();
return;
}
#if defined(CONFIG_OMAP_MPU_TIMER) && !defined(CONFIG_OMAP_DM_TIMER) #if defined(CONFIG_OMAP_MPU_TIMER) && !defined(CONFIG_OMAP_DM_TIMER)
#warning Enable 32kHz OS timer in order to allow sleep states in idle #warning Enable 32kHz OS timer in order to allow sleep states in idle
...@@ -157,14 +151,12 @@ void omap1_pm_idle(void) ...@@ -157,14 +151,12 @@ void omap1_pm_idle(void)
omap_writel(saved_idlect1, ARM_IDLECT1); omap_writel(saved_idlect1, ARM_IDLECT1);
local_fiq_enable(); local_fiq_enable();
local_irq_enable();
return; return;
} }
omap_sram_suspend(omap_readl(ARM_IDLECT1), omap_sram_suspend(omap_readl(ARM_IDLECT1),
omap_readl(ARM_IDLECT2)); omap_readl(ARM_IDLECT2));
local_fiq_enable(); local_fiq_enable();
local_irq_enable();
} }
/* /*
...@@ -583,8 +575,6 @@ static void omap_pm_init_proc(void) ...@@ -583,8 +575,6 @@ static void omap_pm_init_proc(void)
#endif /* DEBUG && CONFIG_PROC_FS */ #endif /* DEBUG && CONFIG_PROC_FS */
static void (*saved_idle)(void) = NULL;
/* /*
* omap_pm_prepare - Do preliminary suspend work. * omap_pm_prepare - Do preliminary suspend work.
* *
...@@ -592,8 +582,7 @@ static void (*saved_idle)(void) = NULL; ...@@ -592,8 +582,7 @@ static void (*saved_idle)(void) = NULL;
static int omap_pm_prepare(void) static int omap_pm_prepare(void)
{ {
/* We cannot sleep in idle until we have resumed */ /* We cannot sleep in idle until we have resumed */
saved_idle = pm_idle; disable_hlt();
pm_idle = NULL;
return 0; return 0;
} }
...@@ -630,7 +619,7 @@ static int omap_pm_enter(suspend_state_t state) ...@@ -630,7 +619,7 @@ static int omap_pm_enter(suspend_state_t state)
static void omap_pm_finish(void) static void omap_pm_finish(void)
{ {
pm_idle = saved_idle; enable_hlt();
} }
...@@ -687,7 +676,7 @@ static int __init omap_pm_init(void) ...@@ -687,7 +676,7 @@ static int __init omap_pm_init(void)
return -ENODEV; return -ENODEV;
} }
pm_idle = omap1_pm_idle; arm_pm_idle = omap1_pm_idle;
if (cpu_is_omap7xx()) if (cpu_is_omap7xx())
setup_irq(INT_7XX_WAKE_UP_REQ, &omap_wakeup_irq); setup_irq(INT_7XX_WAKE_UP_REQ, &omap_wakeup_irq);
......
/*
* arch/arm/mach-omap2/include/mach/system.h
*/
#include <plat/system.h>
...@@ -232,7 +232,6 @@ static int omap2_can_sleep(void) ...@@ -232,7 +232,6 @@ static int omap2_can_sleep(void)
static void omap2_pm_idle(void) static void omap2_pm_idle(void)
{ {
local_irq_disable();
local_fiq_disable(); local_fiq_disable();
if (!omap2_can_sleep()) { if (!omap2_can_sleep()) {
...@@ -249,7 +248,6 @@ static void omap2_pm_idle(void) ...@@ -249,7 +248,6 @@ static void omap2_pm_idle(void)
out: out:
local_fiq_enable(); local_fiq_enable();
local_irq_enable();
} }
#ifdef CONFIG_SUSPEND #ifdef CONFIG_SUSPEND
...@@ -468,7 +466,7 @@ static int __init omap2_pm_init(void) ...@@ -468,7 +466,7 @@ static int __init omap2_pm_init(void)
} }
suspend_set_ops(&omap_pm_ops); suspend_set_ops(&omap_pm_ops);
pm_idle = omap2_pm_idle; arm_pm_idle = omap2_pm_idle;
return 0; return 0;
} }
......
...@@ -418,10 +418,9 @@ void omap_sram_idle(void) ...@@ -418,10 +418,9 @@ void omap_sram_idle(void)
static void omap3_pm_idle(void) static void omap3_pm_idle(void)
{ {
local_irq_disable();
local_fiq_disable(); local_fiq_disable();
if (omap_irq_pending() || need_resched()) if (omap_irq_pending())
goto out; goto out;
trace_power_start(POWER_CSTATE, 1, smp_processor_id()); trace_power_start(POWER_CSTATE, 1, smp_processor_id());
...@@ -434,7 +433,6 @@ static void omap3_pm_idle(void) ...@@ -434,7 +433,6 @@ static void omap3_pm_idle(void)
out: out:
local_fiq_enable(); local_fiq_enable();
local_irq_enable();
} }
#ifdef CONFIG_SUSPEND #ifdef CONFIG_SUSPEND
...@@ -848,7 +846,7 @@ static int __init omap3_pm_init(void) ...@@ -848,7 +846,7 @@ static int __init omap3_pm_init(void)
suspend_set_ops(&omap_pm_ops); suspend_set_ops(&omap_pm_ops);
#endif /* CONFIG_SUSPEND */ #endif /* CONFIG_SUSPEND */
pm_idle = omap3_pm_idle; arm_pm_idle = omap3_pm_idle;
omap3_idle_init(); omap3_idle_init();
/* /*
......
...@@ -173,18 +173,16 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) ...@@ -173,18 +173,16 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
* omap_default_idle - OMAP4 default ilde routine.' * omap_default_idle - OMAP4 default ilde routine.'
* *
* Implements OMAP4 memory, IO ordering requirements which can't be addressed * Implements OMAP4 memory, IO ordering requirements which can't be addressed
* with default arch_idle() hook. Used by all CPUs with !CONFIG_CPUIDLE and * with default cpu_do_idle() hook. Used by all CPUs with !CONFIG_CPUIDLE and
* by secondary CPU with CONFIG_CPUIDLE. * by secondary CPU with CONFIG_CPUIDLE.
*/ */
static void omap_default_idle(void) static void omap_default_idle(void)
{ {
local_irq_disable();
local_fiq_disable(); local_fiq_disable();
omap_do_wfi(); omap_do_wfi();
local_fiq_enable(); local_fiq_enable();
local_irq_enable();
} }
/** /**
...@@ -255,8 +253,8 @@ static int __init omap4_pm_init(void) ...@@ -255,8 +253,8 @@ static int __init omap4_pm_init(void)
suspend_set_ops(&omap_pm_ops); suspend_set_ops(&omap_pm_ops);
#endif /* CONFIG_SUSPEND */ #endif /* CONFIG_SUSPEND */
/* Overwrite the default arch_idle() */ /* Overwrite the default cpu_do_idle() */
pm_idle = omap_default_idle; arm_pm_idle = omap_default_idle;
omap4_idle_init(); omap4_idle_init();
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <mach/system.h>
#include <plat/common.h> #include <plat/common.h>
#include <plat/prcm.h> #include <plat/prcm.h>
#include <plat/irqs.h> #include <plat/irqs.h>
......
/*
* arch/arm/mach-orion5x/include/mach/system.h
*
* Tzachi Perelstein <tzachi@marvell.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif
/*
* Copyright (c) 2011 Picochip Ltd., Jamie Iles
*
* 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.
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
/*
* This should do all the clock switching and wait for interrupt
* tricks.
*/
cpu_do_idle();
}
#endif /* __ASM_ARCH_SYSTEM_H */
/*
* arch/arm/mach-pnx4008/include/mach/system.h
*
* Copyright (C) 2003 Philips Semiconductors
* Copyright (C) 2005 MontaVista Software, Inc.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static void arch_idle(void)
{
cpu_do_idle();
}
#endif
/*
* arch/arm/mach-prima2/include/mach/system.h
*
* Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
*
* Licensed under GPLv2 or later.
*/
#ifndef __MACH_SYSTEM_H__
#define __MACH_SYSTEM_H__
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif
/*
* arch/arm/mach-pxa/include/mach/system.h
*
* Author: Nicolas Pitre
* Created: Jun 15, 2001
* Copyright: MontaVista Software Inc.
*
* 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.
*/
static inline void arch_idle(void)
{
cpu_do_idle();
}
/*
* arch/arm/mach-realview/include/mach/system.h
*
* Copyright (C) 2003 ARM Limited
* Copyright (C) 2000 Deep Blue Solutions Ltd
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
/*
* This should do all the clock switching
* and wait for interrupt tricks
*/
cpu_do_idle();
}
#endif
/*
* arch/arm/mach-rpc/include/mach/system.h
*
* Copyright (C) 1996-1999 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.
*/
static inline void arch_idle(void)
{
cpu_do_idle();
}
/* arch/arm/mach-s3c2410/include/mach/system.h
*
* Copyright (c) 2003 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* S3C2410 - System function defines and includes
*
* 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.
*/
#include <linux/io.h>
#include <mach/hardware.h>
#include <mach/map.h>
#include <mach/idle.h>
#include <mach/regs-clock.h>
void (*s3c24xx_idle)(void);
void s3c24xx_default_idle(void)
{
unsigned long tmp;
int i;
/* idle the system by using the idle mode which will wait for an
* interrupt to happen before restarting the system.
*/
/* Warning: going into idle state upsets jtag scanning */
__raw_writel(__raw_readl(S3C2410_CLKCON) | S3C2410_CLKCON_IDLE,
S3C2410_CLKCON);
/* the samsung port seems to do a loop and then unset idle.. */
for (i = 0; i < 50; i++) {
tmp += __raw_readl(S3C2410_CLKCON); /* ensure loop not optimised out */
}
/* this bit is not cleared on re-start... */
__raw_writel(__raw_readl(S3C2410_CLKCON) & ~S3C2410_CLKCON_IDLE,
S3C2410_CLKCON);
}
static void arch_idle(void)
{
if (s3c24xx_idle != NULL)
(s3c24xx_idle)();
else
s3c24xx_default_idle();
}
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include <asm/proc-fns.h> #include <asm/proc-fns.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <mach/idle.h>
#include <plat/cpu-freq.h> #include <plat/cpu-freq.h>
#include <mach/regs-clock.h> #include <mach/regs-clock.h>
...@@ -164,7 +162,7 @@ void __init s3c2412_map_io(void) ...@@ -164,7 +162,7 @@ void __init s3c2412_map_io(void)
/* set our idle function */ /* set our idle function */
s3c24xx_idle = s3c2412_idle; arm_pm_idle = s3c2412_idle;
/* register our io-tables */ /* register our io-tables */
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include <asm/proc-fns.h> #include <asm/proc-fns.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <mach/idle.h>
#include <mach/regs-s3c2443-clock.h> #include <mach/regs-s3c2443-clock.h>
#include <plat/gpio-core.h> #include <plat/gpio-core.h>
...@@ -88,8 +87,6 @@ int __init s3c2416_init(void) ...@@ -88,8 +87,6 @@ int __init s3c2416_init(void)
{ {
printk(KERN_INFO "S3C2416: Initializing architecture\n"); printk(KERN_INFO "S3C2416: Initializing architecture\n");
/* s3c24xx_idle = s3c2416_idle; */
/* change WDT IRQ number */ /* change WDT IRQ number */
s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT; s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT;
s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT; s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT;
......
/* linux/arch/arm/mach-s3c6400/include/mach/system.h
*
* Copyright 2008 Openmoko, Inc.
* Copyright 2008 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
* http://armlinux.simtec.co.uk/
*
* S3C6400 - system implementation
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H __FILE__
static void arch_idle(void)
{
/* nothing here yet */
}
#endif /* __ASM_ARCH_IRQ_H */
...@@ -146,15 +146,12 @@ static void s5p64x0_idle(void) ...@@ -146,15 +146,12 @@ static void s5p64x0_idle(void)
{ {
unsigned long val; unsigned long val;
if (!need_resched()) { val = __raw_readl(S5P64X0_PWR_CFG);
val = __raw_readl(S5P64X0_PWR_CFG); val &= ~(0x3 << 5);
val &= ~(0x3 << 5); val |= (0x1 << 5);
val |= (0x1 << 5); __raw_writel(val, S5P64X0_PWR_CFG);
__raw_writel(val, S5P64X0_PWR_CFG);
cpu_do_idle(); cpu_do_idle();
}
local_irq_enable();
} }
/* /*
...@@ -286,7 +283,7 @@ int __init s5p64x0_init(void) ...@@ -286,7 +283,7 @@ int __init s5p64x0_init(void)
printk(KERN_INFO "S5P64X0(S5P6440/S5P6450): Initializing architecture\n"); printk(KERN_INFO "S5P64X0(S5P6440/S5P6450): Initializing architecture\n");
/* set idle function */ /* set idle function */
pm_idle = s5p64x0_idle; arm_pm_idle = s5p64x0_idle;
return device_register(&s5p64x0_dev); return device_register(&s5p64x0_dev);
} }
......
/* linux/arch/arm/mach-s5p64x0/include/mach/system.h
*
* Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* S5P64X0 - system support header
*
* 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 __FILE__
static void arch_idle(void)
{
/* nothing here yet */
}
#endif /* __ASM_ARCH_SYSTEM_H */
...@@ -129,14 +129,6 @@ static struct map_desc s5pc100_iodesc[] __initdata = { ...@@ -129,14 +129,6 @@ static struct map_desc s5pc100_iodesc[] __initdata = {
} }
}; };
static void s5pc100_idle(void)
{
if (!need_resched())
cpu_do_idle();
local_irq_enable();
}
/* /*
* s5pc100_map_io * s5pc100_map_io
* *
...@@ -210,10 +202,6 @@ core_initcall(s5pc100_core_init); ...@@ -210,10 +202,6 @@ core_initcall(s5pc100_core_init);
int __init s5pc100_init(void) int __init s5pc100_init(void)
{ {
printk(KERN_INFO "S5PC100: Initializing architecture\n"); printk(KERN_INFO "S5PC100: Initializing architecture\n");
/* set idle function */
pm_idle = s5pc100_idle;
return device_register(&s5pc100_dev); return device_register(&s5pc100_dev);
} }
......
/* linux/arch/arm/mach-s5pc100/include/mach/system.h
*
* Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com>
*
* S5PC100 - system implementation
*
* Based on mach-s3c6400/include/mach/system.h
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H __FILE__
static void arch_idle(void)
{
/* nothing here yet */
}
#endif /* __ASM_ARCH_IRQ_H */
...@@ -142,14 +142,6 @@ static struct map_desc s5pv210_iodesc[] __initdata = { ...@@ -142,14 +142,6 @@ static struct map_desc s5pv210_iodesc[] __initdata = {
} }
}; };
static void s5pv210_idle(void)
{
if (!need_resched())
cpu_do_idle();
local_irq_enable();
}
void s5pv210_restart(char mode, const char *cmd) void s5pv210_restart(char mode, const char *cmd)
{ {
__raw_writel(0x1, S5P_SWRESET); __raw_writel(0x1, S5P_SWRESET);
...@@ -247,10 +239,6 @@ core_initcall(s5pv210_core_init); ...@@ -247,10 +239,6 @@ core_initcall(s5pv210_core_init);
int __init s5pv210_init(void) int __init s5pv210_init(void)
{ {
printk(KERN_INFO "S5PV210: Initializing architecture\n"); printk(KERN_INFO "S5PV210: Initializing architecture\n");
/* set idle function */
pm_idle = s5pv210_idle;
return device_register(&s5pv210_dev); return device_register(&s5pv210_dev);
} }
......
/* linux/arch/arm/mach-s5pv210/include/mach/system.h
*
* Copyright (c) 2010 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
* S5PV210 - system support header
*
* 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 __FILE__
static void arch_idle(void)
{
/* nothing here yet */
}
#endif /* __ASM_ARCH_SYSTEM_H */
/*
* arch/arm/mach-sa1100/include/mach/system.h
*
* Copyright (c) 1999 Nicolas Pitre <nico@fluxnic.net>
*/
static inline void arch_idle(void)
{
cpu_do_idle();
}
...@@ -149,10 +149,16 @@ static struct sys_timer shark_timer = { ...@@ -149,10 +149,16 @@ static struct sys_timer shark_timer = {
.init = shark_timer_init, .init = shark_timer_init,
}; };
static void shark_init_early(void)
{
disable_hlt();
}
MACHINE_START(SHARK, "Shark") MACHINE_START(SHARK, "Shark")
/* Maintainer: Alexander Schulz */ /* Maintainer: Alexander Schulz */
.atag_offset = 0x3000, .atag_offset = 0x3000,
.map_io = shark_map_io, .map_io = shark_map_io,
.init_early = shark_init_early,
.init_irq = shark_init_irq, .init_irq = shark_init_irq,
.timer = &shark_timer, .timer = &shark_timer,
.dma_zone_size = SZ_4M, .dma_zone_size = SZ_4M,
......
/*
* arch/arm/mach-shark/include/mach/system.h
*
* by Alexander Schulz
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
}
#endif
#ifndef __ASM_ARCH_SYSTEM_H #ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H #define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
cpu_do_idle();
}
static inline void arch_reset(char mode, const char *cmd) static inline void arch_reset(char mode, const char *cmd)
{ {
soft_restart(0); soft_restart(0);
......
/*
* arch/arm/mach-spear3xx/include/mach/system.h
*
* SPEAr3xx Machine family specific architecture functions
*
* Copyright (C) 2009 ST Microelectronics
* Viresh Kumar<viresh.kumar@st.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef __MACH_SYSTEM_H
#define __MACH_SYSTEM_H
#include <plat/system.h>
#endif /* __MACH_SYSTEM_H */
/*
* arch/arm/mach-spear6xx/include/mach/system.h
*
* SPEAr6xx Machine family specific architecture functions
*
* Copyright (C) 2009 ST Microelectronics
* Rajeev Kumar<rajeev-dlh.kumar@st.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef __MACH_SYSTEM_H
#define __MACH_SYSTEM_H
#include <plat/system.h>
#endif /* __MACH_SYSTEM_H */
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <asm/hardware/gic.h> #include <asm/hardware/gic.h>
#include <mach/iomap.h> #include <mach/iomap.h>
#include <mach/system.h>
#include "board.h" #include "board.h"
#include "clock.h" #include "clock.h"
...@@ -96,6 +95,8 @@ static void __init tegra_init_cache(u32 tag_latency, u32 data_latency) ...@@ -96,6 +95,8 @@ static void __init tegra_init_cache(u32 tag_latency, u32 data_latency)
#ifdef CONFIG_ARCH_TEGRA_2x_SOC #ifdef CONFIG_ARCH_TEGRA_2x_SOC
void __init tegra20_init_early(void) void __init tegra20_init_early(void)
{ {
disable_hlt(); /* idle WFI usage needs to be confirmed */
tegra_init_fuse(); tegra_init_fuse();
tegra2_init_clocks(); tegra2_init_clocks();
tegra_clk_init_from_table(tegra20_clk_init_table); tegra_clk_init_from_table(tegra20_clk_init_table);
......
/*
* arch/arm/mach-tegra/include/mach/system.h
*
* Copyright (C) 2010 Google, Inc.
*
* Author:
* Colin Cross <ccross@google.com>
* Erik Gilling <konkers@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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.
*
*/
#ifndef __MACH_TEGRA_SYSTEM_H
#define __MACH_TEGRA_SYSTEM_H
static inline void arch_idle(void)
{
}
#endif
/*
*
* arch/arm/mach-u300/include/mach/system.h
*
*
* Copyright (C) 2007-2009 ST-Ericsson AB
* License terms: GNU General Public License (GPL) version 2
* System shutdown and reset functions.
* Author: Linus Walleij <linus.walleij@stericsson.com>
*/
static inline void arch_idle(void)
{
cpu_do_idle();
}
/*
* Copyright (C) 2009 ST-Ericsson.
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
/*
* This should do all the clock switching
* and wait for interrupt tricks
*/
cpu_do_idle();
}
#endif
/*
* arch/arm/mach-versatile/include/mach/system.h
*
* Copyright (C) 2003 ARM Limited
* Copyright (C) 2000 Deep Blue Solutions Ltd
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
/*
* This should do all the clock switching
* and wait for interrupt tricks
*/
cpu_do_idle();
}
#endif
/*
* arch/arm/mach-vexpress/include/mach/system.h
*
* Copyright (C) 2003 ARM Limited
* Copyright (C) 2000 Deep Blue Solutions Ltd
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
static inline void arch_idle(void)
{
/*
* This should do all the clock switching
* and wait for interrupt tricks
*/
cpu_do_idle();
}
#endif
...@@ -7,11 +7,6 @@ ...@@ -7,11 +7,6 @@
/* PM Software Reset request register */ /* PM Software Reset request register */
#define VT8500_PMSR_VIRT 0xf8130060 #define VT8500_PMSR_VIRT 0xf8130060
static inline void arch_idle(void)
{
cpu_do_idle();
}
static inline void arch_reset(char mode, const char *cmd) static inline void arch_reset(char mode, const char *cmd)
{ {
writel(1, VT8500_PMSR_VIRT); writel(1, VT8500_PMSR_VIRT);
......
...@@ -530,6 +530,7 @@ static struct platform_device *nuc900_public_dev[] __initdata = { ...@@ -530,6 +530,7 @@ static struct platform_device *nuc900_public_dev[] __initdata = {
void __init nuc900_board_init(struct platform_device **device, int size) void __init nuc900_board_init(struct platform_device **device, int size)
{ {
disable_hlt();
platform_add_devices(device, size); platform_add_devices(device, size);
platform_add_devices(nuc900_public_dev, ARRAY_SIZE(nuc900_public_dev)); platform_add_devices(nuc900_public_dev, ARRAY_SIZE(nuc900_public_dev));
spi_register_board_info(nuc900_spi_board_info, spi_register_board_info(nuc900_spi_board_info,
......
/*
* arch/arm/mach-w90x900/include/mach/system.h
*
* Copyright (c) 2008 Nuvoton technology corporation
* All rights reserved.
*
* Wan ZongShun <mcuos.com@gmail.com>
*
* Based on arch/arm/mach-s3c2410/include/mach/system.h
*
* 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.
*
*/
static void arch_idle(void)
{
}
/* arch/arm/mach-zynq/include/mach/system.h
*
* Copyright (C) 2011 Xilinx
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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.
*/
#ifndef __MACH_SYSTEM_H__
#define __MACH_SYSTEM_H__
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif
/*
* Copyright (C) 1999 ARM Limited
* Copyright (C) 2000 Deep Blue Solutions Ltd
* Copyright 2004-2008 Freescale Semiconductor, Inc. All Rights Reserved.
*
* 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.
*/
#ifndef __ASM_ARCH_MXC_SYSTEM_H__
#define __ASM_ARCH_MXC_SYSTEM_H__
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */
/*
* Copied from arch/arm/mach-sa1100/include/mach/system.h
* Copyright (c) 1999 Nicolas Pitre <nico@fluxnic.net>
*/
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#include <asm/proc-fns.h>
static inline void arch_idle(void)
{
cpu_do_idle();
}
#endif
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/regs-clock.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
...@@ -190,8 +191,34 @@ static unsigned long s3c24xx_read_idcode_v4(void) ...@@ -190,8 +191,34 @@ static unsigned long s3c24xx_read_idcode_v4(void)
return __raw_readl(S3C2410_GSTATUS1); return __raw_readl(S3C2410_GSTATUS1);
} }
static void s3c24xx_default_idle(void)
{
unsigned long tmp;
int i;
/* idle the system by using the idle mode which will wait for an
* interrupt to happen before restarting the system.
*/
/* Warning: going into idle state upsets jtag scanning */
__raw_writel(__raw_readl(S3C2410_CLKCON) | S3C2410_CLKCON_IDLE,
S3C2410_CLKCON);
/* the samsung port seems to do a loop and then unset idle.. */
for (i = 0; i < 50; i++)
tmp += __raw_readl(S3C2410_CLKCON); /* ensure loop not optimised out */
/* this bit is not cleared on re-start... */
__raw_writel(__raw_readl(S3C2410_CLKCON) & ~S3C2410_CLKCON_IDLE,
S3C2410_CLKCON);
}
void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
{ {
arm_pm_idle = s3c24xx_default_idle;
/* initialise the io descriptors we need for initialisation */ /* initialise the io descriptors we need for initialisation */
iotable_init(mach_desc, size); iotable_init(mach_desc, size);
iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc)); iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
......
/*
* arch/arm/plat-spear/include/plat/system.h
*
* SPEAr platform specific architecture functions
*
* Copyright (C) 2009 ST Microelectronics
* Viresh Kumar<viresh.kumar@st.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef __PLAT_SYSTEM_H
#define __PLAT_SYSTEM_H
static inline void arch_idle(void)
{
/*
* This should do all the clock switching
* and wait for interrupt tricks
*/
cpu_do_idle();
}
#endif /* __PLAT_SYSTEM_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment