summaryrefslogtreecommitdiffstats
path: root/drivers/ddr/altera
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2016-04-04 17:52:21 +0200
committerMarek Vasut <marex@denx.de>2016-04-20 11:28:44 +0200
commit164eb23f4923c62ce3d8ebff6d4efb1f12570950 (patch)
tree4176ed7d1e6a8dae6be751dc5bf554ae09b67a32 /drivers/ddr/altera
parent8e9e62c946e295ca8e0b81d07b6b1cc884a70bc1 (diff)
downloadu-boot-164eb23f4923c62ce3d8ebff6d4efb1f12570950.tar.gz
u-boot-164eb23f4923c62ce3d8ebff6d4efb1f12570950.tar.xz
u-boot-164eb23f4923c62ce3d8ebff6d4efb1f12570950.zip
ddr: altera: Fix DRAM end value in protection rule
The hi address bitfield in the protection rule must be set to the last address in the region which the rule represents. The behavior is now in-line with code generated by Quartus 15.1 . Signed-off-by: Marek Vasut <marex@denx.de> Cc: Dinh Nguyen <dinguyen@opensource.altera.com> Cc: Chin Liang See <clsee@altera.com>
Diffstat (limited to 'drivers/ddr/altera')
-rw-r--r--drivers/ddr/altera/sdram.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ddr/altera/sdram.c b/drivers/ddr/altera/sdram.c
index 2996942172..7e4606de28 100644
--- a/drivers/ddr/altera/sdram.c
+++ b/drivers/ddr/altera/sdram.c
@@ -118,7 +118,7 @@ static void sdram_set_rule(struct sdram_prot_rule *prule)
/* Obtain the address bits */
lo_addr_bits = prule->sdram_start >> 20ULL;
- hi_addr_bits = prule->sdram_end >> 20ULL;
+ hi_addr_bits = (prule->sdram_end - 1) >> 20ULL;
debug("sdram set rule start %x, %d\n", lo_addr_bits,
prule->sdram_start);