Skip to contentSkip to conversation

nand prefetch-irq support and ecc layout chanage

PATCH Superseded Sukumar Ghorai 3 participants 18 messages Nov 26, 2010 – Dec 22, 2010

Subsystems (7)

v6 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v6 cover nand prefetch-irq support and ecc layout chanage

The following set of patches applies on linux-2.6.

The main motivations behind this patch series are -
1. support NAND I/O in irq mode.
2. support of different ECC schema.
3. also to make ecc layout as like in romcode ecc layout

v6: configurable transfer type from board file;

    #define irq number used for nand-irq

v5: http://www.mail-archive.com/linux-omap at vger.kernel.org/msg35860.html This address the input as to support the irq_chained in GPMC. And resend of
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg35848.html

v4: http://www.mail-archive.com/linux-omap at vger.kernel.org/msg34882.html and resend of
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg32689.html

v3: http://www.mail-archive.com/linux-omap at vger.kernel.org/msg32071.html Rebase on latest codebase and previous patch(posted).
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg31963.html

v2: Rebase on latest codebase and previous patch(posted).
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg31471.html

v1: http://www.mail-archive.com/linux-omap at vger.kernel.org/msg26666.html

Sukumar Ghorai (7):
omap3630: nand: fix device size to work in polled mode
omap3: nand: configurable transfer type per board
omap: gpmc: enable irq mode in gpmc
omap3: nand: prefetch in irq mode support
omap3: nand: configurable fifo threshold to gain the throughput
omap: nand: ecc layout select from board file
omap: nand: making ecc layout as compatible with romcode ecc

 arch/arm/mach-omap2/board-2430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3630sdp.c        |    1 +
 arch/arm/mach-omap2/board-4430sdp.c        |    2 +
 arch/arm/mach-omap2/board-am3517evm.c      |    2 +
 arch/arm/mach-omap2/board-apollon.c        |    1 +
 arch/arm/mach-omap2/board-cm-t35.c         |    1 +
 arch/arm/mach-omap2/board-devkit8000.c     |    1 +
 arch/arm/mach-omap2/board-flash.c          |    7 +
 arch/arm/mach-omap2/board-generic.c        |    2 +
 arch/arm/mach-omap2/board-h4.c             |    1 +
 arch/arm/mach-omap2/board-igep0020.c       |    1 +
 arch/arm/mach-omap2/board-ldp.c            |    1 +
 arch/arm/mach-omap2/board-n8x0.c           |    2 +
 arch/arm/mach-omap2/board-omap3beagle.c    |    1 +
 arch/arm/mach-omap2/board-omap3evm.c       |    2 +
 arch/arm/mach-omap2/board-omap3pandora.c   |    2 +
 arch/arm/mach-omap2/board-omap3stalker.c   |    1 +
 arch/arm/mach-omap2/board-omap3touchbook.c |    1 +
 arch/arm/mach-omap2/board-omap4panda.c     |    2 +
 arch/arm/mach-omap2/board-overo.c          |    1 +
 arch/arm/mach-omap2/board-rx51.c           |    1 +
 arch/arm/mach-omap2/board-zoom2.c          |    2 +
 arch/arm/mach-omap2/board-zoom3.c          |    2 +
 arch/arm/mach-omap2/gpmc.c                 |   50 ++++-
 arch/arm/mach-omap2/io.c                   |    2 -
 arch/arm/plat-omap/include/plat/gpmc.h     |   16 ++-
 arch/arm/plat-omap/include/plat/irqs.h     |    9 +-
 arch/arm/plat-omap/include/plat/nand.h     |   11 +
 drivers/mtd/nand/Kconfig                   |   17 --
 drivers/mtd/nand/omap2.c                   |  314 ++++++++++++++++++++++------
 31 files changed, 364 insertions(+), 94 deletions(-)
#1 lore raw

PATCH v6 1/7 omap3630: nand: fix device size to work in polled mode

zoom3 and 3630-sdp having the x16 nand device.
This patch configure gpmc as x16 and select the currect function in driver for polled mode (without prefetch enable) transfer.

---
 arch/arm/mach-omap2/board-flash.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-flash.c +3 -0
index fd38c05..001c605 100644
@@ -145,6 +145,9 @@ __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs)
 	board_nand_data.parts		= nand_parts;
 	board_nand_data.nr_parts		= nr_parts;
 
+	if (cpu_is_omap3630())
+		board_nand_data.devsize = 1;
+
 	gpmc_nand_init(&board_nand_data);
 }
 #else
Signature · 1 line
1.7.0.4
maintainer
#2 lore raw

PATCH 1/7 omap3630: nand: fix device size to work in polled mode

Quoted 14 lines · Sukumar Ghorai

zoom3 and 3630-sdp having the x16 nand device.
This patch configure gpmc as x16 and select the currect function in driver for polled mode (without prefetch enable) transfer.

---
 arch/arm/mach-omap2/board-flash.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-flash.c +0 -0
index fd38c05..001c605 100644

arch/arm/mach-omap2/board-flash.c __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) · line 153

Quoted 9 lines
arch/arm/mach-omap2/board-flash.c +3 -0
@@ -145,6 +145,9 @@ __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs)
 	board_nand_data.parts		= nand_parts;
 	board_nand_data.nr_parts		= nr_parts;
 
+	if (cpu_is_omap3630())
+		board_nand_data.devsize = 1;
+
 	gpmc_nand_init(&board_nand_data);
 }
 #else

I guess this is board specific for the size, not omap specific?

Regards,

Tony

#3 lore raw

PATCH v6 1/7 omap3630: nand: fix device size to work in polled mode

Quoted 32 lines

-----Original Message-----
From: Tony Lindgren [mailto:tony at atomide.com]
Sent: Saturday, December 18, 2010 5:34 AM
To: Ghorai, Sukumar
Cc: linux-omap at vger.kernel.org; linux-mtd at lists.infradead.org; linux-arm- kernel at lists.infradead.org
Subject: Re: [PATCH 1/7] omap3630: nand: fix device size to work in polled mode

Quoted 2 lines · Sukumar Ghorai

zoom3 and 3630-sdp having the x16 nand device.
This patch configure gpmc as x16 and select the currect function in

driver

arch/arm/mach-

Quoted 8 lines

for polled mode (without prefetch enable) transfer.

---
 arch/arm/mach-omap2/board-flash.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/board-flash.c +0 -0

omap2/board-flash.c

arch/arm/mach-omap2/board-flash.c __init board_nand_init(struct mtd_partition

Quoted 4 lines

index fd38c05..001c605 100644

arch/arm/mach-omap2/board-flash.c +0 -0
@@ -145,6 +145,9 @@ __init board_nand_init(struct mtd_partition

*nand_parts, u8 nr_parts, u8 cs)

Quoted 3 lines
arch/arm/mach-omap2/board-flash.c +0 -0
 	board_nand_data.parts		= nand_parts;
 	board_nand_data.nr_parts		= nr_parts;
 
Quoted 8 lines

arch/arm/mach-omap2/board-flash.c __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) · line 153

Quoted 6 lines
arch/arm/mach-omap2/board-flash.c +3 -0
+	if (cpu_is_omap3630())
+		board_nand_data.devsize = 1;
+
 	gpmc_nand_init(&board_nand_data);
 }
 #else

I guess this is board specific for the size, not omap specific?

[Ghorai] Agree, the NAND type (i.e. x8 NAND or x16 NAND) is a board specific, So I will change the definition of board_nand_init() to pass the devsize form board file. And I will submit the patch-series again.

#4 lore raw

PATCH v6 2/7 omap3: nand: configurable transfer type per board

In reply to Sukumar Ghorai

nand transfer type (sDMA, Polled, prefetch) can be select from board file, enabling all transfer type in driver, by default.

this helps in multi-omap build and to select different transfer type for different board.

---
 arch/arm/plat-omap/include/plat/nand.h |    7 +++
 drivers/mtd/nand/Kconfig               |   17 ------
 drivers/mtd/nand/omap2.c               |   92 +++++++++++--------------------
 3 files changed, 40 insertions(+), 76 deletions(-)
arch/arm/plat-omap/include/plat/nand.h +7 -0
index 6562cd0..78c0bdb 100644
@@ -10,6 +10,12 @@
 
 #include <linux/mtd/partitions.h>
 
