* [PATCH 0/6] davinci: add support for aemif timing configuration
@ 2010-08-09 10:16 Sekhar Nori
2010-08-09 10:16 ` [PATCH v3 1/6] " Sekhar Nori
2010-08-29 11:48 ` [PATCH 0/6] davinci: add support for aemif timing configuration Artem Bityutskiy
0 siblings, 2 replies; 11+ messages in thread
From: Sekhar Nori @ 2010-08-09 10:16 UTC (permalink / raw)
To: linux-mtd
Cc: Kevin Hilman, Sekhar Nori, davinci-linux-open-source,
David Woodhouse
This series of patches adds support for AEMIF timing configuration
for DaVinci SoCs.
Currently AEMIF timing configuration is done as a special case for
DM644x EVM. This work provides for a generic way of doing this.
David,
Patch 1/6 and 2/6 of this series touch the
drivers/mtd/nand/davinci_nand.c file along with other arch specific
files. Based on the discussion on DaVinci list, Kevin is OK to merge
this with your agreement. Please let us know how to proceed.
Sekhar Nori (5):
davinci: add support for aemif timing configuration
nand: davinci: add support for timing configuration
davinci: dm644x evm: setup NAND flash timing
davinci: am18x/da850/omap-l138 evm: setup NAND flash timing
davinci: dm6467t evm: setup NAND flash timing
Sudhakar Rajashekhara (1):
davinci: am17x/da830/omap-l137 evm: setup NAND flash timing
arch/arm/mach-davinci/Makefile | 2 +-
arch/arm/mach-davinci/aemif.c | 133 ++++++++++++++++++++++++++++
arch/arm/mach-davinci/board-da830-evm.c | 12 +++
arch/arm/mach-davinci/board-da850-evm.c | 12 +++
arch/arm/mach-davinci/board-dm644x-evm.c | 12 +++
arch/arm/mach-davinci/board-dm646x-evm.c | 14 +++
arch/arm/mach-davinci/include/mach/aemif.h | 36 ++++++++
arch/arm/mach-davinci/include/mach/nand.h | 6 +-
drivers/mtd/nand/davinci_nand.c | 61 +++++--------
9 files changed, 246 insertions(+), 42 deletions(-)
create mode 100644 arch/arm/mach-davinci/aemif.c
create mode 100644 arch/arm/mach-davinci/include/mach/aemif.h
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 1/6] davinci: add support for aemif timing configuration
2010-08-09 10:16 [PATCH 0/6] davinci: add support for aemif timing configuration Sekhar Nori
@ 2010-08-09 10:16 ` Sekhar Nori
2010-08-09 10:16 ` [PATCH v2 2/6] nand: davinci: add support for " Sekhar Nori
2010-08-29 11:48 ` [PATCH 0/6] davinci: add support for aemif timing configuration Artem Bityutskiy
1 sibling, 1 reply; 11+ messages in thread
From: Sekhar Nori @ 2010-08-09 10:16 UTC (permalink / raw)
To: linux-mtd
Cc: Kevin Hilman, Sekhar Nori, davinci-linux-open-source,
David Woodhouse
This patch adds support to configure the AEMIF interface
with supplied timing values.
Since this capability is useful both from NOR and NAND
flashes, it is provided as a new interface and in a file
of its own.
AEMIF timing configuration is required in cases:
1) Where the AEMIF clock rate can change at runtime (a side
affect of cpu frequency change).
2) Where U-Boot does not support NAND/NOR but supports other
media like SPI Flash or MMC/SD and thus does not care about
setting up the AEMIF timing for kernel to use.
3) Where U-Boot just hasn't configured the timing values and
cannot be upgraded because the box is already in the field.
Since there is now a header file for AEMIF interface, the
common (non-NAND specific) defines for AEMIF registers have
been moved from nand.h into the newly created aemif.h
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
---
v3: use NSEC_PER_MSEC from <linux/time.h> instead of defining a new macro
arch/arm/mach-davinci/Makefile | 2 +-
arch/arm/mach-davinci/aemif.c | 133 ++++++++++++++++++++++++++++
arch/arm/mach-davinci/include/mach/aemif.h | 36 ++++++++
arch/arm/mach-davinci/include/mach/nand.h | 3 -
drivers/mtd/nand/davinci_nand.c | 1 +
5 files changed, 171 insertions(+), 4 deletions(-)
create mode 100644 arch/arm/mach-davinci/aemif.c
create mode 100644 arch/arm/mach-davinci/include/mach/aemif.h
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index eab4c0f..77a0f71 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -5,7 +5,7 @@
# Common objects
obj-y := time.o clock.o serial.o io.o psc.o \
- gpio.o dma.o usb.o common.o sram.o
+ gpio.o dma.o usb.o common.o sram.o aemif.o
obj-$(CONFIG_DAVINCI_MUX) += mux.o
diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c
new file mode 100644
index 0000000..9c3f500
--- /dev/null
+++ b/arch/arm/mach-davinci/aemif.c
@@ -0,0 +1,133 @@
+/*
+ * AEMIF support for DaVinci SoCs
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated. http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/clk.h>
+#include <linux/module.h>
+#include <linux/time.h>
+
+#include <mach/aemif.h>
+
+/* Timing value configuration */
+
+#define TA(x) ((x) << 2)
+#define RHOLD(x) ((x) << 4)
+#define RSTROBE(x) ((x) << 7)
+#define RSETUP(x) ((x) << 13)
+#define WHOLD(x) ((x) << 17)
+#define WSTROBE(x) ((x) << 20)
+#define WSETUP(x) ((x) << 26)
+
+#define TA_MAX 0x3
+#define RHOLD_MAX 0x7
+#define RSTROBE_MAX 0x3f
+#define RSETUP_MAX 0xf
+#define WHOLD_MAX 0x7
+#define WSTROBE_MAX 0x3f
+#define WSETUP_MAX 0xf
+
+#define TIMING_MASK (TA(TA_MAX) | \
+ RHOLD(RHOLD_MAX) | \
+ RSTROBE(RSTROBE_MAX) | \
+ RSETUP(RSETUP_MAX) | \
+ WHOLD(WHOLD_MAX) | \
+ WSTROBE(WSTROBE_MAX) | \
+ WSETUP(WSETUP_MAX))
+
+/*
+ * aemif_calc_rate - calculate timing data.
+ * @wanted: The cycle time needed in nanoseconds.
+ * @clk: The input clock rate in kHz.
+ * @max: The maximum divider value that can be programmed.
+ *
+ * On success, returns the calculated timing value minus 1 for easy
+ * programming into AEMIF timing registers, else negative errno.
+ */
+static int aemif_calc_rate(int wanted, unsigned long clk, int max)
+{
+ int result;
+
+ result = DIV_ROUND_UP((wanted * clk), NSEC_PER_MSEC) - 1;
+
+ pr_debug("%s: result %d from %ld, %d\n", __func__, result, clk, wanted);
+
+ /* It is generally OK to have a more relaxed timing than requested... */
+ if (result < 0)
+ result = 0;
+
+ /* ... But configuring tighter timings is not an option. */
+ else if (result > max)
+ result = -EINVAL;
+
+ return result;
+}
+
+/**
+ * davinci_aemif_setup_timing - setup timing values for a given AEMIF interface
+ * @t: timing values to be progammed
+ * @base: The virtual base address of the AEMIF interface
+ * @cs: chip-select to program the timing values for
+ *
+ * This function programs the given timing values (in real clock) into the
+ * AEMIF registers taking the AEMIF clock into account.
+ *
+ * This function does not use any locking while programming the AEMIF
+ * because it is expected that there is only one user of a given
+ * chip-select.
+ *
+ * Returns 0 on success, else negative errno.
+ */
+int davinci_aemif_setup_timing(struct davinci_aemif_timing *t,
+ void __iomem *base, unsigned cs)
+{
+ unsigned set, val;
+ unsigned ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup;
+ unsigned offset = A1CR_OFFSET + cs * 4;
+ struct clk *aemif_clk;
+ unsigned long clkrate;
+
+ if (!t)
+ return 0; /* Nothing to do */
+
+ aemif_clk = clk_get(NULL, "aemif");
+ if (IS_ERR(aemif_clk))
+ return PTR_ERR(aemif_clk);
+
+ clkrate = clk_get_rate(aemif_clk);
+
+ clkrate /= 1000; /* turn clock into kHz for ease of use */
+
+ ta = aemif_calc_rate(t->ta, clkrate, TA_MAX);
+ rhold = aemif_calc_rate(t->rhold, clkrate, RHOLD_MAX);
+ rstrobe = aemif_calc_rate(t->rstrobe, clkrate, RSTROBE_MAX);
+ rsetup = aemif_calc_rate(t->rsetup, clkrate, RSETUP_MAX);
+ whold = aemif_calc_rate(t->whold, clkrate, WHOLD_MAX);
+ wstrobe = aemif_calc_rate(t->wstrobe, clkrate, WSTROBE_MAX);
+ wsetup = aemif_calc_rate(t->wsetup, clkrate, WSETUP_MAX);
+
+ if (ta < 0 || rhold < 0 || rstrobe < 0 || rsetup < 0 ||
+ whold < 0 || wstrobe < 0 || wsetup < 0) {
+ pr_err("%s: cannot get suitable timings\n", __func__);
+ return -EINVAL;
+ }
+
+ set = TA(ta) | RHOLD(rhold) | RSTROBE(rstrobe) | RSETUP(rsetup) |
+ WHOLD(whold) | WSTROBE(wstrobe) | WSETUP(wsetup);
+
+ val = __raw_readl(base + offset);
+ val &= ~TIMING_MASK;
+ val |= set;
+ __raw_writel(val, base + offset);
+
+ return 0;
+}
+EXPORT_SYMBOL(davinci_aemif_setup_timing);
diff --git a/arch/arm/mach-davinci/include/mach/aemif.h b/arch/arm/mach-davinci/include/mach/aemif.h
new file mode 100644
index 0000000..05b2934
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/aemif.h
@@ -0,0 +1,36 @@
+/*
+ * TI DaVinci AEMIF support
+ *
+ * Copyright 2010 (C) Texas Instruments, Inc. http://www.ti.com/
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+#ifndef _MACH_DAVINCI_AEMIF_H
+#define _MACH_DAVINCI_AEMIF_H
+
+#define NRCSR_OFFSET 0x00
+#define AWCCR_OFFSET 0x04
+#define A1CR_OFFSET 0x10
+
+#define ACR_ASIZE_MASK 0x3
+#define ACR_EW_MASK BIT(30)
+#define ACR_SS_MASK BIT(31)
+
+/* All timings in nanoseconds */
+struct davinci_aemif_timing {
+ u8 wsetup;
+ u8 wstrobe;
+ u8 whold;
+
+ u8 rsetup;
+ u8 rstrobe;
+ u8 rhold;
+
+ u8 ta;
+};
+
+int davinci_aemif_setup_timing(struct davinci_aemif_timing *t,
+ void __iomem *base, unsigned cs);
+#endif
diff --git a/arch/arm/mach-davinci/include/mach/nand.h b/arch/arm/mach-davinci/include/mach/nand.h
index b2ad809..b5893f0 100644
--- a/arch/arm/mach-davinci/include/mach/nand.h
+++ b/arch/arm/mach-davinci/include/mach/nand.h
@@ -30,9 +30,6 @@
#include <linux/mtd/nand.h>
-#define NRCSR_OFFSET 0x00
-#define AWCCR_OFFSET 0x04
-#define A1CR_OFFSET 0x10
#define NANDFCR_OFFSET 0x60
#define NANDFSR_OFFSET 0x64
#define NANDF1ECC_OFFSET 0x70
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 2ac7367..8e2d56c 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -35,6 +35,7 @@
#include <linux/slab.h>
#include <mach/nand.h>
+#include <mach/aemif.h>
#include <asm/mach-types.h>
--
1.6.2.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/6] nand: davinci: add support for timing configuration
2010-08-09 10:16 ` [PATCH v3 1/6] " Sekhar Nori
@ 2010-08-09 10:16 ` Sekhar Nori
2010-08-09 10:16 ` [PATCH 3/6] davinci: dm644x evm: setup NAND flash timing Sekhar Nori
0 siblings, 1 reply; 11+ messages in thread
From: Sekhar Nori @ 2010-08-09 10:16 UTC (permalink / raw)
To: linux-mtd
Cc: Kevin Hilman, Sekhar Nori, davinci-linux-open-source,
David Woodhouse
This patch modifies the DaVinci NAND driver to use the
new AEMIF timing setup API to configure the NAND access
timings.
Earlier, AEMIF configuration was being done as a special
case for DM644x board, but now more boards emerge which have
capability to boot for other media (SPI flash, NOR flash) and
have the kernel access NAND flash. This means that kernel cannot
always depend on the bootloader to setup the NAND.
Also, on platforms such as da850/omap-l138, the aemif input
frequency changes as cpu frequency changes; necessiating
re-calculation of timimg values as part of cpufreq transtitions.
This patch forms the basis for adding that support.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
---
v2: no need to include aemif.h in nand.c in this patch since patch 1/6 does
that now.
arch/arm/mach-davinci/include/mach/nand.h | 3 +
drivers/mtd/nand/davinci_nand.c | 60 ++++++++++------------------
2 files changed, 25 insertions(+), 38 deletions(-)
diff --git a/arch/arm/mach-davinci/include/mach/nand.h b/arch/arm/mach-davinci/include/mach/nand.h
index b5893f0..0251510 100644
--- a/arch/arm/mach-davinci/include/mach/nand.h
+++ b/arch/arm/mach-davinci/include/mach/nand.h
@@ -80,6 +80,9 @@ struct davinci_nand_pdata { /* platform_data */
/* Main and mirror bbt descriptor overrides */
struct nand_bbt_descr *bbt_td;
struct nand_bbt_descr *bbt_md;
+
+ /* Access timings */
+ struct davinci_aemif_timing *timing;
};
#endif /* __ARCH_ARM_DAVINCI_NAND_H */
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 8e2d56c..8beb0d0 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -75,6 +75,8 @@ struct davinci_nand_info {
uint32_t mask_cle;
uint32_t core_chipsel;
+
+ struct davinci_aemif_timing *timing;
};
static DEFINE_SPINLOCK(davinci_nand_lock);
@@ -479,36 +481,6 @@ static int nand_davinci_dev_ready(struct mtd_info *mtd)
return davinci_nand_readl(info, NANDFSR_OFFSET) & BIT(0);
}
-static void __init nand_dm6446evm_flash_init(struct davinci_nand_info *info)
-{
- uint32_t regval, a1cr;
-
- /*
- * NAND FLASH timings @ PLL1 == 459 MHz
- * - AEMIF.CLK freq = PLL1/6 = 459/6 = 76.5 MHz
- * - AEMIF.CLK period = 1/76.5 MHz = 13.1 ns
- */
- regval = 0
- | (0 << 31) /* selectStrobe */
- | (0 << 30) /* extWait (never with NAND) */
- | (1 << 26) /* writeSetup 10 ns */
- | (3 << 20) /* writeStrobe 40 ns */
- | (1 << 17) /* writeHold 10 ns */
- | (0 << 13) /* readSetup 10 ns */
- | (3 << 7) /* readStrobe 60 ns */
- | (0 << 4) /* readHold 10 ns */
- | (3 << 2) /* turnAround ?? ns */
- | (0 << 0) /* asyncSize 8-bit bus */
- ;
- a1cr = davinci_nand_readl(info, A1CR_OFFSET);
- if (a1cr != regval) {
- dev_dbg(info->dev, "Warning: NAND config: Set A1CR " \
- "reg to 0x%08x, was 0x%08x, should be done by " \
- "bootloader.\n", regval, a1cr);
- davinci_nand_writel(info, A1CR_OFFSET, regval);
- }
-}
-
/*----------------------------------------------------------------------*/
/* An ECC layout for using 4-bit ECC with small-page flash, storing
@@ -612,6 +584,7 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
info->chip.options = pdata->options;
info->chip.bbt_td = pdata->bbt_td;
info->chip.bbt_md = pdata->bbt_md;
+ info->timing = pdata->timing;
info->ioaddr = (uint32_t __force) vaddr;
@@ -689,15 +662,25 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
goto err_clk_enable;
}
- /* EMIF timings should normally be set by the boot loader,
- * especially after boot-from-NAND. The *only* reason to
- * have this special casing for the DM6446 EVM is to work
- * with boot-from-NOR ... with CS0 manually re-jumpered
- * (after startup) so it addresses the NAND flash, not NOR.
- * Even for dev boards, that's unusually rude...
+ /*
+ * Setup Async configuration register in case we did not boot from
+ * NAND and so bootloader did not bother to set it up.
*/
- if (machine_is_davinci_evm())
- nand_dm6446evm_flash_init(info);
+ val = davinci_nand_readl(info, A1CR_OFFSET + info->core_chipsel * 4);
+
+ /* Extended Wait is not valid and Select Strobe mode is not used */
+ val &= ~(ACR_ASIZE_MASK | ACR_EW_MASK | ACR_SS_MASK);
+ if (info->chip.options & NAND_BUSWIDTH_16)
+ val |= 0x1;
+
+ davinci_nand_writel(info, A1CR_OFFSET + info->core_chipsel * 4, val);
+
+ ret = davinci_aemif_setup_timing(info->timing, info->base,
+ info->core_chipsel);
+ if (ret < 0) {
+ dev_dbg(&pdev->dev, "NAND timing values setup fail\n");
+ goto err_timing;
+ }
spin_lock_irq(&davinci_nand_lock);
@@ -810,6 +793,7 @@ syndrome_done:
return 0;
err_scan:
+err_timing:
clk_disable(info->clk);
err_clk_enable:
--
1.6.2.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/6] davinci: dm644x evm: setup NAND flash timing
2010-08-09 10:16 ` [PATCH v2 2/6] nand: davinci: add support for " Sekhar Nori
@ 2010-08-09 10:16 ` Sekhar Nori
2010-08-09 10:16 ` [PATCH 4/6] davinci: am17x/da830/omap-l137 " Sekhar Nori
0 siblings, 1 reply; 11+ messages in thread
From: Sekhar Nori @ 2010-08-09 10:16 UTC (permalink / raw)
To: linux-mtd
Cc: Kevin Hilman, Sekhar Nori, davinci-linux-open-source,
David Woodhouse
The DM644x EVM nand flash timing was earlier being
done as a special case in the NAND driver itself.
With the NAND driver now capable of progamming the
AEMIF interface using timing data passed from the
platform, the timing values are being moved into
their rightful place in the EVM specific board file.
The values being programmed match what was being done
earlier and thus do not represent any change in
performance/functionality.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/mach-davinci/board-dm644x-evm.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 34c8b41..65bb940 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -37,6 +37,7 @@
#include <mach/nand.h>
#include <mach/mmc.h>
#include <mach/usb.h>
+#include <mach/aemif.h>
#define DM644X_EVM_PHY_MASK (0x2)
#define DM644X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
@@ -137,11 +138,22 @@ static struct mtd_partition davinci_evm_nandflash_partition[] = {
*/
};
+static struct davinci_aemif_timing davinci_evm_nandflash_timing = {
+ .wsetup = 20,
+ .wstrobe = 40,
+ .whold = 20,
+ .rsetup = 10,
+ .rstrobe = 40,
+ .rhold = 10,
+ .ta = 40,
+};
+
static struct davinci_nand_pdata davinci_evm_nandflash_data = {
.parts = davinci_evm_nandflash_partition,
.nr_parts = ARRAY_SIZE(davinci_evm_nandflash_partition),
.ecc_mode = NAND_ECC_HW,
.options = NAND_USE_FLASH_BBT,
+ .timing = &davinci_evm_nandflash_timing,
};
static struct resource davinci_evm_nandflash_resource[] = {
--
1.6.2.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/6] davinci: am17x/da830/omap-l137 evm: setup NAND flash timing
2010-08-09 10:16 ` [PATCH 3/6] davinci: dm644x evm: setup NAND flash timing Sekhar Nori
@ 2010-08-09 10:16 ` Sekhar Nori
2010-08-09 10:16 ` [PATCH 5/6] davinci: am18x/da850/omap-l138 " Sekhar Nori
0 siblings, 1 reply; 11+ messages in thread
From: Sekhar Nori @ 2010-08-09 10:16 UTC (permalink / raw)
To: linux-mtd
Cc: davinci-linux-open-source, Sudhakar Rajashekhara, Kevin Hilman,
Sekhar Nori, Mukul Bhatnagar, David Woodhouse
From: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Setup the NAND flash timings for DA830 EVM.
Before configuring the timing values, throughput calculation
using dd command yielded 477 kB/s write and 970 kB/s read speed.
After the timing configuration, the throughput was measured to
be 2.5 MB/s write and 5.1 MB/s read.
[Mukul Bhatnagar: actual calculation of timing values from the
NAND datasheet]
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Cc: Mukul Bhatnagar <mbhatnagar@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/mach-davinci/board-da830-evm.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index b61e872..4edbf3d 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -29,6 +29,7 @@
#include <mach/nand.h>
#include <mach/da8xx.h>
#include <mach/usb.h>
+#include <mach/aemif.h>
#define DA830_EVM_PHY_MASK 0x0
#define DA830_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
@@ -360,6 +361,16 @@ static struct nand_bbt_descr da830_evm_nand_bbt_mirror_descr = {
.pattern = da830_evm_nand_mirror_pattern
};
+static struct davinci_aemif_timing da830_evm_nandflash_timing = {
+ .wsetup = 24,
+ .wstrobe = 21,
+ .whold = 14,
+ .rsetup = 19,
+ .rstrobe = 50,
+ .rhold = 0,
+ .ta = 20,
+};
+
static struct davinci_nand_pdata da830_evm_nand_pdata = {
.parts = da830_evm_nand_partitions,
.nr_parts = ARRAY_SIZE(da830_evm_nand_partitions),
@@ -368,6 +379,7 @@ static struct davinci_nand_pdata da830_evm_nand_pdata = {
.options = NAND_USE_FLASH_BBT,
.bbt_td = &da830_evm_nand_bbt_main_descr,
.bbt_md = &da830_evm_nand_bbt_mirror_descr,
+ .timing = &da830_evm_nandflash_timing,
};
static struct resource da830_evm_nand_resources[] = {
--
1.6.2.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/6] davinci: am18x/da850/omap-l138 evm: setup NAND flash timing
2010-08-09 10:16 ` [PATCH 4/6] davinci: am17x/da830/omap-l137 " Sekhar Nori
@ 2010-08-09 10:16 ` Sekhar Nori
2010-08-09 10:16 ` [PATCH v2 6/6] davinci: dm6467t " Sekhar Nori
0 siblings, 1 reply; 11+ messages in thread
From: Sekhar Nori @ 2010-08-09 10:16 UTC (permalink / raw)
To: linux-mtd
Cc: Kevin Hilman, Sekhar Nori, davinci-linux-open-source,
Mukul Bhatnagar, David Woodhouse
Setup the NAND flash timings for DA850 EVM
Before configuring the timing values, throughput calculation
using dd command yielded 469 kB/s write and 966 kB/s read speed.
After the timing configuration, the throughput was measured to
be 2.4 MB/s write and 5 MB/s read.
[Mukul Bhatnagar: actual calculation of timing values from the
NAND datasheet]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Cc: Mukul Bhatnagar <mbhatnagar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/mach-davinci/board-da850-evm.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index fa429cc..b5ac86f 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -36,6 +36,7 @@
#include <mach/da8xx.h>
#include <mach/nand.h>
#include <mach/mux.h>
+#include <mach/aemif.h>
#define DA850_EVM_PHY_MASK 0x1
#define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
@@ -143,12 +144,23 @@ static struct mtd_partition da850_evm_nandflash_partition[] = {
},
};
+static struct davinci_aemif_timing da850_evm_nandflash_timing = {
+ .wsetup = 24,
+ .wstrobe = 21,
+ .whold = 14,
+ .rsetup = 19,
+ .rstrobe = 50,
+ .rhold = 0,
+ .ta = 20,
+};
+
static struct davinci_nand_pdata da850_evm_nandflash_data = {
.parts = da850_evm_nandflash_partition,
.nr_parts = ARRAY_SIZE(da850_evm_nandflash_partition),
.ecc_mode = NAND_ECC_HW,
.ecc_bits = 4,
.options = NAND_USE_FLASH_BBT,
+ .timing = &da850_evm_nandflash_timing,
};
static struct resource da850_evm_nandflash_resource[] = {
--
1.6.2.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 6/6] davinci: dm6467t evm: setup NAND flash timing
2010-08-09 10:16 ` [PATCH 5/6] davinci: am18x/da850/omap-l138 " Sekhar Nori
@ 2010-08-09 10:16 ` Sekhar Nori
0 siblings, 0 replies; 11+ messages in thread
From: Sekhar Nori @ 2010-08-09 10:16 UTC (permalink / raw)
To: linux-mtd
Cc: Kevin Hilman, Sekhar Nori, davinci-linux-open-source,
David Woodhouse
Setup NAND flash timing on DM6467T EVM.
Without the timing setup, the NAND flash on DM6467T
RevC EVM reports a number of random bad blocks because
of read errors.
Also, with this, copying a 100M file on RevB EVM takes
~35 sec against 1 minute 30 seconds earlier.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
---
v2: DM6467T and DM6467 EVMs use slightly different NAND parts, made the
timing configuration specific to DM6467T.
arch/arm/mach-davinci/board-dm646x-evm.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index b8b1dec..c8843c9 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -42,6 +42,7 @@
#include <mach/nand.h>
#include <mach/clock.h>
#include <mach/cdce949.h>
+#include <mach/aemif.h>
#include "clock.h"
@@ -71,6 +72,16 @@ static struct mtd_partition davinci_nand_partitions[] = {
}
};
+static struct davinci_aemif_timing dm6467tevm_nandflash_timing = {
+ .wsetup = 29,
+ .wstrobe = 24,
+ .whold = 14,
+ .rsetup = 19,
+ .rstrobe = 33,
+ .rhold = 0,
+ .ta = 29,
+};
+
static struct davinci_nand_pdata davinci_nand_data = {
.mask_cle = 0x80000,
.mask_ale = 0x40000,
@@ -763,6 +774,9 @@ static __init void evm_init(void)
dm646x_init_mcasp0(&dm646x_evm_snd_data[0]);
dm646x_init_mcasp1(&dm646x_evm_snd_data[1]);
+ if (machine_is_davinci_dm6467tevm())
+ davinci_nand_data.timing = &dm6467tevm_nandflash_timing;
+
platform_device_register(&davinci_nand_device);
dm646x_init_edma(dm646x_edma_rsv);
--
1.6.2.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/6] davinci: add support for aemif timing configuration
2010-08-09 10:16 [PATCH 0/6] davinci: add support for aemif timing configuration Sekhar Nori
2010-08-09 10:16 ` [PATCH v3 1/6] " Sekhar Nori
@ 2010-08-29 11:48 ` Artem Bityutskiy
2010-08-30 14:36 ` Kevin Hilman
1 sibling, 1 reply; 11+ messages in thread
From: Artem Bityutskiy @ 2010-08-29 11:48 UTC (permalink / raw)
To: Sekhar Nori
Cc: Kevin Hilman, David Woodhouse, davinci-linux-open-source,
linux-mtd
On Mon, 2010-08-09 at 15:46 +0530, Sekhar Nori wrote:
> This series of patches adds support for AEMIF timing configuration
> for DaVinci SoCs.
>
> Currently AEMIF timing configuration is done as a special case for
> DM644x EVM. This work provides for a generic way of doing this.
>
> David,
> Patch 1/6 and 2/6 of this series touch the
> drivers/mtd/nand/davinci_nand.c file along with other arch specific
> files. Based on the discussion on DaVinci list, Kevin is OK to merge
> this with your agreement. Please let us know how to proceed.
Pushed to l2-mtd-2.6.git / dunno.
--
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/6] davinci: add support for aemif timing configuration
2010-08-29 11:48 ` [PATCH 0/6] davinci: add support for aemif timing configuration Artem Bityutskiy
@ 2010-08-30 14:36 ` Kevin Hilman
2010-08-31 11:37 ` Artem Bityutskiy
0 siblings, 1 reply; 11+ messages in thread
From: Kevin Hilman @ 2010-08-30 14:36 UTC (permalink / raw)
To: dedekind1
Cc: linux-mtd, davinci-linux-open-source, Sekhar Nori,
David Woodhouse
Artem Bityutskiy <dedekind1@gmail.com> writes:
> On Mon, 2010-08-09 at 15:46 +0530, Sekhar Nori wrote:
>> This series of patches adds support for AEMIF timing configuration
>> for DaVinci SoCs.
>>
>> Currently AEMIF timing configuration is done as a special case for
>> DM644x EVM. This work provides for a generic way of doing this.
>>
>> David,
>> Patch 1/6 and 2/6 of this series touch the
>> drivers/mtd/nand/davinci_nand.c file along with other arch specific
>> files. Based on the discussion on DaVinci list, Kevin is OK to merge
>> this with your agreement. Please let us know how to proceed.
>
> Pushed to l2-mtd-2.6.git / dunno.
Hi Artem,
If it's OK with you, and with your Ack, I'd prefer to merge this series
via the davinci tree.
The reason is because the files touched in arch/arm/mach-davinci/* are
also getting lots of other changes for 2.6.37, and I'd like to minimize
conflicts.
Let me know if that's OK with you and if I can add your signoff to the
drivers/mtd/* patches.
Thanks,
Kevin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/6] davinci: add support for aemif timing configuration
2010-08-30 14:36 ` Kevin Hilman
@ 2010-08-31 11:37 ` Artem Bityutskiy
2010-08-31 14:49 ` Kevin Hilman
0 siblings, 1 reply; 11+ messages in thread
From: Artem Bityutskiy @ 2010-08-31 11:37 UTC (permalink / raw)
To: Kevin Hilman
Cc: linux-mtd, davinci-linux-open-source, Sekhar Nori,
David Woodhouse
On Mon, 2010-08-30 at 07:36 -0700, Kevin Hilman wrote:
> > Pushed to l2-mtd-2.6.git / dunno.
>
> Hi Artem,
>
> If it's OK with you, and with your Ack, I'd prefer to merge this series
> via the davinci tree.
>
> The reason is because the files touched in arch/arm/mach-davinci/* are
> also getting lots of other changes for 2.6.37, and I'd like to minimize
> conflicts.
Right, I've just removed them from my tree.
> Let me know if that's OK with you and if I can add your signoff to the
> drivers/mtd/* patches.
The MTD part is small there, feel free to add
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thanks!
--
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/6] davinci: add support for aemif timing configuration
2010-08-31 11:37 ` Artem Bityutskiy
@ 2010-08-31 14:49 ` Kevin Hilman
0 siblings, 0 replies; 11+ messages in thread
From: Kevin Hilman @ 2010-08-31 14:49 UTC (permalink / raw)
To: dedekind1
Cc: linux-mtd, davinci-linux-open-source, Sekhar Nori,
David Woodhouse
Artem Bityutskiy <dedekind1@gmail.com> writes:
> On Mon, 2010-08-30 at 07:36 -0700, Kevin Hilman wrote:
>> > Pushed to l2-mtd-2.6.git / dunno.
>>
>> Hi Artem,
>>
>> If it's OK with you, and with your Ack, I'd prefer to merge this series
>> via the davinci tree.
>>
>> The reason is because the files touched in arch/arm/mach-davinci/* are
>> also getting lots of other changes for 2.6.37, and I'd like to minimize
>> conflicts.
>
> Right, I've just removed them from my tree.
>
>> Let me know if that's OK with you and if I can add your signoff to the
>> drivers/mtd/* patches.
>
> The MTD part is small there, feel free to add
>
> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thanks Artem,
Kevin
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2010-08-31 14:49 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09 10:16 [PATCH 0/6] davinci: add support for aemif timing configuration Sekhar Nori
2010-08-09 10:16 ` [PATCH v3 1/6] " Sekhar Nori
2010-08-09 10:16 ` [PATCH v2 2/6] nand: davinci: add support for " Sekhar Nori
2010-08-09 10:16 ` [PATCH 3/6] davinci: dm644x evm: setup NAND flash timing Sekhar Nori
2010-08-09 10:16 ` [PATCH 4/6] davinci: am17x/da830/omap-l137 " Sekhar Nori
2010-08-09 10:16 ` [PATCH 5/6] davinci: am18x/da850/omap-l138 " Sekhar Nori
2010-08-09 10:16 ` [PATCH v2 6/6] davinci: dm6467t " Sekhar Nori
2010-08-29 11:48 ` [PATCH 0/6] davinci: add support for aemif timing configuration Artem Bityutskiy
2010-08-30 14:36 ` Kevin Hilman
2010-08-31 11:37 ` Artem Bityutskiy
2010-08-31 14:49 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).