diff options
| author | Vladimir Tsunaev <vladimirt@motorola.com> | 2014-05-09 13:27:10 -0400 | 
|---|---|---|
| committer | Vladimir Tsunaev <vladimirt@motorola.com> | 2014-05-12 19:25:44 -0400 | 
| commit | ead078965f30f53417abd061c97a1b79cf1e8c09 (patch) | |
| tree | 537b75fd57a8205980a8b9051add957eeb362cfc | |
| parent | d66490d3fffd8763f7754faa6bef0da78ce57f3a (diff) | |
| download | olio-linux-3.10-ead078965f30f53417abd061c97a1b79cf1e8c09.tar.xz olio-linux-3.10-ead078965f30f53417abd061c97a1b79cf1e8c09.zip | |
IKXCLOCK-1044 arm: omap2: enable OMAP offmode
Move off mode API to prm driver.
Change-Id: Ib6c32e9f8a24a4350e16b03c9ce3777c3985423d
Signed-off-by: Vladimir Tsunaev <vladimirt@motorola.com>
| -rw-r--r-- | arch/arm/mach-omap2/Kconfig | 9 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/cpuidle34xx.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/omap-pm-noop.c | 29 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/omap-pm.h | 4 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/pm-debug.c | 4 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/pm.h | 2 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 33 | 
7 files changed, 39 insertions, 44 deletions
| diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 9b9c99c9f34..281a0a7614a 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -420,6 +420,15 @@ config OMAP3_SDRC_AC_TIMING  	  wish to say no.  Selecting yes without understanding what is  	  going on could result in system crashes; +config DISABLE_OMAP_ERRATA_i583 +	bool "Override errata i583 +	depends on ARCH_OMAP3 +	default n +	help +	  Errata i583 affects JDEC memory timing when waking from OFF mode on +	  ES 1.1 and older OMAP3.  If the system clock is 26MHz or 38.4MHz and +	  there is no DDR on CS1, then it is safe to disable this errata check. +  config OMAP4_ERRATA_I688  	bool "OMAP4 errata: Async Bridge Corruption"  	depends on (ARCH_OMAP4 || SOC_OMAP5) && !ARCH_MULTIPLATFORM diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index e18709d3b95..4e176916fd2 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -131,7 +131,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,  		cpu_pm_enter();  	/* Execute ARM wfi */ -	omap_sram_idle(); +	omap_sram_idle(false);  	/*  	 * Call idle CPU PM enter notifier chain to restore diff --git a/arch/arm/mach-omap2/omap-pm-noop.c b/arch/arm/mach-omap2/omap-pm-noop.c index 6a3be2bebdd..aeb217bfab1 100644 --- a/arch/arm/mach-omap2/omap-pm-noop.c +++ b/arch/arm/mach-omap2/omap-pm-noop.c @@ -25,7 +25,6 @@  #include "omap_device.h"  #include "omap-pm.h" -static bool off_mode_enabled;  static int dummy_context_loss_counter;  /* @@ -281,28 +280,6 @@ unsigned long omap_pm_cpu_get_freq(void)  	return 0;  } -/** - * omap_pm_enable_off_mode - notify OMAP PM that off-mode is enabled - * - * Intended for use only by OMAP PM core code to notify this layer - * that off mode has been enabled. - */ -void omap_pm_enable_off_mode(void) -{ -	off_mode_enabled = true; -} - -/** - * omap_pm_disable_off_mode - notify OMAP PM that off-mode is disabled - * - * Intended for use only by OMAP PM core code to notify this layer - * that off mode has been disabled. - */ -void omap_pm_disable_off_mode(void) -{ -	off_mode_enabled = false; -} -  /*   * Device context loss tracking   */ @@ -320,12 +297,14 @@ int omap_pm_get_dev_context_loss_count(struct device *dev)  	if (dev->pm_domain == &omap_device_pm_domain) {  		count = omap_device_get_context_loss_count(pdev);  	} else { -		WARN_ONCE(off_mode_enabled, "omap_pm: using dummy context loss counter; device %s should be converted to omap_device", +		WARN_ONCE(omap_pm_get_off_mode(), +			"omap_pm: using dummy context loss counter; device %s " +			"should be converted to omap_device",  			  dev_name(dev));  		count = dummy_context_loss_counter; -		if (off_mode_enabled) { +		if (omap_pm_get_off_mode()) {  			count++;  			/*  			 * Context loss count has to be a non-negative value. diff --git a/arch/arm/mach-omap2/omap-pm.h b/arch/arm/mach-omap2/omap-pm.h index 67faa7b8fe9..4511a53b8e3 100644 --- a/arch/arm/mach-omap2/omap-pm.h +++ b/arch/arm/mach-omap2/omap-pm.h @@ -18,6 +18,7 @@  #include <linux/cpufreq.h>  #include <linux/clk.h>  #include <linux/opp.h> +#include <linux/power/omap_prm.h>  /*   * agent_id values for use with omap_pm_set_min_bus_tput(): @@ -346,7 +347,4 @@ unsigned long omap_pm_cpu_get_freq(void);   */  int omap_pm_get_dev_context_loss_count(struct device *dev); -void omap_pm_enable_off_mode(void); -void omap_pm_disable_off_mode(void); -  #endif diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index cc38db9edf0..b5dff42606c 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -227,9 +227,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)  static int option_get(void *data, u64 *val)  { -	u32 *option = data; - -	*val = *option; +	*val = omap_pm_get_off_mode();  	return 0;  } diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 7bdd22afce6..4f6f52b5215 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -32,7 +32,7 @@ static inline int omap4_idle_init(void)  extern void *omap3_secure_ram_storage;  extern void omap3_pm_off_mode_enable(int); -extern void omap_sram_idle(void); +extern void omap_sram_idle(bool in_suspend);  extern int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused);  extern int (*omap_pm_suspend)(void); diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 23eb24308cc..8b2281ec261 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -39,6 +39,7 @@  #include "clockdomain.h"  #include "powerdomain.h" +#include "omap-pm.h"  #include "soc.h"  #include "common.h"  #include "cm3xxx.h" @@ -51,6 +52,7 @@  #include "sram.h"  #include "control.h"  #include "pm-debug-regs.h" +#include "iomap.h"  /* pm34xx errata defined in pm.h */  u16 pm34xx_errata; @@ -249,7 +251,7 @@ static int omap34xx_do_sram_idle(unsigned long save_state)  	return 0;  } -void omap_sram_idle(void) +void omap_sram_idle(bool in_suspend)  {  	/* Variable to tell what needs to be saved and restored  	 * in omap_sram_idle*/ @@ -293,7 +295,8 @@ void omap_sram_idle(void)  	/* PER */  	if (per_next_state < PWRDM_POWER_ON) { -		per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; +		per_going_off = (per_next_state == PWRDM_POWER_OFF) ? +			OFF_MODE : 0;  		omap2_gpio_prepare_for_idle(per_going_off);  	} @@ -302,6 +305,9 @@ void omap_sram_idle(void)  		if (core_next_state == PWRDM_POWER_OFF) {  			omap3_core_save_context();  			omap3_cm_save_context(); + +			omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, +						   WKUP_MOD, PM_WKEN);  		}  	} @@ -352,10 +358,10 @@ void omap_sram_idle(void)  			omap3_sram_restore_context();  			omap2_sms_restore_context();  		} -		if (core_next_state == PWRDM_POWER_OFF) -			omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, -					       OMAP3430_GR_MOD, -					       OMAP3_PRM_VOLTCTRL_OFFSET); +		if (core_next_state == PWRDM_POWER_OFF) { +			omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, +						     WKUP_MOD, PM_WKEN); +		}  	}  	omap3_intc_resume_idle(); @@ -363,7 +369,7 @@ void omap_sram_idle(void)  	/* PER */  	if (per_next_state < PWRDM_POWER_ON) -		omap2_gpio_resume_after_idle(); +		omap2_gpio_resume_after_idle(in_suspend);  }  static void omap3_pm_idle(void) @@ -373,7 +379,7 @@ static void omap3_pm_idle(void)  	trace_cpu_idle(1, smp_processor_id()); -	omap_sram_idle(); +	omap_sram_idle(false);  	trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());  } @@ -399,7 +405,7 @@ static int omap3_pm_suspend(void)  	omap3_intc_suspend(); -	omap_sram_idle(); +	omap_sram_idle(true);  restore:  	/* Restore next_pwrsts */ @@ -675,8 +681,10 @@ static void __init pm_errata_configure(void)  		enable_omap3630_toggle_l2_on_restore();  		if (omap_rev() < OMAP3630_REV_ES1_2) -			pm34xx_errata |= (PM_SDRC_WAKEUP_ERRATUM_i583 | -					  PM_PER_MEMORIES_ERRATUM_i582); +			pm34xx_errata |= PM_PER_MEMORIES_ERRATUM_i582; +#ifndef CONFIG_DISABLE_OMAP_ERRATA_i583 +			pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583; +#endif  	} else if (cpu_is_omap34xx()) {  		pm34xx_errata |= PM_PER_MEMORIES_ERRATUM_i582;  	} @@ -745,6 +753,9 @@ int __init omap3_pm_init(void)  	omap_pm_suspend = omap3_pm_suspend;  #endif +	if (omap_pm_get_off_mode()) +		omap3_pm_off_mode_enable(true); +  	arm_pm_idle = omap3_pm_idle;  	omap3_idle_init(); |