summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorNikita Kiryanov <nikita@compulab.co.il>2014-08-20 15:08:58 +0300
committerStefano Babic <sbabic@denx.de>2014-09-09 15:35:00 +0200
commit07ee927d2c319b477232affad7d3b6119ac079c9 (patch)
tree937f9fb2cbf4f48d55e47cca4aead70f40daeaa5 /arch
parent08155289a453acee836179553131e9d51ab02a52 (diff)
arm: mx6: ddr: fix cs0_end calculation
Current way of calculation CS0_END field for MMDCx_MDASP register is problematic because in most cases the user is forced to define cs_density in an unnatural way: as value - 2, instead of value. This breaks the abstraction provided by struct mx6_ddr_sysinfo because the user is forced to be aware of the way the calculation is performed. Refactor the calculation. Cc: Stefano Babic <sbabic@denx.de> Cc: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/mx6/ddr.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/arm/cpu/armv7/mx6/ddr.c b/arch/arm/cpu/armv7/mx6/ddr.c
index d22f232238..7b5c1e4dd7 100644
--- a/arch/arm/cpu/armv7/mx6/ddr.c
+++ b/arch/arm/cpu/armv7/mx6/ddr.c
@@ -309,9 +309,7 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo,
twtr = ROUND(MAX(4 * clkper, 7500) / clkper, 1) - 1;
trcd = trp;
trtp = twtr;
- cs0_end = (4 * sysinfo->cs_density <= 120) ?
- 4 * sysinfo->cs_density + 7 :
- 127;
+ cs0_end = 4 * sysinfo->cs_density - 1;
debug("density:%d Gb (%d Gb per chip)\n",
sysinfo->cs_density, ddr3_cfg->density);