mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Eric Bénard" <eric@eukrea.com>
To: barebox@lists.infradead.org
Subject: [PATCH 4/7] sama5d3xek: update nand timings
Date: Sat,  7 Dec 2013 10:36:57 +0100	[thread overview]
Message-ID: <1386409020-11914-4-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1386409020-11914-1-git-send-email-eric@eukrea.com>

This updates nand timings to at91bootstrap's ones (branch 3.5.x)
With this setting nand flash is properly detected when we boot from SPI
NOR flash.

When booting on SPI NOR, log is now :
nand: ONFI param page 0 valid
nand: ONFI flash detected
nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron MT29F2G08ABAEAWP), 256MiB, page size: 2048, OOB size: 64
atmel_nand atmel_nand0: Initialize PMECC params, cap: 4, sector: 512

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 arch/arm/boards/sama5d3xek/init.c | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/arch/arm/boards/sama5d3xek/init.c b/arch/arm/boards/sama5d3xek/init.c
index 482c74a..ff62550 100644
--- a/arch/arm/boards/sama5d3xek/init.c
+++ b/arch/arm/boards/sama5d3xek/init.c
@@ -29,8 +29,7 @@
 #include <sizes.h>
 #include <linux/mtd/nand.h>
 #include <mach/board.h>
-#include <mach/at91sam9_smc.h>
-#include <mach/at91sam9_smc.h>
+#include <mach/sama5_smc.h>
 #include <gpio.h>
 #include <mach/io.h>
 #include <mach/iomux.h>
@@ -71,19 +70,28 @@ static struct atmel_nand_data nand_pdata = {
 	.on_flash_bbt	= 1,
 };
 
-static struct sam9_smc_config cm_nand_smc_config = {
-	.ncs_read_setup		= 0,
-	.nrd_setup		= 1,
-	.ncs_write_setup	= 0,
+static struct sama5_smc_config cm_nand_smc_config = {
+	.ncs_read_setup		= 1,
+	.nrd_setup		= 2,
+	.ncs_write_setup	= 1,
 	.nwe_setup		= 1,
 
-	.ncs_read_pulse		= 6,
-	.nrd_pulse		= 4,
-	.ncs_write_pulse	= 5,
-	.nwe_pulse		= 3,
+	.ncs_read_pulse		= 7,
+	.nrd_pulse		= 5,
+	.ncs_write_pulse	= 7,
+	.nwe_pulse		= 5,
 
-	.read_cycle		= 6,
-	.write_cycle		= 5,
+	.read_cycle		= 9,
+	.write_cycle		= 8,
+
+	.cle_to_ren_low_delay	= 3,
+	.ale_to_data_start	= 10,
+	.ale_to_ren_low_delay	= 3,
+	.off_chip_memory_scrambling_enable = 0,
+	.ready_to_ren_low_delay = 4,
+	.wen_high_to_ren_to_busy = 5,
+	.ready_busy_line_selection = 3,
+	.nand_flash_selection	= 1,
 
 	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
 	.tdf_cycles		= 1,
@@ -102,7 +110,7 @@ static void ek_add_device_nand(void)
 		cm_nand_smc_config.mode |= AT91_SMC_DBW_8;
 
 	/* configure chip-select 3 (NAND) */
-	sam9_smc_configure(0, 3, &cm_nand_smc_config);
+	sama5_smc_configure(0, 3, &cm_nand_smc_config);
 
 	at91_add_device_nand(&nand_pdata);
 }
-- 
1.8.3.1


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

  parent reply	other threads:[~2013-12-07  9:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-07  9:36 [PATCH 1/7] atmel_nand: check gpio validity before using it Eric Bénard
2013-12-07  9:36 ` [PATCH 2/7] at91: introduce sama5d3's SMC support Eric Bénard
2013-12-09 13:27   ` Jean-Christophe PLAGNIOL-VILLARD
2013-12-12  8:51     ` Sascha Hauer
2013-12-12  9:53       ` Eric Bénard
2013-12-07  9:36 ` [PATCH 3/7] at91: sama5d3: use the sama5 smc instead of the sam9 one Eric Bénard
2013-12-09 13:28   ` Jean-Christophe PLAGNIOL-VILLARD
2013-12-07  9:36 ` Eric Bénard [this message]
2013-12-07  9:36 ` [PATCH 5/7] atmel_nand: make chip_delay configurable Eric Bénard
2013-12-09 13:30   ` Jean-Christophe PLAGNIOL-VILLARD
2013-12-09 14:54     ` Eric Bénard
2013-12-09 16:32       ` Jean-Christophe PLAGNIOL-VILLARD
2013-12-09 16:57         ` Eric Bénard
2013-12-09 17:15         ` Eric Bénard
2013-12-10  7:25           ` Sascha Hauer
2013-12-07  9:36 ` [PATCH 6/7] sama5d3xek: add NOR CFI support Eric Bénard
2013-12-09 13:37   ` Jean-Christophe PLAGNIOL-VILLARD
2013-12-12  8:57     ` Sascha Hauer
2013-12-12  9:52       ` Eric Bénard
2013-12-07  9:37 ` [PATCH 7/7] samsa5d3xek: update defconfig Eric Bénard
2013-12-09 13:31   ` Jean-Christophe PLAGNIOL-VILLARD
2013-12-09 14:53     ` Eric Bénard
2013-12-09 16:33       ` Jean-Christophe PLAGNIOL-VILLARD
2013-12-09 16:48       ` Alexander Aring
2013-12-09  8:36 ` [PATCH 1/7] atmel_nand: check gpio validity before using it Sascha Hauer
2013-12-09 13:31   ` Jean-Christophe PLAGNIOL-VILLARD
2013-12-09 13:34 ` Jean-Christophe PLAGNIOL-VILLARD

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=1386409020-11914-4-git-send-email-eric@eukrea.com \
    --to=eric@eukrea.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