Commit Graph

563 Commits (211ac75f5e867ab7a54811a514814149caca42c3)

Author SHA1 Message Date
Kyungmin Park 211ac75f5e [MTD] OneNAND: Error message printing and bad block scan erros
Provide the bad block scan with its own read function so that important error
messages that are not from the the bad block scan, can always be printed.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-02-07 12:15:01 +09:00
Adrian Hunter 81f38e1123 [MTD] OneNAND: Subpage write returned incorrect length written
When a write is done, the length written is returned.  When a
single subpage is written the length returned should be the
subpage size, however the page size was being returned.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-02-07 10:55:23 +09:00
Adrian Hunter 52e4200a6d [MTD] OneNAND: Do not allow oob write past end of page
OneNAND can write oob to successive pages, but NAND
does not do that.  For compatibility, disallow OneNAND
from writing past the end of the page.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-02-06 09:15:39 +09:00
Kyungmin Park 5b4246f1b0 [MTD] OneNAND: Fix typo and remove unnecessary goto statement
In previos patch, there's typo so fix it
Remove unnecessary goto statement

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-02-02 09:39:21 +09:00
Kyungmin Park abf3c0f23d [MTD] OneNAND: Reduce internal BufferRAM operations
It use blockpage instead of a pair (block, page). It can also cover a small chunk access. 0x00, 0x20, 0x40 and so on.

And in JFFS2 behavior, sometimes it reads two pages alternatively.
e.g., It first reads A page, B page and A page.
So we check another bufferram to find requested page.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-02-02 09:29:36 +09:00
Kyungmin Park 4f4fad27ac [MTD] OneNAND: Remove line of code that was meant to be deleted in OOB_AUTO
- Iterations of the patch to add oob auto-placement support to OneNAND left a line of code that was meant to have been deleted.
- read mtd->oobsize in onenand_transfer_auto_oob to optimized memcpy

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-02-02 09:22:21 +09:00
Adrian Hunter a5e7c7b447 [MTD] OneNAND: Add support for auto-placement of out-of-band data
Enable the use of oob operation mode MTD_OOB_AUTO with OneNAND.
Note that MTD_OOB_RAW is still not supported.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-02-01 09:28:18 +09:00
Kyungmin Park 9bfbc9b24f [MTD] OneNAND: Remove unused fields
- Remove unused fields
- Fix typo

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-31 14:25:21 +09:00
Adrian Hunter 8b29c0b6eb [MTD] OneNAND: Amend write-verify to compare to original buffer
When write-verify is enabled (CONFIG_MTD_ONENAND_VERIFY_WRITE),
the data written is read back and compared.  The comparison
was being made between dataRAM buffers, but this does not
verify that the data made it to the dataRAM correctly in
the first place.  This patch amends write-verify to
compare back to the original buffer.  It also now verifies
sub-page writes.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-25 14:06:33 +09:00
Adrian Hunter ec255e3406 [MTD] OneNAND: Check first or second pages for bad block information
OneNAND records bad block information in the out-of-band area of either the first or second page of a block.  Due to a logic error, only the first page was being checked.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-22 21:30:31 +09:00
Adrian Hunter f00b0046d2 [MTD] OneNAND: Free the bad block table when the device is released
OneNAND does 2 memory allocations for bad block information.
Only one of them was being freed.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-22 21:27:56 +09:00
Kyungmin Park 75384b0d9c [MTD] OneNAND: Update copyrights and code cleanup
Update copyrights and code cleanup

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-18 11:10:57 +09:00
Kyungmin Park 738d61f537 [MTD] OneNAND: Reduce Double Density Package (DDP) operations
- DDP code clean-up
- Reduce block & bufferram operations in DDP

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-18 11:00:31 +09:00
Adrian Hunter 9d03280129 [MTD] OneNAND: Return an error if a read timeout occurs
If OneNAND is operating within specification, all operations should easily be
completed within the 20 millisecond timeout.
This patch faithlessly adds a check for the timeout and returns an error in
that case.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-18 10:59:44 +09:00
Kyungmin Park 10b7a2bd6b [MTD] OneNAND: Fix unlock all status error
We have to set ONENAND_REG_START_BLOCK_ADDRESS to avoid status error

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-18 10:59:16 +09:00
David Woodhouse 9cdf083f98 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2007-01-18 10:34:51 +11:00
Adrian Hunter 0fc2ccea4c [MTD] OneNAND: Handle DDP chip boundary during read-while-load
The read-while-load method of reading from OneNAND needs to allow
for the change of bufferRAM address at the boundary between the
two chips in a double density (DDP) device.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-10 15:05:22 +02:00
Kyungmin Park b3c9f8bfe7 [MTD] OneNAND: return ecc error code only when 2-bit ecc occurs
we don't need to return ecc error when 1-bit ecc.
We only return error code when 2-bit ecc error

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-10 15:04:28 +02:00
Adrian Hunter a8de85d557 [MTD] OneNAND: Implement read-while-load
Read-while-load enables higher performance read operations.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-10 14:58:42 +02:00
Kyungmin Park 2fd32d4af8 [MTD] OneNAND: fix onenand_wait bug in read ecc error
Even though there is ECC error. OneNAND driver updates the buffram as valid

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-10 14:40:16 +02:00
Artem Bityutskiy 61a7e1983e [MTD] OneNAND: release CPU in cycles
This patch teaches OneNAND to release processor in
read/write/erase cycles and let other processes proceed.
Also, remove buggi touch watchdog call which only hides
the problem instead of solving it.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-10 14:39:57 +02:00
Kyungmin Park 60d84f9739 [MTD] OneNAND: add subpage write support
OneNAND supports up to 4 writes at one NAND page. Add support of this feature.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-10 14:35:00 +02:00
Kyungmin Park f627248736 [MTD] OneNAND: fix onenand_wait bug
Fix onenand_wait error reporting

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2007-01-10 14:34:42 +02:00
David Brownell de4fa99266 [PATCH] SPI/MTD: mtd_dataflash oops prevention
Return a fault code if the Dataflash driver runs into a "no device present"
error when the MISO line has a pulldown (it currently expects a pullup), so
that rmmod won't oops.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-30 10:56:42 -08:00
David Brownell 17c65d6990 [PATCH] m25p80 build fixes (with MTD debug)
Fix build issues that show up with the m25p80 SPI flash driver when
building with MTD debug enabled.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-30 10:56:42 -08:00
Robert P. J. Day 5cbded585d [PATCH] getting rid of all casts of k[cmz]alloc() calls
Run this:

	#!/bin/sh
	for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
	  echo "De-casting $f..."
	  perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
	done