+enum nand_io {
+	NAND_OMAP_PREFETCH_POLLED = 0,	/* prefetch polled mode, default */
+	NAND_OMAP_POLLED,		/* polled mode, without prefetch */
+	NAND_OMAP_PREFETCH_DMA		/* prefetch enabled sDMA mode */
+};
+
 struct omap_nand_platform_data {
 	unsigned int		options;
 	int			cs;
@@ -20,6 +26,7 @@ struct omap_nand_platform_data {
 	int			(*nand_setup)(void);
 	int			(*dev_ready)(struct omap_nand_platform_data *);
 	int			dma_channel;
+	enum nand_io		xfer_type;
 	unsigned long		phys_base;
 	int			devsize;
 };
drivers/mtd/nand/Kconfig +0 -17
index 8229802..89bb297 100644
@@ -105,23 +105,6 @@ config MTD_NAND_OMAP2
 	help
           Support for NAND flash on Texas Instruments OMAP2 and OMAP3 platforms.
 
-config MTD_NAND_OMAP_PREFETCH
-	bool "GPMC prefetch support for NAND Flash device"
-	depends on MTD_NAND_OMAP2
-	default y
-	help
-	 The NAND device can be accessed for Read/Write using GPMC PREFETCH engine
-	 to improve the performance.
-
-config MTD_NAND_OMAP_PREFETCH_DMA
-	depends on MTD_NAND_OMAP_PREFETCH
-	bool "DMA mode"
-	default n
-	help
-	 The GPMC PREFETCH engine can be configured eigther in MPU interrupt mode
-	 or in DMA interrupt mode.
-	 Say y for DMA mode or MPU mode will be used
-
 config MTD_NAND_IDS
 	tristate
 
drivers/mtd/nand/omap2.c +33 -59

143 lines not on this page · raw message

Signature · 1 line
1.7.0.4
maintainer
#5 lore raw

PATCH 2/7 omap3: nand: configurable transfer type per board

Quoted 31 lines · Sukumar Ghorai

nand transfer type (sDMA, Polled, prefetch) can be select from board file, enabling all transfer type in driver, by default.

this helps in multi-omap build and to select different transfer type for different board.

---
 arch/arm/plat-omap/include/plat/nand.h |    7 +++
 drivers/mtd/nand/Kconfig               |   17 ------
 drivers/mtd/nand/omap2.c               |   92 +++++++++++--------------------
 3 files changed, 40 insertions(+), 76 deletions(-)
arch/arm/plat-omap/include/plat/nand.h +6 -0
index 6562cd0..78c0bdb 100644
@@ -10,6 +10,12 @@
 
 #include <linux/mtd/partitions.h>
 
+enum nand_io {
+	NAND_OMAP_PREFETCH_POLLED = 0,	/* prefetch polled mode, default */
+	NAND_OMAP_POLLED,		/* polled mode, without prefetch */
+	NAND_OMAP_PREFETCH_DMA		/* prefetch enabled sDMA mode */
+};
+
 struct omap_nand_platform_data {
 	unsigned int		options;
 	int			cs;

arch/arm/plat-omap/include/plat/nand.h struct omap_nand_platform_data { · line 32

Quoted 7 lines
arch/arm/plat-omap/include/plat/nand.h +1 -0
@@ -20,6 +26,7 @@ struct omap_nand_platform_data {
 	int			(*nand_setup)(void);
 	int			(*dev_ready)(struct omap_nand_platform_data *);
 	int			dma_channel;
+	enum nand_io		xfer_type;
 	unsigned long		phys_base;
 	int			devsize;
 };

So maybe the devsize in patch 1/7 should be handled with this too?

Regards,

Tony

#6 lore raw

PATCH v6 2/7 omap3: nand: configurable transfer type per board

Quoted 47 lines

-----Original Message-----
From: Tony Lindgren [mailto:tony at atomide.com]
Sent: Saturday, December 18, 2010 5:39 AM
To: Ghorai, Sukumar
Cc: linux-omap at vger.kernel.org; linux-mtd at lists.infradead.org; linux-arm- kernel at lists.infradead.org
Subject: Re: [PATCH 2/7] omap3: nand: configurable transfer type per board

Quoted 1 line · Sukumar Ghorai

nand transfer type (sDMA, Polled, prefetch) can be select from board

file,

Quoted 10 lines

enabling all transfer type in driver, by default.

this helps in multi-omap build and to select different transfer type for different board.

---
 arch/arm/plat-omap/include/plat/nand.h |    7 +++
 drivers/mtd/nand/Kconfig               |   17 ------
 drivers/mtd/nand/omap2.c               |   92 +++++++++++--------------

------

arch/arm/plat-

Quoted 3 lines
 3 files changed, 40 insertions(+), 76 deletions(-)
arch/arm/plat- renamed from arch/arm/plat-omap/include/plat/nand.h +0 -0

omap/include/plat/nand.h

arch/arm/plat-omap/include/plat/nand.h line 14

Quoted 9 lines

index 6562cd0..78c0bdb 100644

arch/arm/plat-omap/include/plat/nand.h +2 -0
@@ -10,6 +10,12 @@
 
 #include <linux/mtd/partitions.h>
 
+enum nand_io {
+	NAND_OMAP_PREFETCH_POLLED = 0,	/* prefetch polled mode, default

*/

Quoted 9 lines
arch/arm/plat-omap/include/plat/nand.h +4 -0
+	NAND_OMAP_POLLED,		/* polled mode, without prefetch */
+	NAND_OMAP_PREFETCH_DMA		/* prefetch enabled sDMA mode */
+};
+
 struct omap_nand_platform_data {
 	unsigned int		options;
 	int			cs;
@@ -20,6 +26,7 @@ struct omap_nand_platform_data {
 	int			(*nand_setup)(void);
Quoted 8 lines

arch/arm/plat-omap/include/plat/nand.h struct omap_nand_platform_data { · line 32

Quoted 6 lines
arch/arm/plat-omap/include/plat/nand.h +1 -0
 	int			(*dev_ready)(struct omap_nand_platform_data *);
 	int			dma_channel;
+	enum nand_io		xfer_type;
 	unsigned long		phys_base;
 	int			devsize;
 };

So maybe the devsize in patch 1/7 should be handled with this too?

[Ghorai] patch 1/7 [1] is to select the NAND type i.e. x8 or x16 NAND; So I am keeping as separate patch. And let me know if I am missing anything.

[1] https://patchwork.kernel.org/patch/359092/

#7 lore raw

PATCH v6 3/7 omap: gpmc: enable irq mode in gpmc

In reply to Sukumar Ghorai

add support the irq mode in GPMC.
gpmc_init() function move after omap_init_irq() as it has dependecy on irq.

---
 arch/arm/mach-omap2/board-2430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3630sdp.c        |    1 +
 arch/arm/mach-omap2/board-4430sdp.c        |    2 +
 arch/arm/mach-omap2/board-am3517evm.c      |    2 +
 arch/arm/mach-omap2/board-apollon.c        |    1 +
 arch/arm/mach-omap2/board-cm-t35.c         |    1 +
 arch/arm/mach-omap2/board-devkit8000.c     |    1 +
 arch/arm/mach-omap2/board-generic.c        |    2 +
 arch/arm/mach-omap2/board-h4.c             |    1 +
 arch/arm/mach-omap2/board-igep0020.c       |    1 +
 arch/arm/mach-omap2/board-ldp.c            |    1 +
 arch/arm/mach-omap2/board-n8x0.c           |    2 +
 arch/arm/mach-omap2/board-omap3beagle.c    |    1 +
 arch/arm/mach-omap2/board-omap3evm.c       |    2 +
 arch/arm/mach-omap2/board-omap3pandora.c   |    2 +
 arch/arm/mach-omap2/board-omap3stalker.c   |    1 +
 arch/arm/mach-omap2/board-omap3touchbook.c |    1 +
 arch/arm/mach-omap2/board-omap4panda.c     |    2 +
 arch/arm/mach-omap2/board-overo.c          |    1 +
 arch/arm/mach-omap2/board-rx51.c           |    1 +
 arch/arm/mach-omap2/board-zoom2.c          |    2 +
 arch/arm/mach-omap2/board-zoom3.c          |    2 +
 arch/arm/mach-omap2/gpmc.c                 |   39 ++++++++++++++++++++++++++-
 arch/arm/mach-omap2/io.c                   |    2 -
 arch/arm/plat-omap/include/plat/gpmc.h     |    4 +++
 arch/arm/plat-omap/include/plat/irqs.h     |    9 +++++-
 27 files changed, 81 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/board-2430sdp.c +1 -0
index b527f8d..11c89dc 100644
@@ -145,6 +145,7 @@ static void __init omap_2430sdp_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(sdp2430_config);
 	omap2_init_common_hw(NULL, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-3430sdp.c +1 -0
index 4e3742c..a040165 100644
@@ -328,6 +328,7 @@ static void __init omap_3430sdp_init_irq(void)
 	omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
 	omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-3630sdp.c +1 -0
index bbcf580..17983ed 100644
@@ -76,6 +76,7 @@ static void __init omap_sdp_init_irq(void)
 	omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
 			h8mbx00u0mer0em_sdrc_params);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-4430sdp.c +2 -0
index df5a425..8d15604 100644
@@ -34,6 +34,7 @@
 #include <plat/common.h>
 #include <plat/usb.h>
 #include <plat/mmc.h>
+#include <plat/gpmc.h>
 
 #include "hsmmc.h"
 #include "timer-gp.h"
@@ -222,6 +223,7 @@ static void __init omap_4430sdp_init_irq(void)
 	omap2_gp_clockevent_set_gptimer(1);
 #endif
 	gic_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-am3517evm.c +2 -0
index 0739950..460e3d1 100644
@@ -35,6 +35,7 @@
 #include <plat/common.h>
 #include <plat/usb.h>
 #include <plat/display.h>
+#include <plat/gpmc.h>
 
 #include "mux.h"
 #include "control.h"
@@ -392,6 +393,7 @@ static void __init am3517_evm_init_irq(void)
 
 	omap2_init_common_hw(NULL, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-apollon.c +1 -0
index 2c6db1a..8264e7a 100644
@@ -280,6 +280,7 @@ static void __init omap_apollon_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(apollon_config);
 	omap2_init_common_hw(NULL, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 	apollon_init_smc91x();
 }
arch/arm/mach-omap2/board-cm-t35.c +1 -0
index 63f764e..7c9a834 100644
@@ -686,6 +686,7 @@ static void __init cm_t35_init_irq(void)
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 			     mt46h32m32lf6_sdrc_params);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-devkit8000.c +1 -0
index 53ac762..f82d3b7 100644
@@ -447,6 +447,7 @@ static void __init devkit8000_init_irq(void)
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 			     mt46h32m32lf6_sdrc_params);
 	omap_init_irq();
+	gpmc_init();
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(12);
 #endif
arch/arm/mach-omap2/board-generic.c +2 -0
index b1c2c9a..0b0d2cb 100644
@@ -29,6 +29,7 @@
 #include <plat/usb.h>
 #include <plat/board.h>
 #include <plat/common.h>
+#include <plat/gpmc.h>
 
 static struct omap_board_config_kernel generic_config[] = {
 };
@@ -39,6 +40,7 @@ static void __init omap_generic_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(generic_config);
 	omap2_init_common_hw(NULL, NULL);
 	omap_init_irq();
+	gpmc_init();
 }
 
 static void __init omap_generic_init(void)
arch/arm/mach-omap2/board-h4.c +1 -0
index 929993b..41b04c4 100644
@@ -293,6 +293,7 @@ static void __init omap_h4_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(h4_config);
 	omap2_init_common_hw(NULL, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 	h4_init_flash();
 }
arch/arm/mach-omap2/board-igep0020.c +1 -0
index 5e035a5..c4de273 100644
@@ -497,6 +497,7 @@ static void __init igep2_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(igep2_config);
 	omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-ldp.c +1 -0
index 001fd97..0f66645 100644
@@ -294,6 +294,7 @@ static void __init omap_ldp_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(ldp_config);
 	omap2_init_common_hw(NULL, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 	ldp_init_smsc911x();
 }
arch/arm/mach-omap2/board-n8x0.c +2 -0
index e823c70..4f7c714 100644
@@ -33,6 +33,7 @@
 #include <plat/onenand.h>
 #include <plat/mmc.h>
 #include <plat/serial.h>
+#include <plat/gpmc.h>
 
 #include "mux.h"
 
@@ -641,6 +642,7 @@ static void __init n8x0_init_irq(void)
 {
 	omap2_init_common_hw(NULL, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-omap3beagle.c +1 -0
index 14f4224..a83c3f3 100644
@@ -487,6 +487,7 @@ static void __init omap3_beagle_init_irq(void)
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 			     mt46h32m32lf6_sdrc_params);
 	omap_init_irq();
+	gpmc_init();
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(12);
 #endif
arch/arm/mach-omap2/board-omap3evm.c +2 -0
index b04365c..21cc9e5 100644
@@ -43,6 +43,7 @@
 #include <plat/common.h>
 #include <plat/mcspi.h>
 #include <plat/display.h>
+#include <plat/gpmc.h>
 
 #include "mux.h"
 #include "sdram-micron-mt46h32m32lf-6.h"
@@ -625,6 +626,7 @@ static void __init omap3_evm_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-omap3pandora.c +2 -0
index 89ed1be..e095f1d 100644
@@ -47,6 +47,7 @@
 #include <plat/mcspi.h>
 #include <plat/usb.h>
 #include <plat/display.h>
+#include <plat/gpmc.h>
 #include <plat/nand.h>
 
 #include "mux.h"
@@ -639,6 +640,7 @@ static void __init omap3pandora_init_irq(void)
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 			     mt46h32m32lf6_sdrc_params);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-omap3stalker.c +1 -0
index f252721..c07ba77 100644
@@ -586,6 +586,7 @@ static void __init omap3_stalker_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
 	omap_init_irq();
+	gpmc_init();
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(12);
 #endif
arch/arm/mach-omap2/board-omap3touchbook.c +1 -0
index 41104bb..d549763 100644
@@ -425,6 +425,7 @@ static void __init omap3_touchbook_init_irq(void)
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 			     mt46h32m32lf6_sdrc_params);
 	omap_init_irq();
+	gpmc_init();
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(12);
 #endif
arch/arm/mach-omap2/board-omap4panda.c +2 -0
index 1ecd0a6..a03a021 100644
@@ -36,6 +36,7 @@
 #include <plat/common.h>
 #include <plat/usb.h>
 #include <plat/mmc.h>
+#include <plat/gpmc.h>
 #include "timer-gp.h"
 
 #include "hsmmc.h"
@@ -78,6 +79,7 @@ static void __init omap4_panda_init_irq(void)
 {
 	omap2_init_common_hw(NULL, NULL);
 	gic_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-overo.c +1 -0
index 7053bc0..c5fe2b0 100644
@@ -416,6 +416,7 @@ static void __init overo_init_irq(void)
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 			     mt46h32m32lf6_sdrc_params);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-rx51.c +1 -0
index 36f2cf4..3be8729 100644
@@ -107,6 +107,7 @@ static void __init rx51_init_irq(void)
 	omap3_pm_init_cpuidle(rx51_cpuidle_params);
 	sdrc_params = rx51_get_sdram_timings();
 	omap2_init_common_hw(sdrc_params, sdrc_params);
+	gpmc_init();
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/board-zoom2.c +2 -0
index 2992a9f..ab0a05d 100644
@@ -21,6 +21,7 @@
 
 #include <plat/common.h>
 #include <plat/board.h>
+#include <plat/gpmc.h>
 
 #include <mach/board-zoom.h>
 
@@ -33,6 +34,7 @@ static void __init omap_zoom2_init_irq(void)
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 				 mt46h32m32lf6_sdrc_params);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-zoom3.c +2 -0
index 5adde12..d637d98 100644
@@ -21,6 +21,7 @@
 #include <plat/common.h>
 #include <plat/board.h>
 #include <plat/usb.h>
+#include <plat/gpmc.h>
 
 #include "board-flash.h"
 #include "mux.h"
@@ -77,6 +78,7 @@ static void __init omap_zoom_init_irq(void)
 	omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
 			h8mbx00u0mer0em_sdrc_params);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/gpmc.c +37 -2
index f46933b..cfaf357 100644
@@ -14,6 +14,7 @@
  */
 #undef DEBUG
 
+#include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/err.h>
@@ -22,12 +23,12 @@
 #include <linux/spinlock.h>
 #include <linux/io.h>
 #include <linux/module.h>
+#include <linux/interrupt.h>
 
 #include <asm/mach-types.h>
 #include <plat/gpmc.h>
 
 #include <plat/sdrc.h>
-
 /* GPMC register offsets */
 #define GPMC_REVISION		0x00
 #define GPMC_SYSCONFIG		0x10
@@ -100,6 +101,8 @@ static void __iomem *gpmc_base;
 
 static struct clk *gpmc_l3_clk;
 
+static irqreturn_t gpmc_handle_irq(int irq, void *dev);
+
 static void gpmc_write_reg(int idx, u32 val)
 {
 	__raw_writel(val, gpmc_base + idx);
@@ -487,6 +490,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
 	u32 regval = 0;
 
 	switch (cmd) {
+	case GPMC_ENABLE_IRQ:
+		gpmc_write_reg(GPMC_IRQENABLE, wval);
+		break;
+
 	case GPMC_SET_IRQ_STATUS:
 		gpmc_write_reg(GPMC_IRQSTATUS, wval);
 		break;
@@ -670,7 +677,8 @@ static void __init gpmc_mem_init(void)
 
 void __init gpmc_init(void)
 {
-	u32 l;
+	u32 l, irq;
+	int cs;
 	char *ck = NULL;
 
 	if (cpu_is_omap24xx()) {
@@ -713,6 +721,33 @@ void __init gpmc_init(void)
 	l |= (0x02 << 3) | (1 << 0);
 	gpmc_write_reg(GPMC_SYSCONFIG, l);
 	gpmc_mem_init();
+
+	/* initalize the irq_chained */
+	irq = OMAP_GPMC_IRQ_BASE;
+	for (cs = 0; cs < GPMC_CS_NUM; cs++) {
+		set_irq_handler(irq, handle_simple_irq);
+		set_irq_flags(irq, IRQF_VALID);
+		irq++;
+	}
+
+	if (request_irq(INT_34XX_GPMC_IRQ,
+			gpmc_handle_irq, IRQF_SHARED, "gpmc", gpmc_base))
+		printk(KERN_ERR "gpmc: irq-%d could not claim: err %d\n",
+						INT_34XX_GPMC_IRQ, irq);
+}
+
+static irqreturn_t gpmc_handle_irq(int irq, void *dev)
+{
+	u8 cs;
+
+	if (irq != INT_34XX_GPMC_IRQ)
+		return IRQ_HANDLED;
+	/* check cs to invoke the irq */
+	cs = ((gpmc_read_reg(GPMC_PREFETCH_CONFIG1)) >> CS_NUM_SHIFT) & 0x7;
+	if (OMAP_GPMC_IRQ_BASE+cs <= OMAP_GPMC_IRQ_END)
+		generic_handle_irq(OMAP_GPMC_IRQ_BASE+cs);
+
+	return IRQ_HANDLED;
 }
 
 #ifdef CONFIG_ARCH_OMAP3
arch/arm/mach-omap2/io.c +0 -2
index 40562dd..4d11621 100644
@@ -30,7 +30,6 @@
 
 #include <plat/sram.h>
 #include <plat/sdrc.h>
-#include <plat/gpmc.h>
 #include <plat/serial.h>
 
 #include "clock2xxx.h"
@@ -351,5 +350,4 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 		omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
 		_omap2_init_reprogram_sdrc();
 	}
-	gpmc_init();
 }
arch/arm/plat-omap/include/plat/gpmc.h +4 -0
index 9fd99b9..054e704 100644
@@ -41,6 +41,8 @@
 #define GPMC_NAND_ADDRESS	0x0000000b
 #define GPMC_NAND_DATA		0x0000000c
 
+#define GPMC_ENABLE_IRQ		0x0000000d
+
 /* ECC commands */
 #define GPMC_ECC_READ		0 /* Reset Hardware ECC for read */
 #define GPMC_ECC_WRITE		1 /* Reset Hardware ECC for write */
@@ -78,6 +80,8 @@
 #define WR_RD_PIN_MONITORING		0x00600000
 #define GPMC_PREFETCH_STATUS_FIFO_CNT(val)	((val >> 24) & 0x7F)
 #define GPMC_PREFETCH_STATUS_COUNT(val)	(val & 0x00003fff)
+#define GPMC_IRQ_FIFOEVENTENABLE	0x01
+#define GPMC_IRQ_COUNT_EVENT		0x02
 
 /*
  * Note that all values in this struct are in nanoseconds, while
arch/arm/plat-omap/include/plat/irqs.h +8 -1
index 65e20a6..b90b9ef 100644
@@ -318,6 +318,7 @@
 #define INT_34XX_PRCM_MPU_IRQ	11
 #define INT_34XX_MCBSP1_IRQ	16
 #define INT_34XX_MCBSP2_IRQ	17
+#define INT_34XX_GPMC_IRQ	20
 #define INT_34XX_MCBSP3_IRQ	22
 #define INT_34XX_MCBSP4_IRQ	23
 #define INT_34XX_CAM_IRQ	24
@@ -411,7 +412,13 @@
 #define TWL_IRQ_END		TWL6030_IRQ_END
 #endif
 
-#define NR_IRQS			TWL_IRQ_END
+/* GPMC related */
+#define OMAP_GPMC_IRQ_BASE	(TWL_IRQ_END)
+#define OMAP_GPMC_NR_IRQS	7
+#define OMAP_GPMC_IRQ_END	(OMAP_GPMC_IRQ_BASE + OMAP_GPMC_NR_IRQS)
+
+
+#define NR_IRQS			OMAP_GPMC_IRQ_END
 
 #define OMAP_IRQ_BIT(irq)	(1 << ((irq) % 32))
 
Signature · 1 line
1.7.0.4
maintainer
#8 lore raw

PATCH v6 3/7 omap: gpmc: enable irq mode in gpmc

Quoted 51 lines · Sukumar Ghorai

add support the irq mode in GPMC.
gpmc_init() function move after omap_init_irq() as it has dependecy on irq.

---
 arch/arm/mach-omap2/board-2430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3630sdp.c        |    1 +
 arch/arm/mach-omap2/board-4430sdp.c        |    2 +
 arch/arm/mach-omap2/board-am3517evm.c      |    2 +
 arch/arm/mach-omap2/board-apollon.c        |    1 +
 arch/arm/mach-omap2/board-cm-t35.c         |    1 +
 arch/arm/mach-omap2/board-devkit8000.c     |    1 +
 arch/arm/mach-omap2/board-generic.c        |    2 +
 arch/arm/mach-omap2/board-h4.c             |    1 +
 arch/arm/mach-omap2/board-igep0020.c       |    1 +
 arch/arm/mach-omap2/board-ldp.c            |    1 +
 arch/arm/mach-omap2/board-n8x0.c           |    2 +
 arch/arm/mach-omap2/board-omap3beagle.c    |    1 +
 arch/arm/mach-omap2/board-omap3evm.c       |    2 +
 arch/arm/mach-omap2/board-omap3pandora.c   |    2 +
 arch/arm/mach-omap2/board-omap3stalker.c   |    1 +
 arch/arm/mach-omap2/board-omap3touchbook.c |    1 +
 arch/arm/mach-omap2/board-omap4panda.c     |    2 +
 arch/arm/mach-omap2/board-overo.c          |    1 +
 arch/arm/mach-omap2/board-rx51.c           |    1 +
 arch/arm/mach-omap2/board-zoom2.c          |    2 +
 arch/arm/mach-omap2/board-zoom3.c          |    2 +
 arch/arm/mach-omap2/gpmc.c                 |   39 ++++++++++++++++++++++++++-
 arch/arm/mach-omap2/io.c                   |    2 -
 arch/arm/plat-omap/include/plat/gpmc.h     |    4 +++
 arch/arm/plat-omap/include/plat/irqs.h     |    9 +++++-
 27 files changed, 81 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/board-2430sdp.c +1 -0
index b527f8d..11c89dc 100644
@@ -145,6 +145,7 @@ static void __init omap_2430sdp_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(sdp2430_config);
 	omap2_init_common_hw(NULL, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach-omap2/board-3430sdp.c +0 -0
index 4e3742c..a040165 100644

arch/arm/mach-omap2/board-3430sdp.c static void __init omap_3430sdp_init_irq(void) · line 333

Quoted 6 lines
arch/arm/mach-omap2/board-3430sdp.c +1 -0
@@ -328,6 +328,7 @@ static void __init omap_3430sdp_init_irq(void)
 	omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
 	omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }

...

The gpmc init should be done with subsys_initcall instead.

Tony

#9 lore raw

PATCH v6 3/7 omap: gpmc: enable irq mode in gpmc

Quoted 74 lines

-----Original Message-----
From: Tony Lindgren [mailto:tony at atomide.com]
Sent: Saturday, December 18, 2010 5:40 AM
To: Ghorai, Sukumar
Cc: linux-omap at vger.kernel.org; linux-mtd at lists.infradead.org; linux-arm- kernel at lists.infradead.org
Subject: Re: [PATCH v6 3/7] omap: gpmc: enable irq mode in gpmc

Quoted 2 lines · Sukumar Ghorai

add support the irq mode in GPMC.
gpmc_init() function move after omap_init_irq() as it has dependecy on

irq.

Quoted 19 lines
---
 arch/arm/mach-omap2/board-2430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3630sdp.c        |    1 +
 arch/arm/mach-omap2/board-4430sdp.c        |    2 +
 arch/arm/mach-omap2/board-am3517evm.c      |    2 +
 arch/arm/mach-omap2/board-apollon.c        |    1 +
 arch/arm/mach-omap2/board-cm-t35.c         |    1 +
 arch/arm/mach-omap2/board-devkit8000.c     |    1 +
 arch/arm/mach-omap2/board-generic.c        |    2 +
 arch/arm/mach-omap2/board-h4.c             |    1 +
 arch/arm/mach-omap2/board-igep0020.c       |    1 +
 arch/arm/mach-omap2/board-ldp.c            |    1 +
 arch/arm/mach-omap2/board-n8x0.c           |    2 +
 arch/arm/mach-omap2/board-omap3beagle.c    |    1 +
 arch/arm/mach-omap2/board-omap3evm.c       |    2 +
 arch/arm/mach-omap2/board-omap3pandora.c   |    2 +
Quoted 8 lines
 arch/arm/mach-omap2/board-omap3stalker.c   |    1 +
 arch/arm/mach-omap2/board-omap3touchbook.c |    1 +
 arch/arm/mach-omap2/board-omap4panda.c     |    2 +
 arch/arm/mach-omap2/board-overo.c          |    1 +
 arch/arm/mach-omap2/board-rx51.c           |    1 +
 arch/arm/mach-omap2/board-zoom2.c          |    2 +
 arch/arm/mach-omap2/board-zoom3.c          |    2 +
 arch/arm/mach-omap2/gpmc.c                 |   39

++++++++++++++++++++++++++-

arch/arm/mach-

Quoted 6 lines
 arch/arm/mach-omap2/io.c                   |    2 -
 arch/arm/plat-omap/include/plat/gpmc.h     |    4 +++
 arch/arm/plat-omap/include/plat/irqs.h     |    9 +++++-
 27 files changed, 81 insertions(+), 5 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-omap2/board-2430sdp.c +0 -0

omap2/board-2430sdp.c

arch/arm/mach-

Quoted 12 lines

index b527f8d..11c89dc 100644

arch/arm/mach-omap2/board-2430sdp.c +1 -0
@@ -145,6 +145,7 @@ static void __init omap_2430sdp_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(sdp2430_config);
 	omap2_init_common_hw(NULL, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }
 
arch/arm/mach- renamed from arch/arm/mach-omap2/board-3430sdp.c +0 -0

omap2/board-3430sdp.c

Quoted 10 lines

index 4e3742c..a040165 100644

arch/arm/mach-omap2/board-3430sdp.c +1 -0
@@ -328,6 +328,7 @@ static void __init omap_3430sdp_init_irq(void)
 	omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
 	omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
 	omap_init_irq();
+	gpmc_init();
 	omap_gpio_init();
 }

...

Quoted 1 line

The gpmc init should be done with subsys_initcall instead.

[Ghorai] You suggested the same in previous v5; and I mentioned the issues [1] that - nand_init()called before subsys_initcall(gpmc_init); Let me know if I am missing anything again.

[1] https://patchwork.kernel.org/patch/212452/

#10 lore raw

PATCH v6 4/7 omap3: nand: prefetch in irq mode support

In reply to Sukumar Ghorai

This patch enable prefetch-irq mode for nand transfer(read, write)

---
 arch/arm/mach-omap2/board-flash.c      |    3 +
 arch/arm/plat-omap/include/plat/nand.h |    4 +-
 drivers/mtd/nand/omap2.c               |  169 ++++++++++++++++++++++++++++++++
 3 files changed, 175 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-flash.c +3 -0
index 001c605..78abcd9 100644
@@ -16,7 +16,9 @@
 #include <linux/platform_device.h>
 #include <linux/mtd/physmap.h>
 #include <linux/io.h>
+#include <plat/irqs.h>
 
+#include <plat/irqs.h>
 #include <plat/gpmc.h>
 #include <plat/nand.h>
 #include <plat/onenand.h>
@@ -148,6 +150,7 @@ __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs)
 	if (cpu_is_omap3630())
 		board_nand_data.devsize = 1;
 
+	board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs;
 	gpmc_nand_init(&board_nand_data);
 }
 #else
arch/arm/plat-omap/include/plat/nand.h +3 -1
index 78c0bdb..ae5e053 100644
@@ -13,7 +13,8 @@
 enum nand_io {
 	NAND_OMAP_PREFETCH_POLLED = 0,	/* prefetch polled mode, default */
 	NAND_OMAP_POLLED,		/* polled mode, without prefetch */
-	NAND_OMAP_PREFETCH_DMA		/* prefetch enabled sDMA mode */
+	NAND_OMAP_PREFETCH_DMA,		/* prefetch enabled sDMA mode */
+	NAND_OMAP_PREFETCH_IRQ		/* prefetch enabled irq mode */
 };
 
 struct omap_nand_platform_data {
@@ -26,6 +27,7 @@ struct omap_nand_platform_data {
 	int			(*nand_setup)(void);
 	int			(*dev_ready)(struct omap_nand_platform_data *);
 	int			dma_channel;
+	int			gpmc_irq;
 	enum nand_io		xfer_type;
 	unsigned long		phys_base;
 	int			devsize;
drivers/mtd/nand/omap2.c +169 -0

199 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#11 lore raw

PATCH v6 5/7 omap3: nand: configurable fifo threshold to gain the throughput

In reply to Sukumar Ghorai

Configure the FIFO THREASHOLD value different for read and write to keep busy both filling and to drain out of FIFO at reading and writing.

---
 arch/arm/mach-omap2/gpmc.c             |   11 +++++++----
 arch/arm/plat-omap/include/plat/gpmc.h |    5 ++++-
 drivers/mtd/nand/omap2.c               |   24 +++++++++++++++---------
 3 files changed, 26 insertions(+), 14 deletions(-)
arch/arm/mach-omap2/gpmc.c +7 -4
index cfaf357..b26b1a5 100644
@@ -59,7 +59,6 @@
 #define GPMC_CHUNK_SHIFT	24		/* 16 MB */
 #define GPMC_SECTION_SHIFT	28		/* 128 MB */
 
-#define PREFETCH_FIFOTHRESHOLD	(0x40 << 8)
 #define CS_NUM_SHIFT		24
 #define ENABLE_PREFETCH		(0x1 << 7)
 #define DMA_MPU_MODE		2
@@ -595,15 +594,19 @@ EXPORT_SYMBOL(gpmc_nand_write);
 /**
  * gpmc_prefetch_enable - configures and starts prefetch transfer
  * @cs: cs (chip select) number
+ * @fifo_th: fifo threshold to be used for read/ write
  * @dma_mode: dma mode enable (1) or disable (0)
  * @u32_count: number of bytes to be transferred
  * @is_write: prefetch read(0) or write post(1) mode
  */
-int gpmc_prefetch_enable(int cs, int dma_mode,
+int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
 				unsigned int u32_count, int is_write)
 {
 
-	if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
+	if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX) {
+		printk(KERN_ERR "PREFETCH Fifo Threshold is not supported\n");
+		return -1;
+	} else if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
 		/* Set the amount of bytes to be prefetched */
 		gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
 
@@ -611,7 +614,7 @@ int gpmc_prefetch_enable(int cs, int dma_mode,
 		 * enable the engine. Set which cs is has requested for.
 		 */
 		gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) |
-					PREFETCH_FIFOTHRESHOLD |
+					PREFETCH_FIFOTHRESHOLD(fifo_th) |
 					ENABLE_PREFETCH |
 					(dma_mode << DMA_MPU_MODE) |
 					(0x1 & is_write)));
arch/arm/plat-omap/include/plat/gpmc.h +4 -1
index 054e704..fb82335 100644
@@ -83,6 +83,9 @@
 #define GPMC_IRQ_FIFOEVENTENABLE	0x01
 #define GPMC_IRQ_COUNT_EVENT		0x02
 
+#define PREFETCH_FIFOTHRESHOLD_MAX	0x40
+#define PREFETCH_FIFOTHRESHOLD(val)	(val << 8)
+
 /*
  * Note that all values in this struct are in nanoseconds, while
  * the register values are in gpmc_fck cycles.
@@ -133,7 +136,7 @@ extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
 extern void gpmc_cs_free(int cs);
 extern int gpmc_cs_set_reserved(int cs, int reserved);
 extern int gpmc_cs_reserved(int cs);
-extern int gpmc_prefetch_enable(int cs, int dma_mode,
+extern int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
 					unsigned int u32_count, int is_write);
 extern int gpmc_prefetch_reset(int cs);
 extern void omap3_gpmc_save_context(void);
drivers/mtd/nand/omap2.c +15 -9
index c4bbbd0..fea9f59 100644
@@ -243,7 +243,8 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
 	}
 
 	/* configure and start prefetch transfer */
-	ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0);
+	ret = gpmc_prefetch_enable(info->gpmc_cs,
+			PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x0);
 	if (ret) {
 		/* PFPW engine is busy, use cpu copy method */
 		if (info->nand.options & NAND_BUSWIDTH_16)
@@ -287,7 +288,8 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
 	}
 
 	/*  configure and start prefetch transfer */
-	ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x1);
+	ret = gpmc_prefetch_enable(info->gpmc_cs,
+			PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1);
 	if (ret) {
 		/* PFPW engine is busy, use cpu copy method */
 		if (info->nand.options & NAND_BUSWIDTH_16)
@@ -340,10 +342,11 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
 	dma_addr_t dma_addr;
 	int ret;
 
-	/* The fifo depth is 64 bytes. We have a sync at each frame and frame
-	 * length is 64 bytes.
+	/* The fifo depth is 64 bytes max.
+	 * But configure the FIFO-threahold to 32 to get a sync at each frame
+	 * and frame length is 32 bytes.
 	 */
-	int buf_len = len >> 6;
+	int buf_len = len >> 5;
 
 	if (addr >= high_memory) {
 		struct page *p1;
@@ -382,7 +385,8 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
 					OMAP24XX_DMA_GPMC, OMAP_DMA_SRC_SYNC);
 	}
 	/*  configure and start prefetch transfer */
-	ret = gpmc_prefetch_enable(info->gpmc_cs, 0x1, len, is_write);
+	ret = gpmc_prefetch_enable(info->gpmc_cs,
+			PREFETCH_FIFOTHRESHOLD_MAX/2, 0x1, len, is_write);
 	if (ret)
 		/* PFPW engine is busy, use cpu copy methode */
 		goto out_copy;
@@ -518,7 +522,8 @@ static void omap_read_buf_irq_pref(struct mtd_info *mtd, u_char *buf, int len)
 	init_completion(&info->comp);
 
 	/*  configure and start prefetch transfer */
-	ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0);
+	ret = gpmc_prefetch_enable(info->gpmc_cs,
+			PREFETCH_FIFOTHRESHOLD_MAX/2, 0x0, len, 0x0);
 	if (ret)
 		/* PFPW engine is busy, use cpu copy methode */
 		goto out_copy;
@@ -563,8 +568,9 @@ static void omap_write_buf_irq_pref(struct mtd_info *mtd,
 	info->buf = (u_char *) buf;
 	init_completion(&info->comp);
 
-	/*  configure and start prefetch transfer */
-	ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x1);
+	/* configure and start prefetch transfer : size=24 */
+	ret = gpmc_prefetch_enable(info->gpmc_cs,
+			(PREFETCH_FIFOTHRESHOLD_MAX*3)/8, 0x0, len, 0x1);
 	if (ret)
 		/* PFPW engine is busy, use cpu copy methode */
 		goto out_copy;
Signature · 1 line
1.7.0.4
#12 lore raw

PATCH v6 6/7 omap: nand: ecc layout select from board file

In reply to Sukumar Ghorai

This patch makes it possible to select sw or hw (different layout options) ecc scheme supported by omap nand driver. And hw ecc layout selected for sdp and zoom boards, by default.

---
 arch/arm/mach-omap2/board-flash.c      |    1 +
 arch/arm/plat-omap/include/plat/gpmc.h |    7 +++++++
 arch/arm/plat-omap/include/plat/nand.h |    2 ++
 drivers/mtd/nand/omap2.c               |    5 +----
 4 files changed, 11 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/board-flash.c +1 -0
index 78abcd9..3340427 100644
@@ -150,6 +150,7 @@ __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs)
 	if (cpu_is_omap3630())
 		board_nand_data.devsize = 1;
 
+	board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DIFF_LAYOUT;
 	board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs;
 	gpmc_nand_init(&board_nand_data);
 }
arch/arm/plat-omap/include/plat/gpmc.h +7 -0
index fb82335..ca6e8db 100644
@@ -86,6 +86,13 @@
 #define PREFETCH_FIFOTHRESHOLD_MAX	0x40
 #define PREFETCH_FIFOTHRESHOLD(val)	(val << 8)
 
+enum omap_ecc {
+	OMAP_ECC_HAMMING_CODE_DIFF_LAYOUT = 0,
+		/* 1-bit s/w ecc and layout different from romcode */
+	OMAP_ECC_HAMMING_CODE_HW,/* 1-bit ecc, romcode layout */
+	OMAP_ECC_HAMMING_CODE_SW,/* 1-bit ecc, romcode layout */
+};
+
 /*
  * Note that all values in this struct are in nanoseconds, while
  * the register values are in gpmc_fck cycles.
arch/arm/plat-omap/include/plat/nand.h +2 -0
index ae5e053..d86d1ec 100644
@@ -8,6 +8,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <plat/gpmc.h>
 #include <linux/mtd/partitions.h>
 
 enum nand_io {
@@ -31,6 +32,7 @@ struct omap_nand_platform_data {
 	enum nand_io		xfer_type;
 	unsigned long		phys_base;
 	int			devsize;
+	enum omap_ecc           ecc_opt;
 };
 
 /* minimum size for IO mapping */
drivers/mtd/nand/omap2.c +1 -4
index fea9f59..0937001 100644
@@ -7,6 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#define CONFIG_MTD_NAND_OMAP_HWECC
 
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
@@ -618,8 +619,6 @@ static int omap_verify_buf(struct mtd_info *mtd, const u_char * buf, int len)
 	return 0;
 }
 
-#ifdef CONFIG_MTD_NAND_OMAP_HWECC
-
 /**
  * gen_true_ecc - This function will generate true ECC value
  * @ecc_buf: buffer to store ecc code
@@ -839,8 +838,6 @@ static void omap_enable_hwecc(struct mtd_info *mtd, int mode)
 	gpmc_enable_hwecc(info->gpmc_cs, mode, dev_width, info->nand.ecc.size);
 }
 
-#endif
-
 /**
  * omap_wait - wait until the command is done
  * @mtd: MTD device structure
Signature · 1 line
1.7.0.4
#13 lore raw

PATCH v6 7/7 omap: nand: making ecc layout as compatible with romcode ecc

In reply to Sukumar Ghorai

This patch overrides nand ecc layout and bad block descriptor (for 8-bit device) to support hw ecc in romcode layout. So as to have in sync with ecc layout throughout; i.e. x-loader, u-boot and kernel.

This patch also enables to use romcode ecc for spd and zoom, by default.

This enables to flash x-loader, u-boot, kernel, FS images from kernel itself and compatiable with other tools.

---
 drivers/mtd/nand/omap2.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
drivers/mtd/nand/omap2.c +34 -0
index 0937001..d4c508a 100644
@@ -98,6 +98,20 @@
 static const char *part_probes[] = { "cmdlinepart", NULL };
 #endif
 
+/* oob info generated runtime depending on ecc algorithm and layout selected */
+static struct nand_ecclayout omap_oobinfo;
+/* Define some generic bad / good block scan pattern which are used
+ * while scanning a device for factory marked good / bad blocks
+ */
+static uint8_t scan_ff_pattern[] = { 0xff };
+static struct nand_bbt_descr bb_descrip_flashbased = {
+	.options = NAND_BBT_SCANEMPTY | NAND_BBT_SCANALLPAGES,
+	.offs = 0,
+	.len = 1,
+	.pattern = scan_ff_pattern,
+};
+
+
 struct omap_nand_info {
 	struct nand_hw_control		controller;
 	struct omap_nand_platform_data	*pdata;
@@ -907,6 +921,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 	struct omap_nand_info		*info;
 	struct omap_nand_platform_data	*pdata;
 	int				err;
+	int				i, offset;
 
 	pdata = pdev->dev.platform_data;
 	if (pdata == NULL) {
@@ -1051,6 +1066,25 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 	}
 
 
+	/* rom code layout */
+	if (pdata->ecc_opt != OMAP_ECC_HAMMING_CODE_DIFF_LAYOUT) {
+		offset = (info->nand.options & NAND_BUSWIDTH_16) ? 2 : 1;
+		if (info->mtd.oobsize == 16) {
+			info->nand.badblock_pattern = &bb_descrip_flashbased;
+			omap_oobinfo.eccbytes = 3;
+		} else
+			omap_oobinfo.eccbytes  = 3 * 4;
+
+		for (i = 0; i < omap_oobinfo.eccbytes; i++)
+			omap_oobinfo.eccpos[i] = i+offset;
+
+		omap_oobinfo.oobfree->offset = offset + omap_oobinfo.eccbytes;
+		omap_oobinfo.oobfree->length = info->mtd.oobsize -
+					(offset + omap_oobinfo.eccbytes);
+
+		info->nand.ecc.layout = &omap_oobinfo;
+	}
+
 #ifdef CONFIG_MTD_PARTITIONS
 	err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0);
 	if (err > 0)
Signature · 1 line
1.7.0.4
#14 lore raw
In reply to Sukumar Ghorai

Hello Grazvydas & Charles,
Would you please check this series in you setup and please update the status or any issue you observe?

Regards,
Ghorai

Quoted 79 lines

