summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorramesh.chandrasekaran <ramesh.chandrasekaran@stericsson.com>2012-05-23 14:14:00 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-25 08:35:17 +0200
commitcd092ef3940cbf2c6267b53f00c2fb322458c846 (patch)
tree4c16e1e4ce7b921e72e4fb532dd9dae7e59f5aca
parent7f212ad0c3444a11428a66a88db92cc9f5229b79 (diff)
pm: Fix for Ethernet doesn't work after suspend
Signed-off-by: ramesh.chandrasekaran <ramesh.chandrasekaran@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/include/mach/context.h3
-rw-r--r--arch/arm/mach-ux500/pm/context.c23
-rw-r--r--arch/arm/mach-ux500/pm/suspend.c4
3 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/include/mach/context.h b/arch/arm/mach-ux500/include/mach/context.h
index 6975a69eddc..a3490121b67 100644
--- a/arch/arm/mach-ux500/include/mach/context.h
+++ b/arch/arm/mach-ux500/include/mach/context.h
@@ -36,6 +36,9 @@ int context_arm_notifier_unregister(struct notifier_block *nb);
void context_vape_save(void);
void context_vape_restore(void);
+void context_fsmc_save(void);
+void context_fsmc_restore(void);
+
void context_gpio_save(void);
void context_gpio_restore(void);
void context_gpio_restore_mux(void);
diff --git a/arch/arm/mach-ux500/pm/context.c b/arch/arm/mach-ux500/pm/context.c
index 01040b6202f..9dbbc9a7fdd 100644
--- a/arch/arm/mach-ux500/pm/context.c
+++ b/arch/arm/mach-ux500/pm/context.c
@@ -193,6 +193,8 @@ static u32 gpio_bankaddr[GPIO_NUM_BANKS] = {IO_ADDRESS(U8500_GPIOBANK0_BASE),
static u32 gpio_save[GPIO_NUM_BANKS][GPIO_NUM_SAVE_REGISTERS];
+void __iomem *fsmc_base_addr;
+static u32 fsmc_bcr0;
/*
* Stacks and stack pointers
*/
@@ -634,6 +636,26 @@ void context_vape_restore(void)
}
/*
+ * Save FSMC registers that will be reset
+ * during power save.
+ */
+void context_fsmc_save(void)
+{
+ fsmc_base_addr = ioremap_nocache(U8500_FSMC_BASE, 8);
+ fsmc_bcr0 = readl(fsmc_base_addr);
+}
+
+/*
+ * Restore FSMC registers that will be reset
+ * during power save.
+ */
+void context_fsmc_restore(void)
+{
+ writel(fsmc_bcr0, fsmc_base_addr);
+ iounmap(fsmc_base_addr);
+}
+
+/*
* Save GPIO registers that might be modified
* for power save reasons.
*/
@@ -650,6 +672,7 @@ void context_gpio_save(void)
gpio_save[i][4] = readl(gpio_bankaddr[i] + NMK_GPIO_DAT);
gpio_save[i][6] = readl(gpio_bankaddr[i] + NMK_GPIO_SLPC);
}
+
/* Mask GPIO140 and GPIO32 which gives
* spurious interrupts during sleep
*/
diff --git a/arch/arm/mach-ux500/pm/suspend.c b/arch/arm/mach-ux500/pm/suspend.c
index da7b64e3bb6..df527964182 100644
--- a/arch/arm/mach-ux500/pm/suspend.c
+++ b/arch/arm/mach-ux500/pm/suspend.c
@@ -78,6 +78,8 @@ static int suspend(bool do_deepsleep)
context_vape_save();
+ context_fsmc_save();
+
if (pins_force) {
/*
* Save GPIO settings before applying power save
@@ -140,6 +142,8 @@ static int suspend(bool do_deepsleep)
context_vape_restore();
+ context_fsmc_restore();
+
/* If GPIO woke us up then save the pins that caused the wake up */
ux500_pm_gpio_save_wake_up_status();