diff options
-rw-r--r-- | arch/powerpc/sysdev/6xx-suspend.S | 52 | ||||
-rw-r--r-- | arch/powerpc/sysdev/Makefile | 4 | ||||
-rw-r--r-- | include/asm-powerpc/mpc6xx.h | 6 |
3 files changed, 62 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/6xx-suspend.S b/arch/powerpc/sysdev/6xx-suspend.S new file mode 100644 index 000000000000..21cda085d926 --- /dev/null +++ b/arch/powerpc/sysdev/6xx-suspend.S | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Enter and leave sleep state on chips with 6xx-style HID0 | ||
3 | * power management bits, which don't leave sleep state via reset. | ||
4 | * | ||
5 | * Author: Scott Wood <scottwood@freescale.com> | ||
6 | * | ||
7 | * Copyright (c) 2006-2007 Freescale Semiconductor, Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License version 2 as published | ||
11 | * by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <asm/ppc_asm.h> | ||
15 | #include <asm/reg.h> | ||
16 | #include <asm/thread_info.h> | ||
17 | #include <asm/asm-offsets.h> | ||
18 | |||
19 | _GLOBAL(mpc6xx_enter_standby) | ||
20 | mflr r4 | ||
21 | |||
22 | mfspr r5, SPRN_HID0 | ||
23 | rlwinm r5, r5, 0, ~(HID0_DOZE | HID0_NAP) | ||
24 | oris r5, r5, HID0_SLEEP@h | ||
25 | mtspr SPRN_HID0, r5 | ||
26 | isync | ||
27 | |||
28 | lis r5, ret_from_standby@h | ||
29 | ori r5, r5, ret_from_standby@l | ||
30 | mtlr r5 | ||
31 | |||
32 | rlwinm r5, r1, 0, 0, 31-THREAD_SHIFT | ||
33 | lwz r6, TI_LOCAL_FLAGS(r5) | ||
34 | ori r6, r6, _TLF_SLEEPING | ||
35 | stw r6, TI_LOCAL_FLAGS(r5) | ||
36 | |||
37 | mfmsr r5 | ||
38 | ori r5, r5, MSR_EE | ||
39 | oris r5, r5, MSR_POW@h | ||
40 | sync | ||
41 | mtmsr r5 | ||
42 | isync | ||
43 | |||
44 | 1: b 1b | ||
45 | |||
46 | ret_from_standby: | ||
47 | mfspr r5, SPRN_HID0 | ||
48 | rlwinm r5, r5, 0, ~HID0_SLEEP | ||
49 | mtspr SPRN_HID0, r5 | ||
50 | |||
51 | mtlr r4 | ||
52 | blr | ||
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index 6d386d0071a0..2cc50520a698 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile | |||
@@ -44,3 +44,7 @@ obj-$(CONFIG_PPC_DCR) += dcr.o | |||
44 | obj-$(CONFIG_8xx) += mpc8xx_pic.o cpm1.o | 44 | obj-$(CONFIG_8xx) += mpc8xx_pic.o cpm1.o |
45 | obj-$(CONFIG_UCODE_PATCH) += micropatch.o | 45 | obj-$(CONFIG_UCODE_PATCH) += micropatch.o |
46 | endif | 46 | endif |
47 | |||
48 | ifeq ($(CONFIG_SUSPEND),y) | ||
49 | obj-$(CONFIG_6xx) += 6xx-suspend.o | ||
50 | endif | ||
diff --git a/include/asm-powerpc/mpc6xx.h b/include/asm-powerpc/mpc6xx.h new file mode 100644 index 000000000000..effc2291beb2 --- /dev/null +++ b/include/asm-powerpc/mpc6xx.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef __ASM_POWERPC_MPC6xx_H | ||
2 | #define __ASM_POWERPC_MPC6xx_H | ||
3 | |||
4 | void mpc6xx_enter_standby(void); | ||
5 | |||
6 | #endif | ||