From: Marek Vasut Date: Mon, 4 Apr 2016 15:52:21 +0000 (+0200) Subject: ddr: altera: Fix DRAM end value in protection rule X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=164eb23f4923c62ce3d8ebff6d4efb1f12570950;p=u-boot.git 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 Cc: Dinh Nguyen Cc: Chin Liang See --- 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);