summaryrefslogtreecommitdiff
path: root/cpu/mpc83xx/spd_sdram.c
diff options
context:
space:
mode:
authorPeter Pearse <peter.pearse@arm.com>2007-05-18 14:33:23 +0100
committerPeter Pearse <peter.pearse@arm.com>2007-05-18 14:33:23 +0100
commitfdda367561f0f6fb21d5b575402c0f9d2fd08e76 (patch)
treeafb703e6e43ff91e6f456f12fbb43fb598373fd5 /cpu/mpc83xx/spd_sdram.c
parent1443a31457d68f7e8f0b9403e9832ec1e79dc59d (diff)
parent70124c2602ae2d4c5d3dba05b482d91548242de8 (diff)
downloadu-boot-imx-fdda367561f0f6fb21d5b575402c0f9d2fd08e76.zip
u-boot-imx-fdda367561f0f6fb21d5b575402c0f9d2fd08e76.tar.gz
u-boot-imx-fdda367561f0f6fb21d5b575402c0f9d2fd08e76.tar.bz2
Merge with git://www.denx.de/git/u-boot.git
Diffstat (limited to 'cpu/mpc83xx/spd_sdram.c')
-rw-r--r--cpu/mpc83xx/spd_sdram.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/cpu/mpc83xx/spd_sdram.c b/cpu/mpc83xx/spd_sdram.c
index d9b8753..647813f 100644
--- a/cpu/mpc83xx/spd_sdram.c
+++ b/cpu/mpc83xx/spd_sdram.c
@@ -58,8 +58,8 @@ picos_to_clk(int picos)
int clks;
ddr_bus_clk = gd->ddr_clk >> 1;
- clks = picos / ((1000000000 / ddr_bus_clk) * 1000);
- if (picos % ((1000000000 / ddr_bus_clk) * 1000) != 0)
+ clks = picos / (1000000000 / (ddr_bus_clk / 1000));
+ if (picos % (1000000000 / (ddr_bus_clk / 1000)) != 0)
clks++;
return clks;
@@ -624,7 +624,7 @@ long int spd_sdram()
| (1 << (16 + 10)) /* DQS Differential disable */
| (add_lat << (16 + 3)) /* Additive Latency in EMRS1 */
| (mode_odt_enable << 16) /* ODT Enable in EMRS1 */
- | ((twr_clk >> 1) << 9) /* Write Recovery Autopre */
+ | ((twr_clk - 1) << 9) /* Write Recovery Autopre */
| (caslat << 4) /* caslat */
| (burstlen << 0) /* Burst length */
);
@@ -693,11 +693,6 @@ long int spd_sdram()
#ifdef CFG_DDR_SDRAM_CLK_CNTL /* Optional platform specific value */
ddr->sdram_clk_cntl = CFG_DDR_SDRAM_CLK_CNTL;
-#else
- /* SS_EN = 0, source synchronous disable
- * CLK_ADJST = 0, MCK/MCK# is launched aligned with addr/cmd
- */
- ddr->sdram_clk_cntl = 0x00000000;
#endif
debug("DDR:sdram_clk_cntl=0x%08x\n", ddr->sdram_clk_cntl);