diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-08-02 10:21:36 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2012-01-20 18:55:10 -0500 |
commit | c9dfafbaca0b66a6665242d019b3b9c5be056fcf (patch) | |
tree | 68163a95d873055cfa97ea4b62be848adb9d59bd /arch | |
parent | 8dd67188834314fd6a8426e17f56c7a103c57d9c (diff) |
ARM: mach-at91: move special idle code out of line
... and hook it to arm_pm_idle.
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-at91/at91cap9.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91rm9200.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9261.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91x40.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/system.h | 21 |
9 files changed, 69 insertions, 21 deletions
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c index edb879ac04c8..1d29a6cbbae2 100644 --- a/arch/arm/mach-at91/at91cap9.c +++ b/arch/arm/mach-at91/at91cap9.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | 16 | ||
17 | #include <asm/proc-fns.h> | ||
17 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
18 | #include <asm/mach/arch.h> | 19 | #include <asm/mach/arch.h> |
19 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
@@ -314,6 +315,12 @@ static struct at91_gpio_bank at91cap9_gpio[] __initdata = { | |||
314 | } | 315 | } |
315 | }; | 316 | }; |
316 | 317 | ||
318 | static void at91cap9_idle(void) | ||
319 | { | ||
320 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | ||
321 | cpu_do_idle(); | ||
322 | } | ||
323 | |||
317 | static void at91cap9_restart(char mode, const char *cmd) | 324 | static void at91cap9_restart(char mode, const char *cmd) |
318 | { | 325 | { |
319 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | 326 | 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 | 344 | ||
338 | static void __init at91cap9_initialize(void) | 345 | static void __init at91cap9_initialize(void) |
339 | { | 346 | { |
347 | arm_pm_idle = at91cap9_idle; | ||
340 | arm_pm_restart = at91cap9_restart; | 348 | arm_pm_restart = at91cap9_restart; |
341 | at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); | 349 | at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); |
342 | 350 | ||
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c index 99c3174e24a2..dd6e2de13420 100644 --- a/arch/arm/mach-at91/at91rm9200.c +++ b/arch/arm/mach-at91/at91rm9200.c | |||
@@ -289,6 +289,15 @@ static struct at91_gpio_bank at91rm9200_gpio[] __initdata = { | |||
289 | } | 289 | } |
290 | }; | 290 | }; |
291 | 291 | ||
292 | static void at91rm9200_idle(void) | ||
293 | { | ||
294 | /* | ||
295 | * Disable the processor clock. The processor will be automatically | ||
296 | * re-enabled by an interrupt or by a reset. | ||
297 | */ | ||
298 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | ||
299 | } | ||
300 | |||
292 | static void at91rm9200_restart(char mode, const char *cmd) | 301 | static void at91rm9200_restart(char mode, const char *cmd) |
293 | { | 302 | { |
294 | /* | 303 | /* |
@@ -314,6 +323,7 @@ static void __init at91rm9200_ioremap_registers(void) | |||
314 | 323 | ||
315 | static void __init at91rm9200_initialize(void) | 324 | static void __init at91rm9200_initialize(void) |
316 | { | 325 | { |
326 | arm_pm_idle = at91rm9200_idle; | ||
317 | arm_pm_restart = at91rm9200_restart; | 327 | arm_pm_restart = at91rm9200_restart; |
318 | at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1) | 328 | at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1) |
319 | | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3) | 329 | | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3) |
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index 5e46e4a96430..cfe6dd747cc5 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | 14 | ||
15 | #include <asm/proc-fns.h> | ||
15 | #include <asm/irq.h> | 16 | #include <asm/irq.h> |
16 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
17 | #include <asm/mach/map.h> | 18 | #include <asm/mach/map.h> |
@@ -327,8 +328,15 @@ static void __init at91sam9260_ioremap_registers(void) | |||
327 | at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC); | 328 | at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC); |
328 | } | 329 | } |
329 | 330 | ||
331 | static void at91sam9260_idle(void) | ||
332 | { | ||
333 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | ||
334 | cpu_do_idle(); | ||
335 | } | ||
336 | |||
330 | static void __init at91sam9260_initialize(void) | 337 | static void __init at91sam9260_initialize(void) |
331 | { | 338 | { |
339 | arm_pm_idle = at91sam9260_idle; | ||
332 | arm_pm_restart = at91sam9_alt_restart; | 340 | arm_pm_restart = at91sam9_alt_restart; |
333 | at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) | 341 | at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) |
334 | | (1 << AT91SAM9260_ID_IRQ2); | 342 | | (1 << AT91SAM9260_ID_IRQ2); |
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index b85b9ea60170..76ffbe67fffa 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | 14 | ||
15 | #include <asm/proc-fns.h> | ||
15 | #include <asm/irq.h> | 16 | #include <asm/irq.h> |
16 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
17 | #include <asm/mach/map.h> | 18 | #include <asm/mach/map.h> |
@@ -285,8 +286,15 @@ static void __init at91sam9261_ioremap_registers(void) | |||
285 | at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC); | 286 | at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC); |
286 | } | 287 | } |
287 | 288 | ||
289 | static void at91sam9261_idle(void) | ||
290 | { | ||
291 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | ||
292 | cpu_do_idle(); | ||
293 | } | ||
294 | |||
288 | static void __init at91sam9261_initialize(void) | 295 | static void __init at91sam9261_initialize(void) |
289 | { | 296 | { |
297 | arm_pm_idle = at91sam9261_idle; | ||
290 | arm_pm_restart = at91sam9_alt_restart; | 298 | arm_pm_restart = at91sam9_alt_restart; |
291 | at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) | 299 | at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) |
292 | | (1 << AT91SAM9261_ID_IRQ2); | 300 | | (1 << AT91SAM9261_ID_IRQ2); |
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index 79e3669b1117..bcce7e2ca2f5 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | 14 | ||
15 | #include <asm/proc-fns.h> | ||
15 | #include <asm/irq.h> | 16 | #include <asm/irq.h> |
16 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
17 | #include <asm/mach/map.h> | 18 | #include <asm/mach/map.h> |
@@ -306,8 +307,15 @@ static void __init at91sam9263_ioremap_registers(void) | |||
306 | at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1); | 307 | at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1); |
307 | } | 308 | } |
308 | 309 | ||
310 | static void at91sam9263_idle(void) | ||
311 | { | ||
312 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | ||
313 | cpu_do_idle(); | ||
314 | } | ||
315 | |||
309 | static void __init at91sam9263_initialize(void) | 316 | static void __init at91sam9263_initialize(void) |
310 | { | 317 | { |
318 | arm_pm_idle = at91sam9263_idle; | ||
311 | arm_pm_restart = at91sam9_alt_restart; | 319 | arm_pm_restart = at91sam9_alt_restart; |
312 | at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); | 320 | at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); |
313 | 321 | ||
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c index 7032dd32cdf0..0e80b395214d 100644 --- a/arch/arm/mach-at91/at91sam9g45.c +++ b/arch/arm/mach-at91/at91sam9g45.c | |||
@@ -318,6 +318,12 @@ static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = { | |||
318 | } | 318 | } |
319 | }; | 319 | }; |
320 | 320 | ||
321 | static void at91sam9g45_idle(void) | ||
322 | { | ||
323 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | ||
324 | cpu_do_idle(); | ||
325 | } | ||
326 | |||
321 | static void at91sam9g45_restart(char mode, const char *cmd) | 327 | static void at91sam9g45_restart(char mode, const char *cmd) |
322 | { | 328 | { |
323 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | 329 | 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 | 348 | ||
343 | static void __init at91sam9g45_initialize(void) | 349 | static void __init at91sam9g45_initialize(void) |
344 | { | 350 | { |
351 | arm_pm_idle = at91sam9g45_idle; | ||
345 | arm_pm_restart = at91sam9g45_restart; | 352 | arm_pm_restart = at91sam9g45_restart; |
346 | at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0); | 353 | at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0); |
347 | 354 | ||
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c index d6bcb1da11df..e00939420405 100644 --- a/arch/arm/mach-at91/at91sam9rl.c +++ b/arch/arm/mach-at91/at91sam9rl.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | 13 | ||
14 | #include <asm/proc-fns.h> | ||
14 | #include <asm/irq.h> | 15 | #include <asm/irq.h> |
15 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
16 | #include <asm/mach/map.h> | 17 | #include <asm/mach/map.h> |
@@ -290,8 +291,15 @@ static void __init at91sam9rl_ioremap_registers(void) | |||
290 | at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC); | 291 | at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC); |
291 | } | 292 | } |
292 | 293 | ||
294 | static void at91sam9rl_idle(void) | ||
295 | { | ||
296 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | ||
297 | cpu_do_idle(); | ||
298 | } | ||
299 | |||
293 | static void __init at91sam9rl_initialize(void) | 300 | static void __init at91sam9rl_initialize(void) |
294 | { | 301 | { |
302 | arm_pm_idle = at91sam9rl_idle; | ||
295 | arm_pm_restart = at91sam9_alt_restart; | 303 | arm_pm_restart = at91sam9_alt_restart; |
296 | at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); | 304 | at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); |
297 | 305 | ||
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c index 56ba3bd035ae..0154b7f44ff1 100644 --- a/arch/arm/mach-at91/at91x40.c +++ b/arch/arm/mach-at91/at91x40.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <asm/proc-fns.h> | ||
16 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
17 | #include <mach/at91x40.h> | 18 | #include <mach/at91x40.h> |
18 | #include <mach/at91_st.h> | 19 | #include <mach/at91_st.h> |
@@ -37,8 +38,19 @@ unsigned long clk_get_rate(struct clk *clk) | |||
37 | return AT91X40_MASTER_CLOCK; | 38 | return AT91X40_MASTER_CLOCK; |
38 | } | 39 | } |
39 | 40 | ||
41 | static void at91x40_idle(void) | ||
42 | { | ||
43 | /* | ||
44 | * Disable the processor clock. The processor will be automatically | ||
45 | * re-enabled by an interrupt or by a reset. | ||
46 | */ | ||
47 | at91_sys_write(AT91_PS_CR, AT91_PS_CR_CPU); | ||
48 | cpu_do_idle(); | ||
49 | } | ||
50 | |||
40 | void __init at91x40_initialize(unsigned long main_clock) | 51 | void __init at91x40_initialize(unsigned long main_clock) |
41 | { | 52 | { |
53 | arm_pm_idle = at91x40_idle; | ||
42 | at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1) | 54 | at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1) |
43 | | (1 << AT91X40_ID_IRQ2); | 55 | | (1 << AT91X40_ID_IRQ2); |
44 | } | 56 | } |
diff --git a/arch/arm/mach-at91/include/mach/system.h b/arch/arm/mach-at91/include/mach/system.h index cbd64f3bcecd..ba85c441cac7 100644 --- a/arch/arm/mach-at91/include/mach/system.h +++ b/arch/arm/mach-at91/include/mach/system.h | |||
@@ -21,30 +21,9 @@ | |||
21 | #ifndef __ASM_ARCH_SYSTEM_H | 21 | #ifndef __ASM_ARCH_SYSTEM_H |
22 | #define __ASM_ARCH_SYSTEM_H | 22 | #define __ASM_ARCH_SYSTEM_H |
23 | 23 | ||
24 | #include <mach/hardware.h> | ||
25 | #include <mach/at91_st.h> | ||
26 | #include <mach/at91_dbgu.h> | ||
27 | #include <mach/at91_pmc.h> | ||
28 | |||
29 | static inline void arch_idle(void) | 24 | static inline void arch_idle(void) |
30 | { | 25 | { |
31 | /* | ||
32 | * Disable the processor clock. The processor will be automatically | ||
33 | * re-enabled by an interrupt or by a reset. | ||
34 | */ | ||
35 | #ifdef AT91_PS | ||
36 | at91_sys_write(AT91_PS_CR, AT91_PS_CR_CPU); | ||
37 | #else | ||
38 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | ||
39 | #endif | ||
40 | #ifndef CONFIG_CPU_ARM920T | ||
41 | /* | ||
42 | * Set the processor (CP15) into 'Wait for Interrupt' mode. | ||
43 | * Post-RM9200 processors need this in conjunction with the above | ||
44 | * to save power when idle. | ||
45 | */ | ||
46 | cpu_do_idle(); | 26 | cpu_do_idle(); |
47 | #endif | ||
48 | } | 27 | } |
49 | 28 | ||
50 | #endif | 29 | #endif |