diff options
Diffstat (limited to 'arch/arm/mach-omap2/sdrc.c')
-rw-r--r-- | arch/arm/mach-omap2/sdrc.c | 57 |
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 | |||
34 | void __iomem *omap2_sdrc_base; | ||
35 | void __iomem *omap2_sms_base; | ||
36 | |||
37 | void __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 */ | ||
44 | void __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 | } | ||