aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/sdrc.c
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2009-01-28 14:27:37 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-08 12:50:39 -0500
commitf2ab99778a1a04ddbae38f4de4ef40f2edb92080 (patch)
treecb2e52c92d22393c5d3784013f4cd9f8897c2bd4 /arch/arm/mach-omap2/sdrc.c
parent96609ef4009515f0667a52b7776c21418df19bd8 (diff)
[ARM] OMAP2 SDRC: separate common OMAP2/3 code from OMAP2xxx code
Separate SDRC code common to OMAP2/3 from mach-omap2/sdrc2xxx.c to mach-omap2/sdrc.c. Rename the OMAP2xxx-specific functions to use an 'omap2xxx' prefix rather than an 'omap2' prefix, and use "sdrc" in the function names rather than "memory." Mark several functions as static that should not be used outside the sdrc2xxx.c file. linux-omap source commit is bf1612b9d8d29379558500cd5de9ae0367c41fc4. Signed-off-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap2/sdrc.c')
-rw-r--r--arch/arm/mach-omap2/sdrc.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
new file mode 100644
index 000000000000..24b54d50b893
--- /dev/null
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -0,0 +1,57 @@
1/*
2 * SMS/SDRC (SDRAM controller) common code for OMAP2/3
3 *
4 * Copyright (C) 2005, 2008 Texas Instruments Inc.
5 * Copyright (C) 2005, 2008 Nokia Corporation
6 *
7 * Tony Lindgren <tony@atomide.com>
8 * Paul Walmsley
9 * Richard Woodruff <r-woodruff2@ti.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/module.h>
17#include <linux/kernel.h>
18#include <linux/device.h>
19#include <linux/list.h>
20#include <linux/errno.h>
21#include <linux/delay.h>
22#include <linux/clk.h>
23#include <linux/io.h>
24
25#include <mach/common.h>
26#include <mach/clock.h>
27#include <mach/sram.h>
28
29#include "prm.h"
30
31#include <mach/sdrc.h>
32#include "sdrc.h"
33
34void __iomem *omap2_sdrc_base;
35void __iomem *omap2_sms_base;
36
37void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals)
38{
39 omap2_sdrc_base = omap2_globals->sdrc;
40 omap2_sms_base = omap2_globals->sms;
41}
42
43/* turn on smart idle modes for SDRAM scheduler and controller */
44void __init omap2_sdrc_init(void)
45{
46 u32 l;
47
48 l = sms_read_reg(SMS_SYSCONFIG);
49 l &= ~(0x3 << 3);
50 l |= (0x2 << 3);
51 sms_write_reg(l, SMS_SYSCONFIG);
52
53 l = sdrc_read_reg(SDRC_SYSCONFIG);
54 l &= ~(0x3 << 3);
55 l |= (0x2 << 3);
56 sdrc_write_reg(l, SDRC_SYSCONFIG);
57}