summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/smemc.c
diff options
context:
space:
mode:
authorIgor Grinberg <grinberg@compulab.co.il>2013-01-13 13:49:47 +0200
committerHaojian Zhuang <haojian.zhuang@linaro.org>2013-01-23 16:56:32 +0800
commitd107a204154ddd79339203c2deeb7433f0cf6777 (patch)
tree84931e8d1797c48edbc3e17cd4b76d7fae80d100 /arch/arm/mach-pxa/smemc.c
parent6a639bb83b751bfed61be13c0e3df17e5a970a94 (diff)
downloadlinux-d107a204154ddd79339203c2deeb7433f0cf6777.tar.bz2
ARM: PXA3xx: program the CSMSADRCFG register
The Chip Select Configuration Register must be programmed to 0x2 in order to achieve the correct behavior of the Static Memory Controller. Without this patch devices wired to DFI and accessed through SMC cannot be accessed after resume from S2. Do not rely on the boot loader to program the CSMSADRCFG register by programming it in the kernel smemc module. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Cc: stable@vger.kernel.org Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/smemc.c')
-rw-r--r--arch/arm/mach-pxa/smemc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c
index 79923058d10f..f38aa890b2c9 100644
--- a/arch/arm/mach-pxa/smemc.c
+++ b/arch/arm/mach-pxa/smemc.c
@@ -40,6 +40,8 @@ static void pxa3xx_smemc_resume(void)
__raw_writel(csadrcfg[1], CSADRCFG1);
__raw_writel(csadrcfg[2], CSADRCFG2);
__raw_writel(csadrcfg[3], CSADRCFG3);
+ /* CSMSADRCFG wakes up in its default state (0), so we need to set it */
+ __raw_writel(0x2, CSMSADRCFG);
}
static struct syscore_ops smemc_syscore_ops = {
@@ -49,8 +51,19 @@ static struct syscore_ops smemc_syscore_ops = {
static int __init smemc_init(void)
{
- if (cpu_is_pxa3xx())
+ if (cpu_is_pxa3xx()) {
+ /*
+ * The only documentation we have on the
+ * Chip Select Configuration Register (CSMSADRCFG) is that
+ * it must be programmed to 0x2.
+ * Moreover, in the bit definitions, the second bit
+ * (CSMSADRCFG[1]) is called "SETALWAYS".
+ * Other bits are reserved in this register.
+ */
+ __raw_writel(0x2, CSMSADRCFG);
+
register_syscore_ops(&smemc_syscore_ops);
+ }
return 0;
}