Skip to content
Snippets Groups Projects
Commit 3667cbee authored by Steve Sakoman's avatar Steve Sakoman Committed by Sandeep Paulraj
Browse files

ARMV7: OMAP3: Remove erroneous hard coded sdram setup for 128MB/bank


Upcoming Beagle and Overo revisions use POP memory with 256MB or 512MB
per bank.  This patches uses the SDRC settings from x-load or the config
header to set up timing properly.

Signed-off-by: default avatarSteve Sakoman <steve@sakoman.com>
Signed-off-by: default avatarSandeep Paulraj <s-paulraj@ti.com>
parent 543431b6
Branches
Tags
No related merge requests found
...@@ -107,18 +107,12 @@ u32 get_sdr_cs_offset(u32 cs) ...@@ -107,18 +107,12 @@ u32 get_sdr_cs_offset(u32 cs)
/* /*
* do_sdrc_init - * do_sdrc_init -
* - Initialize the SDRAM for use. * - Initialize the SDRAM for use.
* - Sets up SDRC timings for CS0
* - code called once in C-Stack only context for CS0 and a possible 2nd * - code called once in C-Stack only context for CS0 and a possible 2nd
* time depending on memory configuration from stack+global context * time depending on memory configuration from stack+global context
*/ */
void do_sdrc_init(u32 cs, u32 early) void do_sdrc_init(u32 cs, u32 early)
{ {
struct sdrc_actim *sdrc_actim_base; struct sdrc_actim *sdrc_actim_base0, *sdrc_actim_base1;
if (cs)
sdrc_actim_base = (struct sdrc_actim *)SDRC_ACTIM_CTRL1_BASE;
else
sdrc_actim_base = (struct sdrc_actim *)SDRC_ACTIM_CTRL0_BASE;
if (early) { if (early) {
/* reset sdrc controller */ /* reset sdrc controller */
...@@ -138,24 +132,29 @@ void do_sdrc_init(u32 cs, u32 early) ...@@ -138,24 +132,29 @@ void do_sdrc_init(u32 cs, u32 early)
sdelay(0x20000); sdelay(0x20000);
} }
writel(RASWIDTH_13BITS | CASWIDTH_10BITS | ADDRMUXLEGACY |
RAMSIZE_128 | BANKALLOCATION | B32NOT16 | B32NOT16 |
DEEPPD | DDR_SDRAM, &sdrc_base->cs[cs].mcfg);
writel(ARCV | ARE_ARCV_1, &sdrc_base->cs[cs].rfr_ctrl);
writel(V_ACTIMA_165, &sdrc_actim_base->ctrla);
writel(V_ACTIMB_165, &sdrc_actim_base->ctrlb);
writel(CMD_NOP, &sdrc_base->cs[cs].manual);
writel(CMD_PRECHARGE, &sdrc_base->cs[cs].manual);
writel(CMD_AUTOREFRESH, &sdrc_base->cs[cs].manual);
writel(CMD_AUTOREFRESH, &sdrc_base->cs[cs].manual);
/* /*
* CAS latency 3, Write Burst = Read Burst, Serial Mode, * SDRC timings are set up by x-load or config header
* Burst length = 4 * We don't need to redo them here.
* Older x-loads configure only CS0
* configure CS1 to handle this ommission
*/ */
writel(CASL3 | BURSTLENGTH4, &sdrc_base->cs[cs].mr); if (cs) {
sdrc_actim_base0 = (struct sdrc_actim *)SDRC_ACTIM_CTRL0_BASE;
sdrc_actim_base1 = (struct sdrc_actim *)SDRC_ACTIM_CTRL1_BASE;
writel(readl(&sdrc_base->cs[CS0].mcfg),
&sdrc_base->cs[CS1].mcfg);
writel(readl(&sdrc_base->cs[CS0].rfr_ctrl),
&sdrc_base->cs[CS1].rfr_ctrl);
writel(readl(&sdrc_actim_base0->ctrla),
&sdrc_actim_base1->ctrla);
writel(readl(&sdrc_actim_base0->ctrlb),
&sdrc_actim_base1->ctrlb);
}
/*
* Test ram in this bank
* Disable if bad or not present
*/
if (!mem_ok(cs)) if (!mem_ok(cs))
writel(0, &sdrc_base->cs[cs].mcfg); writel(0, &sdrc_base->cs[cs].mcfg);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment