diff mbox

[U-Boot,04/10] ddr: altera: Fix DRAM end value in protection rule

Message ID 1459994646-11013-4-git-send-email-marex@denx.de
State Accepted
Commit 164eb23f4923c62ce3d8ebff6d4efb1f12570950
Delegated to: Marek Vasut
Headers show

Commit Message

Marek Vasut April 7, 2016, 2:04 a.m. UTC
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>
---
 drivers/ddr/altera/sdram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

George Broz April 8, 2016, 10:13 p.m. UTC | #1
On 6 April 2016 at 19:04, Marek Vasut <marex@denx.de> wrote:
> 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>
> ---
>  drivers/ddr/altera/sdram.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ddr/altera/sdram.c b/drivers/ddr/altera/sdram.c
> index 2996942..7e4606d 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);
> --
> 2.7.0
>

Tested on: SoCKit, DE0_Nano_SoC
Tested-by: George Broz <brozgeo at gmail.com>
diff mbox

Patch

diff --git a/drivers/ddr/altera/sdram.c b/drivers/ddr/altera/sdram.c
index 2996942..7e4606d 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);