Commit Graph

236 Commits (5816fbbf22470b687964462e6c1f18165b291f22)

Author SHA1 Message Date
Mike Rapoport 54d33c4c71 [MTD] [NAND] CM-x270 MTD driver
This patch provides MTD support for NAND flash devices on CM-x270 modules.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-27 23:04:32 +01:00
Knobloch, Thomas 78ab67da10 [MTD] [NAND] Wrong calculation of page number in nand_block_bad()
In case that there is no memory based bad block table available the
function nand_block_checkbad() in drivers/mtd/nand/nand_base.c will call
nand_block_bad() directly. When parameter 'getchip' is set to zero,
nand_block_bad() will not right shift the offset to calculate the
correct page number.

Signed-off-by: Thomas Knobloch <knobloch@siemens.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-27 15:13:53 +01:00
Jan Engelhardt ec98c681a5 Use menuconfig objects: MTD
Use menuconfigs instead of menus, so the whole menu can be disabled at once
instead of going through all options.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-19 16:21:41 -05:00
Adrian Hunter a5ac8aeb29 [MTD] nandsim: enhance nandsim to allow arbitrary NAND size
A new module parameter has been added called 'overridesize',
which overrides the size that would be determined by the
ID bytes. 'overridesize' is specified in erase blocks and
as the exponent of a power of two e.g. 5 means a size of
32 erase blocks.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-17 13:55:55 -04:00
Adrian Hunter 57aa6b545f [MTD] nandsim: Enhance nandsim optionally to report wear information
A new module parameter 'rptwear' specifies how many erases between
reporting wear information.  Zero means never.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-17 13:55:29 -04:00
Adrian Hunter 514087e74f [MTD] nandsim: enhance nandsim to simulate flash errors
New module parameters have been added to nandsim to
simulate:

        bitflips        random bit flips
        badblocks       blocks that are initially marked bad
        weakblocks      blocks that fail to erase after a
                        small number of erase cycles
        weakpages       pages that fail to write after a
                        small number of successful writes
        gravepages      pages that fail to read after a
                        small number of successful reads

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-17 13:55:08 -04:00
Adrian Hunter 2b77a0ed54 [MTD] nandsim: add partition capability to nandsim
Enhance nandsim to be able to create more than 1 partition.
A new module parameter 'parts' may be used to specify partition
sizes.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-17 13:54:50 -04:00
Andre Renaud 4226b51037 [MTD] [NAND] Casting bug in nand_default_block_markbad
There is a slight bug in nand_default_block_markbad, where the offset is
cast to an integer, prior to being shifted. This means that on large
offsets, it is incorrectly doing a signed shift & losing bits. Fixed
this by doing the cast after the shift (as is done elsewhere in the code).

Signed-off-by: Andre Renaud <andre@bluewatersys.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-17 13:50:59 -04:00
Thomas Gleixner 1cf9827b68 [MTD] [NAND] Move ancient NAND chip support into a config option
The support for obsolete ancient NAND chips adds .data size and one
of the old ids conflicts with a modern one. Make the support for
such chips depending on a config option.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-17 18:30:57 +01:00
Thomas Gleixner 90424de8d0 [MTD] [NAND] Use ecc.read/write_page_raw consequently
Use the functions in the ecc structure instead of the default ones,
so the override by the board driver is effective also for software ecc
code paths.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-17 18:28:17 +01:00
sshahrom@micron.com 8c60e5475d [MTD][NAND] Add Micron Manufacturer ID
Add Micron Manufacturer ID.

Signed-off-by: Shahrom Sharif <sshahrom@micron.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-04-17 18:27:06 +01:00
David Woodhouse 8e5368a1e2 [MTD] [NAND] Remember timing settings for CAFÉ NAND controller.
We'll need them for suspend/resume.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-03-23 10:40:04 +00:00
Robert P. J. Day 89e2bf61da [MTD] [NAND] Correct misspelled preprocessor variable.
Replace the apparently misspelled preprocessor variable
"MTD_NAND_DISKONCHIP_BBTWRITE" with the correct form
"CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE".

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-03-08 09:48:14 +00:00
Vitaly Wool 1f92267c51 [MTD] [NAND] make oobavail public
During the MTD rework the oobavail parameter of mtd_info structure has become
private. This is not quite correct in terms of integrity and logic. If we have
means to write to OOB area, then we'd like to know upfront how many bytes out
of OOB are spare per page to be able to adapt to specific cases.
The patch inlined adds the public oobavail parameter.

Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-03-08 09:17:43 +00:00
Arnaud Patard dff5e44c36 [ARM] 4233/1: nand/s3c2410.c: warning fix
Noticed while building a s3c2410 kernel :
drivers/mtd/nand/s3c2410.c: In function 's3c2440_nand_calculate_ecc':
drivers/mtd/nand/s3c2410.c:476: warning: format '%06x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'

This patch fixes it.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-02-25 16:41:41 +00:00
Linus Torvalds 4935361766 Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (49 commits)
  [MTD] [NAND] S3C2412 fix hw ecc
  [MTD] [NAND] Work around false compiler warning in CAFÉ driver
  [JFFS2] printk warning fixes
  [MTD] [MAPS] ichxrom warning fix
  [MTD] [MAPS] amd76xrom warning fix
  [MTD] [MAPS] esb2rom warning fixes
  [MTD] [MAPS] ck804xrom warning fix
  [MTD] [MAPS] netsc520 warning fix
  [MTD] [MAPS] sc520cdp warning fix
  [MTD] [ONENAND] onenand_base warning fix
  [MTD] [NAND] eXcite nand flash driver
  [MTD] Improve heuristic for detecting wrong-endian RedBoot partition table
  [MTD] Fix RedBoot partition parsing regression harder.
  [MTD] [NAND] S3C2410: Hardware ECC correction code
  [JFFS2] Use MTD_OOB_AUTO to automatically place cleanmarker on NAND
  [MTD] Clarify OOB-operation interface comments
  [MTD] remove unused ecctype,eccsize fields from struct mtd_info
  [MTD] [NOR] Intel: remove ugly PROGREGION macros
  [MTD] [NOR] STAA: use writesize instead off eccsize to represent ECC block
  [MTD] OneNAND: Invalidate bufferRAM after erase
  ...
2007-02-19 13:34:11 -08:00
Matthieu CASTET 4f65992381 [MTD] [NAND] S3C2412 fix hw ecc
S3C2412 use differents registers than s3c2440 for hw ecc handling.

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.fr>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-02-18 16:47:47 +00:00
Andrew Morton 2a7295b277 [MTD] [NAND] Work around false compiler warning in CAFÉ driver
drivers/mtd/nand/cafe.c: In function 'cafe_nand_cmdfunc':
drivers/mtd/nand/cafe.c:269: warning: 'irqs' may be used uninitialized in this function

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-02-18 16:45:05 +00:00
Thomas Gleixner 2db6346f76 [PATCH] Scheduled removal of SA_xxx interrupt flags fixups 2
The obsolete SA_xxx interrupt flags have been used despite the scheduled
removal.  Fixup the remaining users in -mm.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-14 08:09:55 -08:00
Thomas Koeller 67a9c7af1f [MTD] [NAND] eXcite nand flash driver
This is a nand flash driver for the eXcite series of intelligent
cameras manufactured by Basler Vision Technologies AG.