And then go through and reinstate those cases where code is casting pointers
to non-pointers.

And then drop a few hunks which conflicted with outstanding work.

Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Greg KH <greg@kroah.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Karsten Keil <kkeil@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Ian Kent <raven@themaw.net>
Cc: Steven French <sfrench@us.ibm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-13 09:05:58 -08:00
Robert P. J. Day cd86128088 [PATCH] Fix numerous kcalloc() calls, convert to kzalloc()
All kcalloc() calls of the form "kcalloc(1,...)" are converted to the
equivalent kzalloc() calls, and a few kcalloc() calls with the incorrect
ordering of the first two arguments are fixed.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Greg KH <greg@kroah.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-13 09:05:52 -08:00
Ralf Baechle 0bf3a9d82a [MTD] Nuke IVR leftovers
Support for the ITE8172 based boards was deleted a while ago so this is
dead code.

The Kconfig dependency on MIPS was wrong anyway, MIPS is a processor
architecture and nothing else; guesses on systems architecture are likely
to be wrong ...

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-11 16:30:26 +00:00
Kyungmin Park 66a1e421b9 [MTD] OneNAND: fix oob handling in recent oob patch
There are missing place in recent MTD oob patch

http://git.infradead.org/?p=mtd-2.6.git;a=commitdiff;h=7014568bad55c20b7ee4f439d78c9e875912d51f

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-11 10:46:20 +00:00
David Woodhouse 76ab40e465 [MTD] Fix ssfdc blksize typo
I will not commit even trivial and obvious one-line fixes without building.
I will not commit even trivial and obvious one-line fixes without building.
I will not commit even trivial and obvious one-line fixes without building.
I will not commit even trivial and obvious one-line fixes without building.
Only clever people can get away with that.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-11 09:43:38 +00:00
David Woodhouse db06e2a93f [MTD] Fix SSFDC build for variable blocksize.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-10 11:48:54 +00:00
Randy Dunlap dffbc42b5a [MTD] ESB2ROM uses PCI
ESB2ROM uses PCI interface functions.

