diff options
author | Andrew Victor <linux@maxim.org.za> | 2008-04-02 16:36:06 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-04 04:52:19 -0400 |
commit | 3ef2fb426775fc2ae19b70c318dbdf4a0aeeced7 (patch) | |
tree | edf90c662cfd9c4e9106eaef6a71a042200b8f78 | |
parent | b78eabde89f9b19d463a77abe420508c0ef29249 (diff) |
[ARM] 4903/1: [AT91] SAM9/CAP9 system shutdown
Enable system shutdown/power-off on AT91SAM9 and AT91CAP9 based boards.
This does not require power-management to be enabled, and the
pm_power_off method can be overridden in board-specific files if
necessary.
Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-at91/at91cap9.c | 9 | ||||
-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/at91sam9rl.c | 8 |
5 files changed, 41 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c index 48d27d8000b0..933fa8f55cbc 100644 --- a/arch/arm/mach-at91/at91cap9.c +++ b/arch/arm/mach-at91/at91cap9.c | |||
@@ -13,12 +13,14 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/pm.h> | ||
16 | 17 | ||
17 | #include <asm/mach/arch.h> | 18 | #include <asm/mach/arch.h> |
18 | #include <asm/mach/map.h> | 19 | #include <asm/mach/map.h> |
19 | #include <asm/arch/at91cap9.h> | 20 | #include <asm/arch/at91cap9.h> |
20 | #include <asm/arch/at91_pmc.h> | 21 | #include <asm/arch/at91_pmc.h> |
21 | #include <asm/arch/at91_rstc.h> | 22 | #include <asm/arch/at91_rstc.h> |
23 | #include <asm/arch/at91_shdwc.h> | ||
22 | 24 | ||
23 | #include "generic.h" | 25 | #include "generic.h" |
24 | #include "clock.h" | 26 | #include "clock.h" |
@@ -288,6 +290,12 @@ static void at91cap9_reset(void) | |||
288 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | 290 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); |
289 | } | 291 | } |
290 | 292 | ||
293 | static void at91cap9_poweroff(void) | ||
294 | { | ||
295 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | ||
296 | } | ||
297 | |||
298 | |||
291 | /* -------------------------------------------------------------------- | 299 | /* -------------------------------------------------------------------- |
292 | * AT91CAP9 processor initialization | 300 | * AT91CAP9 processor initialization |
293 | * -------------------------------------------------------------------- */ | 301 | * -------------------------------------------------------------------- */ |
@@ -298,6 +306,7 @@ void __init at91cap9_initialize(unsigned long main_clock) | |||
298 | iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc)); | 306 | iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc)); |
299 | 307 | ||
300 | at91_arch_reset = at91cap9_reset; | 308 | at91_arch_reset = at91cap9_reset; |
309 | pm_power_off = at91cap9_poweroff; | ||
301 | at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); | 310 | at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); |
302 | 311 | ||
303 | /* Init clock subsystem */ | 312 | /* Init clock subsystem */ |
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index 18d06612ce8a..ee26550cdc21 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -11,6 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/pm.h> | ||
14 | 15 | ||
15 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
16 | #include <asm/mach/map.h> | 17 | #include <asm/mach/map.h> |
@@ -18,6 +19,7 @@ | |||
18 | #include <asm/arch/at91sam9260.h> | 19 | #include <asm/arch/at91sam9260.h> |
19 | #include <asm/arch/at91_pmc.h> | 20 | #include <asm/arch/at91_pmc.h> |
20 | #include <asm/arch/at91_rstc.h> | 21 | #include <asm/arch/at91_rstc.h> |
22 | #include <asm/arch/at91_shdwc.h> | ||
21 | 23 | ||
22 | #include "generic.h" | 24 | #include "generic.h" |
23 | #include "clock.h" | 25 | #include "clock.h" |
@@ -267,6 +269,11 @@ static void at91sam9260_reset(void) | |||
267 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | 269 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); |
268 | } | 270 | } |
269 | 271 | ||
272 | static void at91sam9260_poweroff(void) | ||
273 | { | ||
274 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | ||
275 | } | ||
276 | |||
270 | 277 | ||
271 | /* -------------------------------------------------------------------- | 278 | /* -------------------------------------------------------------------- |
272 | * AT91SAM9260 processor initialization | 279 | * AT91SAM9260 processor initialization |
@@ -304,6 +311,7 @@ void __init at91sam9260_initialize(unsigned long main_clock) | |||
304 | iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc)); | 311 | iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc)); |
305 | 312 | ||
306 | at91_arch_reset = at91sam9260_reset; | 313 | at91_arch_reset = at91sam9260_reset; |
314 | pm_power_off = at91sam9260_poweroff; | ||
307 | at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) | 315 | at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) |
308 | | (1 << AT91SAM9260_ID_IRQ2); | 316 | | (1 << AT91SAM9260_ID_IRQ2); |
309 | 317 | ||
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index 90b87e1877d9..35bf6fd52516 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c | |||
@@ -11,12 +11,14 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/pm.h> | ||
14 | 15 | ||
15 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
16 | #include <asm/mach/map.h> | 17 | #include <asm/mach/map.h> |
17 | #include <asm/arch/at91sam9261.h> | 18 | #include <asm/arch/at91sam9261.h> |
18 | #include <asm/arch/at91_pmc.h> | 19 | #include <asm/arch/at91_pmc.h> |
19 | #include <asm/arch/at91_rstc.h> | 20 | #include <asm/arch/at91_rstc.h> |
21 | #include <asm/arch/at91_shdwc.h> | ||
20 | 22 | ||
21 | #include "generic.h" | 23 | #include "generic.h" |
22 | #include "clock.h" | 24 | #include "clock.h" |
@@ -245,6 +247,11 @@ static void at91sam9261_reset(void) | |||
245 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | 247 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); |
246 | } | 248 | } |
247 | 249 | ||
250 | static void at91sam9261_poweroff(void) | ||
251 | { | ||
252 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | ||
253 | } | ||
254 | |||
248 | 255 | ||
249 | /* -------------------------------------------------------------------- | 256 | /* -------------------------------------------------------------------- |
250 | * AT91SAM9261 processor initialization | 257 | * AT91SAM9261 processor initialization |
@@ -256,6 +263,7 @@ void __init at91sam9261_initialize(unsigned long main_clock) | |||
256 | iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc)); | 263 | iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc)); |
257 | 264 | ||
258 | at91_arch_reset = at91sam9261_reset; | 265 | at91_arch_reset = at91sam9261_reset; |
266 | pm_power_off = at91sam9261_poweroff; | ||
259 | at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) | 267 | at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) |
260 | | (1 << AT91SAM9261_ID_IRQ2); | 268 | | (1 << AT91SAM9261_ID_IRQ2); |
261 | 269 | ||
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index a53ba0f74351..052074a9f2d3 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
@@ -11,12 +11,14 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/pm.h> | ||
14 | 15 | ||
15 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
16 | #include <asm/mach/map.h> | 17 | #include <asm/mach/map.h> |
17 | #include <asm/arch/at91sam9263.h> | 18 | #include <asm/arch/at91sam9263.h> |
18 | #include <asm/arch/at91_pmc.h> | 19 | #include <asm/arch/at91_pmc.h> |
19 | #include <asm/arch/at91_rstc.h> | 20 | #include <asm/arch/at91_rstc.h> |
21 | #include <asm/arch/at91_shdwc.h> | ||
20 | 22 | ||
21 | #include "generic.h" | 23 | #include "generic.h" |
22 | #include "clock.h" | 24 | #include "clock.h" |
@@ -271,6 +273,11 @@ static void at91sam9263_reset(void) | |||
271 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | 273 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); |
272 | } | 274 | } |
273 | 275 | ||
276 | static void at91sam9263_poweroff(void) | ||
277 | { | ||
278 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | ||
279 | } | ||
280 | |||
274 | 281 | ||
275 | /* -------------------------------------------------------------------- | 282 | /* -------------------------------------------------------------------- |
276 | * AT91SAM9263 processor initialization | 283 | * AT91SAM9263 processor initialization |
@@ -282,6 +289,7 @@ void __init at91sam9263_initialize(unsigned long main_clock) | |||
282 | iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc)); | 289 | iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc)); |
283 | 290 | ||
284 | at91_arch_reset = at91sam9263_reset; | 291 | at91_arch_reset = at91sam9263_reset; |
292 | pm_power_off = at91sam9263_poweroff; | ||
285 | at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); | 293 | at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); |
286 | 294 | ||
287 | /* Init clock subsystem */ | 295 | /* Init clock subsystem */ |
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c index 4813a35f6cf5..902c79893ec7 100644 --- a/arch/arm/mach-at91/at91sam9rl.c +++ b/arch/arm/mach-at91/at91sam9rl.c | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/pm.h> | ||
13 | 14 | ||
14 | #include <asm/mach/arch.h> | 15 | #include <asm/mach/arch.h> |
15 | #include <asm/mach/map.h> | 16 | #include <asm/mach/map.h> |
@@ -17,6 +18,7 @@ | |||
17 | #include <asm/arch/at91sam9rl.h> | 18 | #include <asm/arch/at91sam9rl.h> |
18 | #include <asm/arch/at91_pmc.h> | 19 | #include <asm/arch/at91_pmc.h> |
19 | #include <asm/arch/at91_rstc.h> | 20 | #include <asm/arch/at91_rstc.h> |
21 | #include <asm/arch/at91_shdwc.h> | ||
20 | 22 | ||
21 | #include "generic.h" | 23 | #include "generic.h" |
22 | #include "clock.h" | 24 | #include "clock.h" |
@@ -244,6 +246,11 @@ static void at91sam9rl_reset(void) | |||
244 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | 246 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); |
245 | } | 247 | } |
246 | 248 | ||
249 | static void at91sam9rl_poweroff(void) | ||
250 | { | ||
251 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | ||
252 | } | ||
253 | |||
247 | 254 | ||
248 | /* -------------------------------------------------------------------- | 255 | /* -------------------------------------------------------------------- |
249 | * AT91SAM9RL processor initialization | 256 | * AT91SAM9RL processor initialization |
@@ -274,6 +281,7 @@ void __init at91sam9rl_initialize(unsigned long main_clock) | |||
274 | iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc)); | 281 | iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc)); |
275 | 282 | ||
276 | at91_arch_reset = at91sam9rl_reset; | 283 | at91_arch_reset = at91sam9rl_reset; |
284 | pm_power_off = at91sam9rl_poweroff; | ||
277 | at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); | 285 | at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); |
278 | 286 | ||
279 | /* Init clock subsystem */ | 287 | /* Init clock subsystem */ |