diff options
author | ramesh.chandrasekaran <ramesh.chandrasekaran@stericsson.com> | 2012-05-23 14:14:00 +0200 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-25 08:35:09 +0200 |
commit | cb9db8be212a35ad0a6e96e0649c0f941beed8db (patch) | |
tree | 3314308e6b394d92925b3cd75a554672bcf2a094 | |
parent | c89fe123007928812ed1ea1fcbf427c556ee5190 (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.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-ux500/pm/context.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-ux500/pm/suspend.c | 4 |
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 22b56351284..32b2d348fa4 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 628ff5112bb..4aaf46fcea4 100644 --- a/arch/arm/mach-ux500/pm/context.c +++ b/arch/arm/mach-ux500/pm/context.c @@ -192,6 +192,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 */ @@ -629,6 +631,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. */ @@ -645,6 +667,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 c5cf6260fbd..33f55938134 100644 --- a/arch/arm/mach-ux500/pm/suspend.c +++ b/arch/arm/mach-ux500/pm/suspend.c @@ -74,6 +74,8 @@ static int suspend(bool do_deepsleep) context_vape_save(); + context_fsmc_save(); + if (pins_force) { /* * Save GPIO settings before applying power save @@ -136,6 +138,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(); |