With CONFIG_PCI=n:
drivers/mtd/maps/esb2rom.c: In function 'esb2rom_init_one':
drivers/mtd/maps/esb2rom.c:167: warning: implicit declaration of function 'pci_dev_get'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-10 11:43:21 +00:00
Vitaly Wool a2c2fe4b24 [MTD] of_device-based physmap driver
inlined below is the patch that adds physmap driver for of_device.
It's an MTD part of the two-part support for flash/ROM devices based
on Open Firmware descriptions. The arch part (currently only PowerPC
which is no surprise) was introduced to powerpc folks earlier and
recently the older version of the powerpc part has been included into
the powerpc.git tree
(see http://www.kernel.org/git/?p=linux/kernel/git/paulus/powerpc.git;a=commitdiff;h=28f9ec349ae47c91768b7bc5607db4442c818e11).

 drivers/mtd/maps/Kconfig      |    9 +
 drivers/mtd/maps/Makefile     |    1
 drivers/mtd/maps/physmap_of.c |  255 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 265 insertions(+)

Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: Sergey Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-08 13:32:34 +00:00
Rod Whitby f33665d931 [MTD] Support combined RedBoot FIS directory and configuration area
RedBoot supports storing the FIS directory and the RedBoot
configuration area in the same block of flash memory.  This is
not the most common RedBoot configuration, but it is used on
commercially available boards supported by the kernel.

A recent patch to mtd/redboot.c (http://lkml.org/lkml/2006/3/20/410)
which corrected the skipping of deleted table entries has exposed the
latent problem of the kernel redboot parser running off the end of the
FIS directory and interpreting the RedBoot configuration information
as table entries.

This patch terminates the table parsing when the first truly empty
entry is found (table entry deletion only clears the first byte of the
name, so two cleared bytes in a row indicates the end of the table),
thereby supporting the combined redboot FIS directory and RedBoot
configuration information flash layout scenario.

Signed-off-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-08 13:28:26 +00: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
Christoph Lameter e94b176609 [PATCH] slab: remove SLAB_KERNEL
SLAB_KERNEL is an alias of GFP_KERNEL.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:24 -08: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
Yoshinori Sato 0b47d65408 [MTD] redboot partition combined fis / config problem
Can't analyze FIS directory in CYGSEM_REDBOOT_FLASH_COMBINED_FIS_AND_CONFIG
really.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-12-01 10:01:50 +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
Haavard Skinnemoen 6c33cafc79 [MTD] bugfix: DataFlash is not bit writable
This patch fixes the
"jffs2_flash_writev(): Non-contiguous write to 00825300 with mtd_dataflash" bug.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-12-01 10:30:45 +02: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
Jan Engelhardt 03a67a46af Fix typos in doc and comments
Changes persistant -> persistent. www.dictionary.com does not know
persistant (with an A), but should it be one of those things you can
spell in more than one correct way, let me know.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:32:19 +01:00
Matt LaPlante 3cb2fccc5f Fix misc Kconfig typos
Fix various Kconfig typos.

Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:22:59 +01:00
David Woodhouse dd36f26735 [MTD] Use EXPORT_SYMBOL_GPL() for exported symbols.
While we're fixing up the newly-added symbol, change the neighbouring ones
too, for consistency and also to reflect the author's interpretation of
the GPL -- which is that _no_ non-GPL modules are permitted. The author
always intended his code to be released under the GPL, and believes that
any new interpretation of 'EXPORT_SYMBOL' as being any different from
'EXPORT_SYMBOL_GPL' is entirely invalid; the GPL requires that _all_
exports have the semantics of the new 'EXPORT_SYMBOL_GPL', which means the
extra four characters are entirely redundant.

But since those four extra characters trigger the check for illegal
modules in a way that just EXPORT_SYMBOL does not, it's useful to change
anyway. This action in no way indicates an admission that there is any
legal distinction between the two states, and in particular does not
indicate that the author believes that non-GPL modules may use symbols
exported with EXPORT_SYMBOL alone.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-29 16:33:03 +00:00
Artem Bityutskiy 9c74034f8f [MTD] return error code from get_mtd_device()
get_mtd_device() returns NULL in case of any failure. Teach it to return an
error code instead. Fix all users as well.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 17:06:38 +02:00
Artem Bityutskiy 9fe912cea3 [MTD] add get and put methods
This patch adds get_device() and put_device() methods to the MTD description
structure (struct mtd_info). These methods are called by MTD whenever the MTD
device is get or put. They are needed when the underlying driver is something
smarter then just flash chip driver, for example UBI.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 17:04:53 +02:00
Artem Bityutskiy 7799308f34 [MTD] add get_mtd_device_nm() function
This patch adds one more function to the MTD interface to make it possible to
open MTD devices by their names, not only numbers. This is very handy in many
situations. Also, MTD device number depend on load order and may vary, while
names are fixed.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 17:04:31 +02: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