Signed-off-by: Thomas Koeller <thomas.koeller@baslerweb.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-02-11 17:57:49 +01:00
Ben Dooks a2593247d7 [MTD] [NAND] S3C2410: Hardware ECC correction code
Add support for correcting errors detected by the
hardware ECC.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-02-09 17:12:59 +00:00
Artem Bityutskiy 64f6071056 [MTD] remove unused ecctype,eccsize fields from struct mtd_info
Remove unused and broken mtd->ecctype and mtd->eccsize fields
from struct mtd_info. Do not remove them from userspace API
data structures (don't want to breake userspace) but mark them
as obsolete by a comment. Any userspace program which uses them
should be half-broken anyway, so this is more about saving
data structure size.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-02-09 15:27:12 +00:00
Adrian Bunk d24030f0f7 [MTD] [NAND] Fix an off-by-one in a BUG_ON in CAFÉ ECC correction.
err_pos_lut[4096] of an array with 4096 elements is a bug.

Spotted by the Coverity checker.

While I was at it, I also converted it to ARRAY_SIZE().

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-02-09 15:06:02 +00:00
Adrian Hunter 0373615579 [MTD] [NAND] Correctly validate out-of-band offset and length
Add checks to ensure that out-of-band reads and writes are
not attempted with an invalid offset or length.  Specifically,
the offset must be less than the size of oob for a page
and the length must not go beyond the size of the device.
Additionally the checks must adjust for auto-placement
(MTD_OOB_AUTO) of oob data.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-02-09 15:02:40 +00:00
David Woodhouse aa8f127855 [MTD NAND] CAFÉ controller depends, perhaps unsurprisingly, on NAND
Noticed by Ingo.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-02-05 13:32:55 +00:00
David Woodhouse 4285431fb6 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2007-02-05 13:25:21 +00:00
Al Viro a12743026c [PATCH] mtd/nand/cafe.c missing include of dma-mapping.h
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-01-30 08:39:20 -08:00
David Woodhouse f7c37d7b8a [MTD] [NAND] Remove debugging cruft from CAFÉ NAND driver.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-01-23 23:36:43 +08:00
David Woodhouse 527a4f45ef [MTD] [NAND] Inherit CAFÉ NAND timing setup from firmware
The precise timings are board-specific (or NAND chip specific) and don't
belong here. If they're set already, then use what we find there.
Otherwise, revert to the most conservative default values (and whinge).

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-01-23 23:36:42 +08:00
Andrew Victor dd11b8cdf0 [MTD] NAND: Support for 16-bit bus-width on AT91.
Add support for 16-bit NAND bus-width for the AT91 NAND driver.

The 16-bit NAND is found on the Atmel AT91SAM9260-EK and AT91SAM9261-EK
boards.

Orignal Patch from Patrice Vilchez

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-08 13:25:17 +00:00
Artem Bityutskiy 4a0c50c07a [MTD] nandsim: bugfix in page addressing
Number of address bytes for 64-128 MiB NANDs is 4, not 5.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-08 13:22:54 +00:00
Timo Lindhorst 418b2e56b8 [MTD] NAND: use SmartMedia ECC byte order for ndfc
Select MTD_NAND_ECC_SMC (ECC byte order according to the Smart Media
Specification) if MTD_NAND_NDFC is used.
Using the wrong byte order causes fatal, unnoticed data damage.

For further information see:
http://lists.infradead.org/pipermail/linux-mtd/2006-November/016920.html

Signed-off-by: Timo Lindhorst <lindhors@linux.vnet.ibm.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-05 18:00:13 +00:00
Mariusz Kozlowski 7dcb483de3 [MTD] [NAND] Compile fix in rfc_from4.c
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-01 09:59:49 +00:00
David Woodhouse bd3c97a7c7 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-12-01 09:56:43 +00:00
David Woodhouse c9ac597729 [MTD] Remove trailing whitespace
The newly-added cafe_ecc.c had a lot of it because of the way the lookup
table was auto-generated; clean up the other files too while we're at it.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-30 08:17:38 +00:00
Thomas Gleixner 29072b9607 [MTD] NAND: add subpage write support
Many SLC NANDs support up to 4 writes at one NAND page. Add support
of this feature.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 17:03:52 +02:00
Andrew Morton ce1060494a [MTD] Tidy bitrev usage in rtc_from4.c
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-29 00:19:14 +00:00
Timo Lindhorst fc02919499 [MTD] [NAND] fix ifdef option in nand_ecc.c
Fix up the config option in the #ifdef statements in nand_ecc.c

Signed-off-by: Timo Lindhorst <lindhors@linux.vnet.ibm.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-29 00:11:39 +00:00
David Woodhouse 28bdd4a72d [MTD] [NAND] Update CAFÉ driver interrupt handler prototype
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-29 00:04:59 +00:00
Burman Yan 95b93a0cd4 [MTD] replace kmalloc+memset with kzalloc
Signed-off-by: Yan Burman <yan_952@hotmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 23:47:21 +00:00
David Woodhouse 1aaaeabf36 Merge git://git.infradead.org/~dwmw2/cafe-2.6 2006-11-28 22:43:10 +00:00
Vitaly Wool 7014568bad [MTD] [NAND] remove len/ooblen confusion.
As was discussed between Ricard Wanderlöf, David Woodhouse, Artem 
Bityutskiy and me, the current API for reading/writing OOB is confusing. 

The thing that introduces confusion is the need to specify ops.len 
together with ops.ooblen for reads/writes that concern only OOB not data 
area. So, ops.len is overloaded: when ops.datbuf != NULL it serves to 
specify the length of the data read, and when ops.datbuf == NULL, it 
serves to specify the full OOB read length.

The patch inlined below is the slightly updated version of the previous 
patch serving the same purpose, but with the new Artem's comments taken 
into account.

Artem, BTW, thanks a lot for your valuable input!

Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 22:39:03 +00:00
Stefan Roese 4010db56c8 [MTD] [NAND] Fix endianess bug in ndfc.c
The writel() call accidentally clears all bits in the NDFC_CCR
register (endianess problem). Now __raw_writel() is used instead.

Tested on Bamboo with NAND on chip select 0 and chip select 1.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 22:22:55 +00:00
Adrian Bunk 1605cd3d9c [MTD] [NAND] rtc_from4.c: use lib/bitrev.c
This patch converts drivers/mtd/nand/rtc_from4.c to use the new
lib/bitrev.c

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 22:18:52 +00:00
David Woodhouse cad40654c3 [MTD] NAND: Fix ECC settings in CAFÉ controller driver.
We were resetting cafe->ctl2 to zero after an erase (and also during a
write, but it was correctly reset after that). This meant that ECC reads
after an erase were failing. Doh.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-01 08:19:20 +08:00
David Woodhouse be8444bdf3 [MTD] NAND: Add register debugging spew option to CAFÉ driver
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-31 12:36:04 +08:00
David Woodhouse 195a253b66 [MTD] NAND: Use register #defines throughout CAFÉ driver, not numbers
Also use cafe_readl() and cafe_writel() abstraction to make code
slightly cleaner -- especially if we want to use it in PIO mode.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-31 12:30:11 +08:00
David Woodhouse a020727b16 [MTD] NAND: Fix timing calculation in CAFÉ debugging message
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-28 17:08:38 +03:00
Jesper Juhl efbfe96c5d [PATCH] silence 'make xmldocs' warning by adding missing description of 'raw' in nand_base.c:1485
Add description of 'raw' in comments for
drivers/mtd/nand/nand_base.c::nand_write_page_syndrome() so 'make xmldocs'
will not spew a warning at us.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-27 15:34:51 -07:00
David Woodhouse 63a1423763 [MTD] NAND: Remove empty block ECC workaround
They fixed the hardware so that ECC doesn't fail on reading an empty
block.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-27 22:12:02 +03:00