Commit 543b9fd3 authored by Johannes Berg's avatar Johannes Berg Committed by Paul Mackerras
Browse files

[POWERPC] powermac: Suspend to disk on G5



Powermac G5 suspend to disk implementation.  The code is platform
agnostic but only tested on powermac, no other 64-bit powerpc
machines.

Because nvidiafb still breaks suspend I have marked it EXPERIMENTAL on
powermac and because I can't test it and some lowlevel code will need
changes it is BROKEN on all other 64-bit platforms.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 7e11580b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -126,6 +126,11 @@ config DEFAULT_UIMAGE
	  Used to allow a board to specify it wants a uImage built by default
	default n

config PPC64_SWSUSP
	bool
	depends on PPC64 && (BROKEN || (PPC_PMAC64 && EXPERIMENTAL))
	default y

menu "Processor support"
choice
	prompt "Processor Type"
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
obj-$(CONFIG_TAU)		+= tau_6xx.o
obj-$(CONFIG_SOFTWARE_SUSPEND)	+= swsusp.o
obj32-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_32.o
obj64-$(CONFIG_SOFTWARE_SUSPEND) += swsusp_64.o swsusp_asm64.o
obj32-$(CONFIG_MODULES)		+= module_32.o

ifeq ($(CONFIG_PPC_MERGE),y)
+2 −2
Original line number Diff line number Diff line
@@ -21,12 +21,12 @@
#include <linux/types.h>
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/suspend.h>
#ifdef CONFIG_PPC64
#include <linux/time.h>
#include <linux/hardirq.h>
#else
#include <linux/ptrace.h>
#include <linux/suspend.h>
#endif

#include <asm/io.h>
@@ -257,11 +257,11 @@ int main(void)
	DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));
	DEFINE(CPU_SPEC_RESTORE, offsetof(struct cpu_spec, cpu_restore));

#ifndef CONFIG_PPC64
	DEFINE(pbe_address, offsetof(struct pbe, address));
	DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
	DEFINE(pbe_next, offsetof(struct pbe, next));

#ifndef CONFIG_PPC64
	DEFINE(TASK_SIZE, TASK_SIZE);
	DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
#endif /* ! CONFIG_PPC64 */
+4 −1
Original line number Diff line number Diff line
@@ -33,8 +33,11 @@
#include <asm/smp.h>

#ifdef CONFIG_HOTPLUG_CPU
/* this is used for software suspend, and that shuts down
 * CPUs even while the system is still booting... */
#define cpu_should_die()	(cpu_is_offline(smp_processor_id()) && \
				 system_state == SYSTEM_RUNNING)
				   (system_state == SYSTEM_RUNNING     \
				 || system_state == SYSTEM_BOOTING))
#else
#define cpu_should_die()	0
#endif
+9 −0
Original line number Diff line number Diff line
@@ -24,6 +24,11 @@ void save_processor_state(void)
	flush_fp_to_thread(current);
	flush_altivec_to_thread(current);
	flush_spe_to_thread(current);

#ifdef CONFIG_PPC64
	hard_irq_disable();
#endif

}

void restore_processor_state(void)
@@ -31,4 +36,8 @@ void restore_processor_state(void)
#ifdef CONFIG_PPC32
	set_context(current->active_mm->context.id, current->active_mm->pgd);
#endif

#ifdef CONFIG_PPC64
	hard_irq_enable();
#endif
}
Loading