mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
f2ab99778a
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>
57 lines
1.3 KiB
C
57 lines
1.3 KiB
C
/*
|
|
* SMS/SDRC (SDRAM controller) common code for OMAP2/3
|
|
*
|
|
* Copyright (C) 2005, 2008 Texas Instruments Inc.
|
|
* Copyright (C) 2005, 2008 Nokia Corporation
|
|
*
|
|
* Tony Lindgren <tony@atomide.com>
|
|
* Paul Walmsley
|
|
* Richard Woodruff <r-woodruff2@ti.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/device.h>
|
|
#include <linux/list.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/delay.h>
|
|
#include <linux/clk.h>
|
|
#include <linux/io.h>
|
|
|
|
#include <mach/common.h>
|
|
#include <mach/clock.h>
|
|
#include <mach/sram.h>
|
|
|
|
#include "prm.h"
|
|
|
|
#include <mach/sdrc.h>
|
|
#include "sdrc.h"
|
|
|
|
void __iomem *omap2_sdrc_base;
|
|
void __iomem *omap2_sms_base;
|
|
|
|
void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals)
|
|
{
|
|
omap2_sdrc_base = omap2_globals->sdrc;
|
|
omap2_sms_base = omap2_globals->sms;
|
|
}
|
|
|
|
/* turn on smart idle modes for SDRAM scheduler and controller */
|
|
void __init omap2_sdrc_init(void)
|
|
{
|
|
u32 l;
|
|
|
|
l = sms_read_reg(SMS_SYSCONFIG);
|
|
l &= ~(0x3 << 3);
|
|
l |= (0x2 << 3);
|
|
sms_write_reg(l, SMS_SYSCONFIG);
|
|
|
|
l = sdrc_read_reg(SDRC_SYSCONFIG);
|
|
l &= ~(0x3 << 3);
|
|
l |= (0x2 << 3);
|
|
sdrc_write_reg(l, SDRC_SYSCONFIG);
|
|
}
|