Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: tango: add Suspend-to-RAM support

Ask firmware to put RAM in self-refresh mode and power system down.

echo mem > /sys/power/state

See Documentation/power/states.txt

Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Marc Gonzalez and committed by
Arnd Bergmann
a30eceb7 2e2843f1

+34
+1
arch/arm/mach-tango/Makefile
··· 3 3 4 4 obj-y += setup.o smc.o 5 5 obj-$(CONFIG_SMP) += platsmp.o 6 + obj-$(CONFIG_SUSPEND) += pm.o
+32
arch/arm/mach-tango/pm.c
··· 1 + #include <linux/init.h> 2 + #include <linux/suspend.h> 3 + #include <asm/suspend.h> 4 + #include "smc.h" 5 + 6 + static int tango_pm_powerdown(unsigned long arg) 7 + { 8 + tango_suspend(virt_to_phys(cpu_resume)); 9 + 10 + return -EIO; /* tango_suspend has failed */ 11 + } 12 + 13 + static int tango_pm_enter(suspend_state_t state) 14 + { 15 + if (state == PM_SUSPEND_MEM) 16 + return cpu_suspend(0, tango_pm_powerdown); 17 + 18 + return -EINVAL; 19 + } 20 + 21 + static const struct platform_suspend_ops tango_pm_ops = { 22 + .enter = tango_pm_enter, 23 + .valid = suspend_valid_only_mem, 24 + }; 25 + 26 + static int __init tango_pm_init(void) 27 + { 28 + suspend_set_ops(&tango_pm_ops); 29 + return 0; 30 + } 31 + 32 + late_initcall(tango_pm_init);
+1
arch/arm/mach-tango/smc.h
··· 3 3 #define tango_set_l2_control(val) tango_smc(val, 0x102) 4 4 #define tango_start_aux_core(val) tango_smc(val, 0x104) 5 5 #define tango_set_aux_boot_addr(val) tango_smc(val, 0x105) 6 + #define tango_suspend(val) tango_smc(val, 0x120) 6 7 #define tango_aux_core_die(val) tango_smc(val, 0x121) 7 8 #define tango_aux_core_kill(val) tango_smc(val, 0x122)