aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSukumar Ghorai <s-ghorai@ti.com>2011-01-28 05:12:08 -0500
committerTony Lindgren <tony@atomide.com>2011-02-17 18:32:54 -0500
commitf3d73f362d689a1d044e77964864f0a8ea0217f3 (patch)
tree78952365f2a575234fe8cfa0bdf04e268080cd1a /arch
parent317379a975c07fe63bc4f86dabd668df96ff3df2 (diff)
omap3: nand: ecc layout select from board file
This patch makes it possible to select sw or hw (different layout options) ecc scheme supported by omap nand driver. Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/board-flash.c1
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc.h6
-rw-r--r--arch/arm/plat-omap/include/plat/nand.h2
3 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 19645095d59..a7681981201 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -148,6 +148,7 @@ __init board_nand_init(struct mtd_partition *nand_parts,
148 board_nand_data.nr_parts = nr_parts; 148 board_nand_data.nr_parts = nr_parts;
149 board_nand_data.devsize = nand_type; 149 board_nand_data.devsize = nand_type;
150 150
151 board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
151 board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs; 152 board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs;
152 gpmc_nand_init(&board_nand_data); 153 gpmc_nand_init(&board_nand_data);
153} 154}
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
index a2434639063..773351bc25a 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -86,6 +86,12 @@
86#define PREFETCH_FIFOTHRESHOLD_MAX 0x40 86#define PREFETCH_FIFOTHRESHOLD_MAX 0x40
87#define PREFETCH_FIFOTHRESHOLD(val) ((val) << 8) 87#define PREFETCH_FIFOTHRESHOLD(val) ((val) << 8)
88 88
89enum omap_ecc {
90 /* 1-bit ecc: stored at end of spare area */
91 OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
92 OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
93};
94
89/* 95/*
90 * Note that all values in this struct are in nanoseconds except sync_clk 96 * Note that all values in this struct are in nanoseconds except sync_clk
91 * (which is in picoseconds), while the register values are in gpmc_fck cycles. 97 * (which is in picoseconds), while the register values are in gpmc_fck cycles.
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/arch/arm/plat-omap/include/plat/nand.h
index ae5e0538303..d86d1ecf006 100644
--- a/arch/arm/plat-omap/include/plat/nand.h
+++ b/arch/arm/plat-omap/include/plat/nand.h
@@ -8,6 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <plat/gpmc.h>
11#include <linux/mtd/partitions.h> 12#include <linux/mtd/partitions.h>
12 13
13enum nand_io { 14enum nand_io {
@@ -31,6 +32,7 @@ struct omap_nand_platform_data {
31 enum nand_io xfer_type; 32 enum nand_io xfer_type;
32 unsigned long phys_base; 33 unsigned long phys_base;
33 int devsize; 34 int devsize;
35 enum omap_ecc ecc_opt;
34}; 36};
35 37
36/* minimum size for IO mapping */ 38/* minimum size for IO mapping */