mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH v2] at91sam9_ddrsdr: fix register on mdr read and sdram detection for ddr size
Date: Sun,  3 Feb 2013 14:49:58 +0100	[thread overview]
Message-ID: <1359899398-3867-1-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1359895702-30597-1-git-send-email-plagnioj@jcrosoft.com>

it's currently working by luck

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
v2:
	2 bug together make it work

Best Regards,
J.
 arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
index 2614f97..88796a6 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
@@ -146,7 +146,7 @@ static inline u32 at91_get_ddram_size(void * __iomem base, bool is_nb)
 	bool is_sdram;
 
 	cr = __raw_readl(base + AT91_DDRSDRC_CR);
-	mdr = __raw_readl(base + AT91_DDRSDRC_CR);
+	mdr = __raw_readl(base + AT91_DDRSDRC_MDR);
 
 	is_sdram = (mdr & AT91_DDRSDRC_MD) <= AT91_DDRSDRC_MD_LOW_POWER_SDR;
 
@@ -158,7 +158,7 @@ static inline u32 at91_get_ddram_size(void * __iomem base, bool is_nb)
 	size = 1;
 	/* COL */
 	size += (cr & AT91_DDRSDRC_NC) + 8;
-	if (is_sdram)
+	if (!is_sdram)
 		size ++;
 	/* ROW */
 	size += ((cr & AT91_DDRSDRC_NR) >> 2) + 11;
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-02-03 13:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-03 12:48 [PATCH 1/1] at91sam9_ddrsdr: fix register on mdr read " Jean-Christophe PLAGNIOL-VILLARD
2013-02-03 13:49 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-02-04  8:45   ` [PATCH v2] at91sam9_ddrsdr: fix register on mdr read and sdram detection " Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359899398-3867-1-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox