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

ARM: at91: pm select memory controler at runtime

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
[nicolas.ferre@atmel.com: add cpuidle modification]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

authored by

Jean-Christophe PLAGNIOL-VILLARD and committed by
Nicolas Ferre
efd09165 7eb1dbb3

+15 -18
+7 -1
arch/arm/mach-at91/cpuidle.c
··· 21 21 #include <linux/export.h> 22 22 #include <asm/proc-fns.h> 23 23 #include <asm/cpuidle.h> 24 + #include <mach/cpu.h> 24 25 25 26 #include "pm.h" 26 27 ··· 34 33 struct cpuidle_driver *drv, 35 34 int index) 36 35 { 37 - at91_standby(); 36 + if (cpu_is_at91rm9200()) 37 + at91rm9200_standby(); 38 + else if (cpu_is_at91sam9g45()) 39 + at91sam9g45_standby(); 40 + else 41 + at91sam9_standby(); 38 42 39 43 return index; 40 44 }
+8 -4
arch/arm/mach-at91/pm.c
··· 261 261 * For ARM 926 based chips, this requirement is weaker 262 262 * as at91sam9 can access a RAM in self-refresh mode. 263 263 */ 264 - at91_standby(); 264 + if (cpu_is_at91rm9200()) 265 + at91rm9200_standby(); 266 + else if (cpu_is_at91sam9g45()) 267 + at91sam9g45_standby(); 268 + else 269 + at91sam9_standby(); 265 270 break; 266 271 267 272 case PM_SUSPEND_ON: ··· 312 307 313 308 pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : "")); 314 309 315 - #ifdef CONFIG_ARCH_AT91RM9200 316 310 /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. */ 317 - at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0); 318 - #endif 311 + if (cpu_is_at91rm9200()) 312 + at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0); 319 313 320 314 suspend_set_ops(&at91_pm_ops); 321 315
-13
arch/arm/mach-at91/pm.h
··· 12 12 #define __ARCH_ARM_MACH_AT91_PM 13 13 14 14 #include <mach/at91_ramc.h> 15 - #ifdef CONFIG_ARCH_AT91RM9200 16 15 #include <mach/at91rm9200_sdramc.h> 17 16 18 17 /* ··· 42 43 "r" (lpr)); 43 44 } 44 45 45 - #define at91_standby at91rm9200_standby 46 - 47 - #elif defined(CONFIG_ARCH_AT91SAM9G45) 48 - 49 46 /* We manage both DDRAM/SDRAM controllers, we need more than one value to 50 47 * remember. 51 48 */ ··· 70 75 at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); 71 76 } 72 77 73 - #define at91_standby at91sam9g45_standby 74 - 75 - #else 76 - 77 78 #ifdef CONFIG_ARCH_AT91SAM9263 78 79 /* 79 80 * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use; ··· 92 101 93 102 at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr); 94 103 } 95 - 96 - #define at91_standby at91sam9_standby 97 - 98 - #endif 99 104 100 105 #endif