diff mbox

[U-Boot,v1,01/10] arm, at91, mpddrc: fix typo in ddr2_init()

Message ID 1412142894-997-2-git-send-email-hs@denx.de
State Superseded, archived
Delegated to: Andreas Bießmann
Headers show

Commit Message

Heiko Schocher Oct. 1, 2014, 5:54 a.m. UTC
use the configure value for computing the ba_off value
not the value from the cr register. This leaded in a
wrong ram configuration on the upcoming corvus spl board
support.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Bo Shen <voice.shen@atmel.com>
---
 arch/arm/cpu/at91-common/mpddrc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Andreas Bießmann Oct. 25, 2014, 12:37 a.m. UTC | #1
Dear Heiko,

On 01.10.14 07:54, Heiko Schocher wrote:
> use the configure value for computing the ba_off value
> not the value from the cr register. This leaded in a
> wrong ram configuration on the upcoming corvus spl board
> support.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Andreas Bießmann <andreas.devel@googlemail.com>
> Cc: Bo Shen <voice.shen@atmel.com>

Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>

> ---
>  arch/arm/cpu/at91-common/mpddrc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/at91-common/mpddrc.c b/arch/arm/cpu/at91-common/mpddrc.c
> index 8136396..76668d2 100644
> --- a/arch/arm/cpu/at91-common/mpddrc.c
> +++ b/arch/arm/cpu/at91-common/mpddrc.c
> @@ -26,7 +26,8 @@ int ddr2_init(const unsigned int ram_address,
>  	/* Compute bank offset according to NC in configuration register */
>  	ba_off = (mpddr_value->cr & ATMEL_MPDDRC_CR_NC_MASK) + 9;
>  	if (!(mpddr_value->cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED))
> -		ba_off += ((mpddr->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2) + 11;
> +		ba_off += ((mpddr_value->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2)
> +			   + 11;

ugly 80 char rule ...

>  
>  	ba_off += (mpddr_value->md & ATMEL_MPDDRC_MD_DBW_MASK) ? 1 : 2;
>  
>
diff mbox

Patch

diff --git a/arch/arm/cpu/at91-common/mpddrc.c b/arch/arm/cpu/at91-common/mpddrc.c
index 8136396..76668d2 100644
--- a/arch/arm/cpu/at91-common/mpddrc.c
+++ b/arch/arm/cpu/at91-common/mpddrc.c
@@ -26,7 +26,8 @@  int ddr2_init(const unsigned int ram_address,
 	/* Compute bank offset according to NC in configuration register */
 	ba_off = (mpddr_value->cr & ATMEL_MPDDRC_CR_NC_MASK) + 9;
 	if (!(mpddr_value->cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED))
-		ba_off += ((mpddr->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2) + 11;
+		ba_off += ((mpddr_value->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2)
+			   + 11;
 
 	ba_off += (mpddr_value->md & ATMEL_MPDDRC_MD_DBW_MASK) ? 1 : 2;