-----Original Message-----
From: Ghorai, Sukumar
Sent: Friday, November 26, 2010 9:05 PM
To: [email protected]
Cc: [email protected]; [email protected]; Ghorai, Sukumar
Subject: [PATCH v6 0/7] nand prefetch-irq support and ecc layout chanage

The following set of patches applies on linux-2.6.

The main motivations behind this patch series are -
1. support NAND I/O in irq mode.
2. support of different ECC schema.
3. also to make ecc layout as like in romcode ecc layout

v6: configurable transfer type from board file;

    #define irq number used for nand-irq

v5: http://www.mail-archive.com/[email protected]/msg35860.html
This address the input as to support the irq_chained in GPMC. And resend of
http://www.mail-archive.com/[email protected]/msg35848.html

v4: http://www.mail-archive.com/[email protected]/msg34882.html
and resend of
http://www.mail-archive.com/[email protected]/msg32689.html

v3: http://www.mail-archive.com/[email protected]/msg32071.html
Rebase on latest codebase and previous patch(posted).
http://www.mail-archive.com/[email protected]/msg31963.html

v2: Rebase on latest codebase and previous patch(posted).
http://www.mail-archive.com/[email protected]/msg31471.html

v1: http://www.mail-archive.com/[email protected]/msg26666.html

Sukumar Ghorai (7):
omap3630: nand: fix device size to work in polled mode
omap3: nand: configurable transfer type per board
omap: gpmc: enable irq mode in gpmc
omap3: nand: prefetch in irq mode support
omap3: nand: configurable fifo threshold to gain the throughput
omap: nand: ecc layout select from board file
omap: nand: making ecc layout as compatible with romcode ecc

 arch/arm/mach-omap2/board-2430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3630sdp.c        |    1 +
 arch/arm/mach-omap2/board-4430sdp.c        |    2 +
 arch/arm/mach-omap2/board-am3517evm.c      |    2 +
 arch/arm/mach-omap2/board-apollon.c        |    1 +
 arch/arm/mach-omap2/board-cm-t35.c         |    1 +
 arch/arm/mach-omap2/board-devkit8000.c     |    1 +
 arch/arm/mach-omap2/board-flash.c          |    7 +
 arch/arm/mach-omap2/board-generic.c        |    2 +
 arch/arm/mach-omap2/board-h4.c             |    1 +
 arch/arm/mach-omap2/board-igep0020.c       |    1 +
 arch/arm/mach-omap2/board-ldp.c            |    1 +
 arch/arm/mach-omap2/board-n8x0.c           |    2 +
 arch/arm/mach-omap2/board-omap3beagle.c    |    1 +
 arch/arm/mach-omap2/board-omap3evm.c       |    2 +
 arch/arm/mach-omap2/board-omap3pandora.c   |    2 +
 arch/arm/mach-omap2/board-omap3stalker.c   |    1 +
 arch/arm/mach-omap2/board-omap3touchbook.c |    1 +
 arch/arm/mach-omap2/board-omap4panda.c     |    2 +
 arch/arm/mach-omap2/board-overo.c          |    1 +
 arch/arm/mach-omap2/board-rx51.c           |    1 +
 arch/arm/mach-omap2/board-zoom2.c          |    2 +
 arch/arm/mach-omap2/board-zoom3.c          |    2 +
 arch/arm/mach-omap2/gpmc.c                 |   50 ++++-
 arch/arm/mach-omap2/io.c                   |    2 -
 arch/arm/plat-omap/include/plat/gpmc.h     |   16 ++-
 arch/arm/plat-omap/include/plat/irqs.h     |    9 +-
 arch/arm/plat-omap/include/plat/nand.h     |   11 +
 drivers/mtd/nand/Kconfig                   |   17 --
 drivers/mtd/nand/omap2.c                   |  314 ++++++++++++++++++++++-
-----
 31 files changed, 364 insertions(+), 94 deletions(-)
#15 lore raw
Quoted 3 lines · Sukumar

Hello Grazvydas & Charles,
Would you please check this series in you setup and please update the status or any issue you observe?

Hello

It took a while for me to get back to this.

I applied the patches but still no luck running with the HW ECC disabled.

The image was written with SW ECC using UBOOT.

This system is actually running on an Overo with a customised kernel.

Ideally, the ECC will not change from version to version.

I shall explore further...

Here is a boot log:

[    0.000000] Linux version 2.6.37-rc3-sdu-1+ (charles@charles-laptop) (gcc 
version 4.3.3 (GCC) ) #27 Thu Dec 2 16:43:03 NZDT 2010
[    0.000000] CPU: ARMv7 Processor [411fc082] revision 2 (ARMv7), cr=10c53c7f
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction 
cache
[    0.000000] Machine: Gumstix Overo
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] OMAP3525 ES2.1 (l2cache iva neon isp )
[    0.000000] SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x10000
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total 
pages: 65024
[    0.000000] Kernel command line: console=ttyO2,115200n8 
video=omapfb:vram:2M,vram:4M root=ubi0:root rw rootfstype=ubifs ubi.mtd=7
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 256MB = 256MB total
[    0.000000] Memory: 256664k/256664k available, 5480k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
[    0.000000]     vmalloc : 0xd0800000 - 0xf8000000   ( 632 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .init : 0xc0008000 - 0xc0038000   ( 192 kB)
[    0.000000]       .text : 0xc0038000 - 0xc02c2000   (2600 kB)
[    0.000000]       .data : 0xc02c2000 - 0xc02fac80   ( 228 kB)
[    0.000000] NR_IRQS:409
[    0.000000] Clocking rate (Crystal/Core/MPU): 26.0/331/500 MHz
[    0.000000] Reprogramming SDRC clock to 331882352 Hz
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96 
interrupts
[    0.000000] Total of 96 interrupts on 1 active controller
[    0.000000] GPMC revision 5.0
[    0.000000] Trying to install interrupt handler for IRQ402
[    0.000000] Trying to install interrupt handler for IRQ403
[    0.000000] Trying to install interrupt handler for IRQ404
[    0.000000] Trying to install interrupt handler for IRQ405
[    0.000000] Trying to install interrupt handler for IRQ406
[    0.000000] Trying to install interrupt handler for IRQ407
[    0.000000] Trying to install interrupt handler for IRQ408
[    0.000000] Trying to install type control for IRQ409
[    0.000000] Trying to set irq flags for IRQ409
[    0.000000] Could not get gpios_ick
[    0.000000] Could not get gpios_fck
[    0.000000] OMAP GPIO hardware version 2.5
[    0.000000] OMAP clockevent source: GPTIMER1 at 32768 Hz
[    0.000000] Console: colour dummy device 80x30
[    0.000000] Calibrating delay loop... 499.92 BogoMIPS (lpj=1949696)
[    0.000000] pid_max: default: 32768 minimum: 301
[    0.000000] Mount-cache hash table entries: 512
[    0.000000] CPU: Testing write buffer coherency: ok
[    0.000000] regulator: core version 0.5
[    0.000000] regulator: dummy: 
[    0.000000] NET: Registered protocol family 16
[    0.000000] omap_mux_init: Add partition: #1: core, flags: 0
[    0.000000] Found NAND on CS0
[    0.000000] Registering NAND on CS0
[    0.000000] finished sdu_init
[    0.000000] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.000000] OMAP DMA hardware revision 4.0
[    0.010284] bio: create slab <bio-0> at 0
[    0.014343] omap_device: i2c_omap.1: new worst case activate latency 0: 
30517
[    0.014434] i2c_omap i2c_omap.1: bus 1 rev3.12 at 2600 kHz
[    0.017730] twl4030: PIH (irq 7) chaining IRQs 368..375
[    0.017761] twl4030: power (irq 373) chaining IRQs 376..383
[    0.018432] twl4030: gpio (irq 368) chaining IRQs 384..401
[    0.022277] regulator: VMMC1: 1850 <--> 3150 mV at 3000 mV normal standby
[    0.022552] i2c_omap i2c_omap.3: bus 3 rev3.12 at 100 kHz
[    0.025238] Bluetooth: Core ver 2.15
[    0.025512] NET: Registered protocol family 31
[    0.025512] Bluetooth: HCI device and connection manager initialized
[    0.025543] Bluetooth: HCI socket layer initialized
[    0.025573] Switching to clocksource 32k_counter
[    0.048950] NET: Registered protocol family 2
[    0.049255] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.049743] TCP established hash table entries: 8192 (order: 4, 65536 
bytes)
[    0.049987] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[    0.050109] TCP: Hash tables configured (established 8192 bind 8192)
[    0.050140] TCP reno registered
[    0.050140] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.050201] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.050445] NET: Registered protocol family 1
[    0.050537] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.054443] msgmni has been set to 501
[    0.055175] io scheduler noop registered
[    0.055206] io scheduler deadline registered
[    0.055328] io scheduler cfq registered (default)
[    0.056762] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.058959] omap-hsuart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP 
UART0
[    0.059387] omap-hsuart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP 
UART1
[    0.059783] omap-hsuart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP 
UART2
[    0.565887] console [ttyO2] enabled
[    0.582672] brd: module loaded
[    0.592285] loop: module loaded
[    0.597106] omap2-nand driver initializing
[    0.601715] ONFI flash detected
[    0.605316] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron )
[    0.612548] cmdlinepart partition parsing not available
[    0.618011] Creating 10 MTD partitions on "omap2-nand.0":
[    0.623718] 0x000000000000-0x000000080000 : "xloader"
[    0.630035] 0x000000080000-0x000000100000 : "uboot"
[    0.636077] 0x000000100000-0x000000180000 : "mandata"
[    0.642242] 0x000000180000-0x000000200000 : "upgradestate"
[    0.648895] 0x000000200000-0x000000400000 : "linux0"
[    0.655639] 0x000000400000-0x000000600000 : "linux1"
[    0.662322] 0x000000600000-0x000001000000 : "earlyrw"
[    0.672454] 0x000001000000-0x000004000000 : "root0"
[    0.698394] 0x000004000000-0x000007000000 : "root1"
[    0.724304] 0x000007000000-0x000010000000 : "laterw"
[    0.791564] UBI: attaching mtd7 to ubi0
[    0.795562] UBI: physical eraseblock size:   131072 bytes (128 KiB)
[    0.802154] UBI: logical eraseblock size:    129024 bytes
[    0.807830] UBI: smallest flash I/O unit:    2048
[    0.812744] UBI: sub-page size:              512
[    0.817626] UBI: VID header offset:          512 (aligned 512)
[    0.823760] UBI: data offset:                2048
[    0.829162] uncorrectable error : 
[    0.832611] UBI error: ubi_io_read: error -74 (ECC error) while reading 512 
bytes from PEB 0:512, read 512 bytes
[    0.843872] uncorrectable error : 
[    0.847290] UBI error: ubi_io_read: error -74 (ECC error) while reading 512 
bytes from PEB 1:512, read 512 bytes
[    0.858398] uncorrectable error : 
[    0.861816] UBI error: ubi_io_read: error -74 (ECC error) while reading 512 
bytes from PEB 2:512, read 512 bytes
[    0.872924] uncorrectable error : 
[    0.876312] UBI error: ubi_io_read: error -74 (ECC error) while reading 512 
bytes from PEB 3:512, read 512 bytes
[    0.887420] uncorrectable error : 
[    0.890808] UBI error: ubi_io_read: error -74 (ECC error) while reading 512 

