mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] sama5d3x: fix AT91_SMC_CS offset stride
@ 2014-05-29  9:55 Matteo Fortini
  2014-05-29 12:11 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 5+ messages in thread
From: Matteo Fortini @ 2014-05-29  9:55 UTC (permalink / raw)
  To: barebox

Acked-by: Bo Shen <voice.shen@atmel.com>
---
 arch/arm/mach-at91/sam9_smc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
index a137da4..65c4558 100644
--- a/arch/arm/mach-at91/sam9_smc.c
+++ b/arch/arm/mach-at91/sam9_smc.c
@@ -16,7 +16,11 @@
 
 #include <mach/at91sam9_smc.h>
 
+#ifdef CONFIG_ARCH_SAMA5D3
+#define AT91_SMC_CS(id, n)	(smc_base_addr[id] + ((n) * 0x14))
+#else
 #define AT91_SMC_CS(id, n)	(smc_base_addr[id] + ((n) * 0x10))
+#endif
 
 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sama5d3x: fix AT91_SMC_CS offset stride
  2014-05-29  9:55 [PATCH] sama5d3x: fix AT91_SMC_CS offset stride Matteo Fortini
@ 2014-05-29 12:11 ` Jean-Christophe PLAGNIOL-VILLARD
  2014-05-30  1:43   ` Bo Shen
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-05-29 12:11 UTC (permalink / raw)
  To: Matteo Fortini; +Cc: barebox


On May 29, 2014, at 5:55 PM, Matteo Fortini <matteo.fortini@gmail.com> wrote:

> 
> Acked-by: Bo Shen <voice.shen@atmel.com>
> ---
> arch/arm/mach-at91/sam9_smc.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
> index a137da4..65c4558 100644
> --- a/arch/arm/mach-at91/sam9_smc.c
> +++ b/arch/arm/mach-at91/sam9_smc.c
> @@ -16,7 +16,11 @@
> 
> #include <mach/at91sam9_smc.h>
> 
> +#ifdef CONFIG_ARCH_SAMA5D3
> +#define AT91_SMC_CS(id, n)	(smc_base_addr[id] + ((n) * 0x14))
> +#else
> #define AT91_SMC_CS(id, n)	(smc_base_addr[id] + ((n) * 0x10))
> +#endif
NACK no ifdef

this need to be runtime

and you need to put our SOB
> 
> 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


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sama5d3x: fix AT91_SMC_CS offset stride
  2014-05-29 12:11 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2014-05-30  1:43   ` Bo Shen
  0 siblings, 0 replies; 5+ messages in thread
From: Bo Shen @ 2014-05-30  1:43 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD, Matteo Fortini; +Cc: barebox

Hi J,

On 05/29/2014 08:11 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>
> On May 29, 2014, at 5:55 PM, Matteo Fortini <matteo.fortini@gmail.com> wrote:
>
>>
>> Acked-by: Bo Shen <voice.shen@atmel.com>
>> ---
>> arch/arm/mach-at91/sam9_smc.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
>> index a137da4..65c4558 100644
>> --- a/arch/arm/mach-at91/sam9_smc.c
>> +++ b/arch/arm/mach-at91/sam9_smc.c
>> @@ -16,7 +16,11 @@
>>
>> #include <mach/at91sam9_smc.h>
>>
>> +#ifdef CONFIG_ARCH_SAMA5D3
>> +#define AT91_SMC_CS(id, n)	(smc_base_addr[id] + ((n) * 0x14))
>> +#else
>> #define AT91_SMC_CS(id, n)	(smc_base_addr[id] + ((n) * 0x10))
>> +#endif
> NACK no ifdef
>
> this need to be runtime

Oh, this make me read more and think more. The mode register in SMC on 
sama5d3 SoC also has different offset.

So, how about move this into <mach/at91sam9_smc.h>, or create a new 
<mach/sama5_smc.h>, and then, use #ifdef to choose different SoC? If 
this not acceptable, can we use #ifdef in <mach/at91sam9_smc.h>?

> and you need to put our SOB
>>
>> static void __iomem *smc_base_addr[2];
>>
>> --
>> 2.0.0.rc2

Best Regards,
Bo Shen


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] SAMA5D3X FIX AT91_SMC_CS offset stride
  2014-05-28 17:16 [PATCH] SAMA5D3X FIX " Matteo Fortini
@ 2014-05-29  1:31 ` Bo Shen
  0 siblings, 0 replies; 5+ messages in thread
From: Bo Shen @ 2014-05-29  1:31 UTC (permalink / raw)
  To: Matteo Fortini; +Cc: barebox

Hi Matteo,
   Thanks for your patch. Can you resend it directly while not through 
attachment?
   When you resend, you can add my acked-by.

Best Regards,
Bo Shen

On 05/29/2014 01:16 AM, Matteo Fortini wrote:
> 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.
>
> For this reason, I was unable to use the NAND memory on my board (CS
> configuration was not applied and the timings were wrong).
>
> This patch fixes the problem.
>
> Matteo


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] SAMA5D3X FIX AT91_SMC_CS offset stride
@ 2014-05-28 17:16 Matteo Fortini
  2014-05-29  1:31 ` Bo Shen
  0 siblings, 1 reply; 5+ messages in thread
From: Matteo Fortini @ 2014-05-28 17:16 UTC (permalink / raw)
  To: barebox

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

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.

For this reason, I was unable to use the NAND memory on my board (CS
configuration was not applied and the timings were wrong).

This patch fixes the problem.

Matteo

[-- Attachment #2: 0001-sama5d3x-fix-AT91_SMC_CS-offset-stride.patch --]
[-- Type: text/x-patch, Size: 753 bytes --]

From 6c26d7c00005cbf4470017a6d5361a346981bbe5 Mon Sep 17 00:00:00 2001
From: Matteo Fortini <matteo.fortini@gmail.com>
Date: Wed, 28 May 2014 19:00:42 +0200
Subject: [PATCH] sama5d3x: fix AT91_SMC_CS offset stride

---
 arch/arm/mach-at91/sam9_smc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
index a137da4..65c4558 100644
--- a/arch/arm/mach-at91/sam9_smc.c
+++ b/arch/arm/mach-at91/sam9_smc.c
@@ -16,7 +16,11 @@
 
 #include <mach/at91sam9_smc.h>
 
+#ifdef CONFIG_ARCH_SAMA5D3
+#define AT91_SMC_CS(id, n)	(smc_base_addr[id] + ((n) * 0x14))
+#else
 #define AT91_SMC_CS(id, n)	(smc_base_addr[id] + ((n) * 0x10))
+#endif
 
 static void __iomem *smc_base_addr[2];
 
-- 
2.0.0.rc2


[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-30  1:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-29  9:55 [PATCH] sama5d3x: fix AT91_SMC_CS offset stride Matteo Fortini
2014-05-29 12:11 ` Jean-Christophe PLAGNIOL-VILLARD
2014-05-30  1:43   ` Bo Shen
  -- strict thread matches above, loose matches on Subject: below --
2014-05-28 17:16 [PATCH] SAMA5D3X FIX " Matteo Fortini
2014-05-29  1:31 ` Bo Shen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox