Commit bb56d5b5 authored by Alessandro Rubini's avatar Alessandro Rubini

bugfix: kernel: use more relaxed nand timings

We used the timing from the g45ek, but ours is slower. Actually, ours
is slower only in 16-bit mode, and has the same timing when used in
8-bit mode.

Our timing setup was outside of the allowed specification, and resulted
in random and unreproducible failures.  The "visible" effect is
that reading 100MB takes 13.4s instead of 11.4s, measured with:

  time dd bs=1k count=102400 < /dev/mtd1 > /dev/null

You can try another, still slower, setup just by hand, like this
(in this order):

   devmem 0xffffe83c w 0x00051003
   devmem 0xffffe838 w 0x000f000f
   devmem 0xffffe830 w 0x04060406

but the current settings (41003, 000c000c, 02040204) are alread within
specification.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent cfdbd93f
From fe419a23b22d588864496bd38b42c96617a6fe6c Mon Sep 17 00:00:00 2001
From: Alessandro Rubini <rubini@gnudd.com>
Date: Mon, 28 Jul 2014 15:20:59 +0200
Subject: [PATCH 12/12] sam9m10g45ek (for wrs): more relaxed nand timings
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
---
arch/arm/mach-at91/board-sam9m10g45ek.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index 2eb70d5..a6e5c67 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -194,21 +194,21 @@ static struct atmel_nand_data __initdata ek_nand_data = {
};
static struct sam9_smc_config __initdata ek_nand_smc_config = {
- .ncs_read_setup = 0,
- .nrd_setup = 2,
- .ncs_write_setup = 0,
- .nwe_setup = 2,
+ .ncs_read_setup = 2,
+ .nrd_setup = 4,
+ .ncs_write_setup = 2,
+ .nwe_setup = 4,
.ncs_read_pulse = 4,
.nrd_pulse = 4,
.ncs_write_pulse = 4,
.nwe_pulse = 4,
- .read_cycle = 7,
- .write_cycle = 7,
+ .read_cycle = 12,
+ .write_cycle = 12,
.mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
- .tdf_cycles = 3,
+ .tdf_cycles = 4,
};
static void __init ek_add_device_nand(void)
--
1.7.7.2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment