diff options
| author | Vladimir Tsunaev <vladimirt@motorola.com> | 2014-05-09 13:27:10 -0400 | 
|---|---|---|
| committer | Jim Wylder <jwylder@motorola.com> | 2014-05-12 17:31:26 -0500 | 
| commit | 45c7061a5c2c4ac7e4e2f0c01e2db05e7c4a0b0a (patch) | |
| tree | 0a4b46cc127ffa00a1090f8d90ca980d3c82add7 | |
| parent | a1f7d43b50b0b363463862b6e85dde7cc67bfccf (diff) | |
| download | olio-linux-3.10-45c7061a5c2c4ac7e4e2f0c01e2db05e7c4a0b0a.tar.xz olio-linux-3.10-45c7061a5c2c4ac7e4e2f0c01e2db05e7c4a0b0a.zip | |
IKXCLOCK-1044 arm: omap2: enable OMAP offmode
Move off mode API to prm driver
Change-Id: I9b40bd0fc397f618aad0916fe15293516eb93711
Signed-off-by: Vladimir Tsunaev <vladimirt@motorola.com>
| -rw-r--r-- | arch/arm/mach-omap2/Kconfig | 9 | ||||
| -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/pm34xx.c | 25 | 
5 files changed, 33 insertions, 38 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/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/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 23eb24308cc..844b10723a2 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; @@ -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(); @@ -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(); |