bytes from PEB 4:512, read 512 bytes

Quoted 88 lines

Regards,
Ghorai

Quoted 71 lines

-----Original Message-----
From: Ghorai, Sukumar
Sent: Friday, November 26, 2010 9:05 PM
To: [email protected]
Cc: [email protected]; [email protected]; Ghorai, Sukumar
Subject: [PATCH v6 0/7] nand prefetch-irq support and ecc layout chanage

The following set of patches applies on linux-2.6.

The main motivations behind this patch series are -
1. support NAND I/O in irq mode.
2. support of different ECC schema.
3. also to make ecc layout as like in romcode ecc layout

v6: configurable transfer type from board file;

    #define irq number used for nand-irq

v5: http://www.mail-archive.com/[email protected]/msg35860.html
This address the input as to support the irq_chained in GPMC. And resend of
http://www.mail-archive.com/[email protected]/msg35848.html

v4: http://www.mail-archive.com/[email protected]/msg34882.html
and resend of
http://www.mail-archive.com/[email protected]/msg32689.html

v3: http://www.mail-archive.com/[email protected]/msg32071.html
Rebase on latest codebase and previous patch(posted).
http://www.mail-archive.com/[email protected]/msg31963.html

v2: Rebase on latest codebase and previous patch(posted).
http://www.mail-archive.com/[email protected]/msg31471.html

v1: http://www.mail-archive.com/[email protected]/msg26666.html

Sukumar Ghorai (7):
omap3630: nand: fix device size to work in polled mode
omap3: nand: configurable transfer type per board
omap: gpmc: enable irq mode in gpmc
omap3: nand: prefetch in irq mode support
omap3: nand: configurable fifo threshold to gain the throughput
omap: nand: ecc layout select from board file
omap: nand: making ecc layout as compatible with romcode ecc

 arch/arm/mach-omap2/board-2430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3430sdp.c        |    1 +
 arch/arm/mach-omap2/board-3630sdp.c        |    1 +
 arch/arm/mach-omap2/board-4430sdp.c        |    2 +
 arch/arm/mach-omap2/board-am3517evm.c      |    2 +
 arch/arm/mach-omap2/board-apollon.c        |    1 +
 arch/arm/mach-omap2/board-cm-t35.c         |    1 +
 arch/arm/mach-omap2/board-devkit8000.c     |    1 +
 arch/arm/mach-omap2/board-flash.c          |    7 +
 arch/arm/mach-omap2/board-generic.c        |    2 +
 arch/arm/mach-omap2/board-h4.c             |    1 +
 arch/arm/mach-omap2/board-igep0020.c       |    1 +
 arch/arm/mach-omap2/board-ldp.c            |    1 +
 arch/arm/mach-omap2/board-n8x0.c           |    2 +
 arch/arm/mach-omap2/board-omap3beagle.c    |    1 +
 arch/arm/mach-omap2/board-omap3evm.c       |    2 +
 arch/arm/mach-omap2/board-omap3pandora.c   |    2 +
 arch/arm/mach-omap2/board-omap3stalker.c   |    1 +
 arch/arm/mach-omap2/board-omap3touchbook.c |    1 +
 arch/arm/mach-omap2/board-omap4panda.c     |    2 +
 arch/arm/mach-omap2/board-overo.c          |    1 +
 arch/arm/mach-omap2/board-rx51.c           |    1 +
 arch/arm/mach-omap2/board-zoom2.c          |    2 +
 arch/arm/mach-omap2/board-zoom3.c          |    2 +
 arch/arm/mach-omap2/gpmc.c                 |   50 ++++-
Quoted 8 lines
 arch/arm/mach-omap2/io.c                   |    2 -
 arch/arm/plat-omap/include/plat/gpmc.h     |   16 ++-
 arch/arm/plat-omap/include/plat/irqs.h     |    9 +-
 arch/arm/plat-omap/include/plat/nand.h     |   11 +
 drivers/mtd/nand/Kconfig                   |   17 --
 drivers/mtd/nand/omap2.c                   |  314
++++++++++++++++++++++- -----
 31 files changed, 364 insertions(+), 94 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#16 lore raw

v6 cover nand prefetch-irq support and ecc layout chanage

In reply to Sukumar Ghorai
Quoted 6 lines · On Saturday 27 November 2010 04:34:30 Sukumar Ghorai wrote:

The following set of patches applies on linux-2.6.

The main motivations behind this patch series are -
1. support NAND I/O in irq mode.
2. support of different ECC schema.
3. also to make ecc layout as like in romcode ecc layout

Why change the ECC layout?

Be very careful when you change ECC layouts. This can break production systems.

For example if people are running something earlier and then want to deliver a new kernel with 2.6.37 then their existing NAND file systems will no longer be readable.

Changes to ECC should only be done for very good reasons and should be controlled with a Kconfig with the default being the existing ECC layout.

-- Charles

#17 lore raw

v6 cover nand prefetch-irq support and ecc layout chanage

Quoted 24 lines

-----Original Message-----
From: Charles Manning [mailto:manningc2 at actrix.gen.nz]
Sent: Monday, December 20, 2010 3:16 AM
To: linux-mtd at lists.infradead.org
Cc: Ghorai, Sukumar; linux-omap at vger.kernel.org; linux-arm- kernel at lists.infradead.org
Subject: Re: [PATCH v6 0/7] nand prefetch-irq support and ecc layout chanage

Quoted 6 lines · On Saturday 27 November 2010 04:34:30 Sukumar Ghorai wrote:

The following set of patches applies on linux-2.6.

The main motivations behind this patch series are -
1. support NAND I/O in irq mode.
2. support of different ECC schema.
3. also to make ecc layout as like in romcode ecc layout

Why change the ECC layout?

Be very careful when you change ECC layouts. This can break production systems.

Quoted 9 lines

For example if people are running something earlier and then want to deliver a
new kernel with 2.6.37 then their existing NAND file systems will no longer
be readable.

Changes to ECC should only be done for very good reasons and should be controlled with a Kconfig with the default being the existing ECC layout.

[Ghorai] we are just adding few ecc-layout(s) and based on the request from different customer. The default ecc-layout is the old one for backward compatibility and selection of ecc-layput is exposed form board file.