summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/suspend.c
diff options
context:
space:
mode:
authorJin Qian <jqian@nvidia.com>2011-03-16 12:30:41 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-04-26 15:55:22 -0700
commitc20390e18a5fc8edeee531c3f691c3e528d3569c (patch)
treef6bcd37f5273309c0290e47d754031d5054cf405 /arch/arm/mach-tegra/suspend.c
parentd638dcd4c33b6abb86abd352d81673216eaddcc3 (diff)
ARM: tegra: power: add partition power check before suspend
Original-Change-Id: Ie4b29d1119bc2f640891525ab781c8de1bf64ddf Reviewed-on: http://git-master/r/23215 Tested-by: Jin Qian <jqian@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Change-Id: Idc616485ecdb9e7c39728409d91a511e1de79e05
Diffstat (limited to 'arch/arm/mach-tegra/suspend.c')
-rw-r--r--arch/arm/mach-tegra/suspend.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/suspend.c b/arch/arm/mach-tegra/suspend.c
index 51cac1a49b7a..0839b861f9e6 100644
--- a/arch/arm/mach-tegra/suspend.c
+++ b/arch/arm/mach-tegra/suspend.c
@@ -53,6 +53,7 @@
#include <mach/iovmm.h>
#include <mach/irqs.h>
#include <mach/legacy_irq.h>
+#include <mach/powergate.h>
#include <mach/suspend.h>
#include "board.h"
@@ -551,12 +552,40 @@ static u8 *iram_save = NULL;
static unsigned int iram_save_size = 0;
static void __iomem *iram_code = IO_ADDRESS(TEGRA_IRAM_CODE_AREA);
+static void tegra_suspend_check_pwr_stats(void)
+{
+ /* cpus and l2 are powered off later */
+ unsigned long pwrgate_partid_mask =
+#if !defined(CONFIG_ARCH_TEGRA_2x_SOC)
+ (1 << TEGRA_POWERGATE_HEG) |
+ (1 << TEGRA_POWERGATE_SATA) |
+ (1 << TEGRA_POWERGATE_3D1) |
+#endif
+ (1 << TEGRA_POWERGATE_3D) |
+ (1 << TEGRA_POWERGATE_VENC) |
+ (1 << TEGRA_POWERGATE_PCIE) |
+ (1 << TEGRA_POWERGATE_VDEC) |
+ (1 << TEGRA_POWERGATE_MPE);
+
+ int partid;
+
+ for (partid = 0; partid < TEGRA_NUM_POWERGATE; partid++)
+ if ((1 << partid) & pwrgate_partid_mask)
+ if (tegra_powergate_is_powered(partid))
+ pr_warning("partition %s is left on before suspend\n",
+ tegra_powergate_get_name(partid));
+
+ return;
+}
+
void tegra_suspend_dram(bool do_lp0)
{
unsigned int mode = TEGRA_POWER_SDRAM_SELFREFRESH;
unsigned long reg;
unsigned int cpu;
+ tegra_suspend_check_pwr_stats();
+
/* copy the reset vector and SDRAM shutdown code into IRAM */
memcpy(iram_save, iram_code, iram_save_size);
memcpy(iram_code, (void *)__tegra_lp1_reset, iram_save_size);