mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Matteo Fortini <matteo.fortini@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH V2] sama5d3x: fix AT91_SMC_CS offset stride
Date: Thu, 29 May 2014 14:44:39 +0200	[thread overview]
Message-ID: <assp.0226f60ff0.1401367479-16179-1-git-send-email-matteo.fortini@gmail.com> (raw)

As stated in section 29.19.32 of SAMA5D3 Series datasheet, to move
from CS(n) to CS(n+1) the stride is 0x14 and not 0x10 as in the
other AT91 CPUs

Signed-off-by: Matteo Fortini <matteo.fortini@gmail.com>
---
 arch/arm/mach-at91/sam9_smc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
index a137da4..6dd3797 100644
--- a/arch/arm/mach-at91/sam9_smc.c
+++ b/arch/arm/mach-at91/sam9_smc.c
@@ -12,11 +12,13 @@
 #include <init.h>
 #include <io.h>
 #include <mach/hardware.h>
+#include <mach/cpu.h>
 #include <mach/io.h>
 
 #include <mach/at91sam9_smc.h>
 
-#define AT91_SMC_CS(id, n)	(smc_base_addr[id] + ((n) * 0x10))
+#define AT91_SMC_CS_STRIDE      ((at91_soc_initdata.type == AT91_SOC_SAMA5D3)?0x14:0x10)
+#define AT91_SMC_CS(id, n)	(smc_base_addr[id] + ((n) * AT91_SMC_CS_STRIDE))
 
 static void __iomem *smc_base_addr[2];
 
-- 
2.0.0.rc2


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

             reply	other threads:[~2014-05-29 12:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-29 12:44 Matteo Fortini [this message]
2014-06-02  6:55 ` 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=assp.0226f60ff0.1401367479-16179-1-git-send-email-matteo.fortini@gmail.com \
    --to=matteo.fortini@gmail.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