aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2011-06-22 19:10:30 -0400
committerKumar Gala <galak@kernel.crashing.org>2011-06-27 09:36:15 -0400
commitebf714ff37561331eb39963945d80bfc2a59e00f (patch)
tree4332a9b8ba4472a439db4d21ece64066d88358d1 /arch/powerpc
parentf340fe69f5e87c9f630b077cf52142ec15964a41 (diff)
powerpc/e500mc: Add support for the wait instruction in e500_idle
e500mc cannot doze or nap due to an erratum (as well as having a different mechanism than previous e500), but it has a "wait" instruction that is similar to doze. On 64-bit, due to the soft-irq-disable mechanism, the existing book3e_idle should be used instead. Signed-off-by: Vakul Garg <vakul@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/idle_e500.S12
-rw-r--r--arch/powerpc/platforms/85xx/p3041_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/p4080_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/p5020_ds.c5
4 files changed, 19 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S
index 47a1a983ff88..3e2b95c6ae67 100644
--- a/arch/powerpc/kernel/idle_e500.S
+++ b/arch/powerpc/kernel/idle_e500.S
@@ -26,6 +26,17 @@ _GLOBAL(e500_idle)
26 ori r4,r4,_TLF_NAPPING /* so when we take an exception */ 26 ori r4,r4,_TLF_NAPPING /* so when we take an exception */
27 stw r4,TI_LOCAL_FLAGS(r3) /* it will return to our caller */ 27 stw r4,TI_LOCAL_FLAGS(r3) /* it will return to our caller */
28 28
29#ifdef CONFIG_E500MC
30 wrteei 1
311: wait
32
33 /*
34 * Guard against spurious wakeups (e.g. from a hypervisor) --
35 * any real interrupt will cause us to return to LR due to
36 * _TLF_NAPPING.
37 */
38 b 1b
39#else
29 /* Check if we can nap or doze, put HID0 mask in r3 */ 40 /* Check if we can nap or doze, put HID0 mask in r3 */
30 lis r3,0 41 lis r3,0
31BEGIN_FTR_SECTION 42BEGIN_FTR_SECTION
@@ -72,6 +83,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_L2CSR|CPU_FTR_CAN_NAP)
72 mtmsr r7 83 mtmsr r7
73 isync 84 isync
742: b 2b 852: b 2b
86#endif /* !E500MC */
75 87
76/* 88/*
77 * Return from NAP/DOZE mode, restore some CPU specific registers, 89 * Return from NAP/DOZE mode, restore some CPU specific registers,
diff --git a/arch/powerpc/platforms/85xx/p3041_ds.c b/arch/powerpc/platforms/85xx/p3041_ds.c
index e2cfb6b6fb25..1fcd233a9167 100644
--- a/arch/powerpc/platforms/85xx/p3041_ds.c
+++ b/arch/powerpc/platforms/85xx/p3041_ds.c
@@ -69,6 +69,7 @@ define_machine(p3041_ds) {
69 .restart = fsl_rstcr_restart, 69 .restart = fsl_rstcr_restart,
70 .calibrate_decr = generic_calibrate_decr, 70 .calibrate_decr = generic_calibrate_decr,
71 .progress = udbg_progress, 71 .progress = udbg_progress,
72 .power_save = e500_idle,
72}; 73};
73 74
74machine_device_initcall(p3041_ds, corenet_ds_publish_devices); 75machine_device_initcall(p3041_ds, corenet_ds_publish_devices);
diff --git a/arch/powerpc/platforms/85xx/p4080_ds.c b/arch/powerpc/platforms/85xx/p4080_ds.c
index eed4b01deff7..430c8f969177 100644
--- a/arch/powerpc/platforms/85xx/p4080_ds.c
+++ b/arch/powerpc/platforms/85xx/p4080_ds.c
@@ -68,6 +68,7 @@ define_machine(p4080_ds) {
68 .restart = fsl_rstcr_restart, 68 .restart = fsl_rstcr_restart,
69 .calibrate_decr = generic_calibrate_decr, 69 .calibrate_decr = generic_calibrate_decr,
70 .progress = udbg_progress, 70 .progress = udbg_progress,
71 .power_save = e500_idle,
71}; 72};
72 73
73machine_device_initcall(p4080_ds, corenet_ds_publish_devices); 74machine_device_initcall(p4080_ds, corenet_ds_publish_devices);
diff --git a/arch/powerpc/platforms/85xx/p5020_ds.c b/arch/powerpc/platforms/85xx/p5020_ds.c
index 94348c9b5dc6..f7220d47ddcb 100644
--- a/arch/powerpc/platforms/85xx/p5020_ds.c
+++ b/arch/powerpc/platforms/85xx/p5020_ds.c
@@ -74,6 +74,11 @@ define_machine(p5020_ds) {
74 .restart = fsl_rstcr_restart, 74 .restart = fsl_rstcr_restart,
75 .calibrate_decr = generic_calibrate_decr, 75 .calibrate_decr = generic_calibrate_decr,
76 .progress = udbg_progress, 76 .progress = udbg_progress,
77#ifdef CONFIG_PPC64
78 .power_save = book3e_idle,
79#else
80 .power_save = e500_idle,
81#endif
77}; 82};
78 83
79machine_device_initcall(p5020_ds, corenet_ds_publish_devices); 84machine_device_initcall(p5020_ds, corenet_ds_publish_devices);