aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips (follow)
AgeCommit message (Collapse)AuthorFilesLines
2006-11-28[PATCH] Fix Intel/Sharp command set erase suspend bugJoakim Tjernlund1-1/+1
When we sleep and wait for a suspended operation to be resumed, go back and check until it's ready -- don't just continue after the first time we're woken. This can cause file system corruption. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-03Fix several typos in drivers/Matt LaPlante1-1/+1
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-09-22[MTD] Unlock NOR flash automatically where necessaryHåvard Skinnemoen1-0/+1
Introduce the MTD_STUPID_LOCK flag which indicates that the flash chip is always locked after power-up, so all sectors need to be unlocked before it is usable. If this flag is set, and the chip provides an unlock() operation, mtd_add_device will unlock the whole MTD device if it's writeable. This means that non-writeable partitions will stay locked. Set MTD_STUPID_LOCK in fixup_use_atmel_lock() so that these chips will work as expected. Signed-off-by: Håvard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-16MTD: Fix bug in fixup_convert_atmel_priHåvard Skinnemoen1-1/+1
The memset() in fixup_convert_atmel_pri is supposed to zero out everything except the first 5 bytes in *extp, but it ends up zeroing out something way outside the struct instead. Fix this potentially dangerous code by casting the pointer to char * before doing arithmetic. Signed-off-by: Håvard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-08-16MTD: Add lock/unlock operations for Atmel AT49BV6416Haavard Skinnemoen1-0/+90
The AT49BV6416 is locked by default, so we really need to provide at least the unlock() operation for write and erase to work. This patch implements both ->lock() and ->unlock() and provides a fixup to install them when an AT49BV6416 chip is detected. These functions are probably valid on more Atmel chips, but I believe it's mostly obsolete ones. The AT49BV6416 is in fact obsolete, but it's used on all current AT32STK1000 development boards. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-08-16MTD: Convert Atmel PRI information to AMD formatHaavard Skinnemoen1-0/+21
Atmel flash chips don't have PRI information in the same format as AMD flash chips. This patch installs a fixup for all Atmel chips that converts the relevant PRI fields into AMD format. Only the fields that are actually used by the command set is actually converted. The rest are initialized to zero (which should be safe) Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-08-14[PATCH] MTD: Add Macronix MX29F040 to JEDECTakashi YOSHI1-0/+14
Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-07-15[MTD] Fixes of performance and stability issues in CFI driver.Alexey Korolev1-44/+43
Fix of performance and stability issues on Intel NOR chips. It fixes: 1. Very low write performance on Sibley (perf tests demonstrated write performance less than 100Kb/sec when it should be over 400Kb/sec). 2. Low erase performance. (perf tests on Sibleuy demonstrated erase performance 246Kb/sec when it should be over 300Kb/sec). 3. Error on JFFS2 tests with CPU loading application when MTD returns "block erase error: (status timeout)" To fix the issue it does the following: 1. Removes the timeout tuning from inval_cache_and_wait_for_operation. 2. Waiting conditions in inval_cache_and_wait_for_operation now is based on timer resolution If timeout is lower than timer resolution then we do in cycle "Checking the status" udelay(1); cond_resched(); If timeout is greater than timer resolution (probably erase operation) We do the following sleep for half of operation timeout and do in cycle the following "Checking the status" sleep for timer resolution Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Alexey Korolev <akorolev@infradead.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel4-4/+0
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-22[MTD] Initialize 'writesize'Artem B. Bityutskiy5-1/+6
Signed-off-by: Artem B. Bityutskiy <dedekind@infradead.org>
2006-06-14[MTD] Restore MTD_ROM and MTD_RAM typesDavid Woodhouse2-2/+2
Let's not attempt the abolition of mtd->type until/unless it's properly thought through. And certainly, let's not do it by halves. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-06-14[MTD] assume mtd->writesize is 1 for NOR flashesArtem B. Bityutskiy3-0/+3
Signed-off-by: Artem B. Bityitskiy
2006-05-30[MTD] replace MTD_RAM with MTD_GENERIC_TYPEJoern Engel1-1/+1
Ram devices get the extra capability of MTD_NO_ERASE - not requiring an explicit erase before writing to it. Currently only mtdblock uses this capability. Rest of the patch is a simple text replacement. Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
2006-05-30[MTD] replace MTD_ROM with MTD_GENERIC_TYPEJoern Engel1-4/+2
No mtd user should ever check for the device type. Instead, device features should be checked by the flags - if at all. As a first step towards type removal, change MTD_ROM into MTD_GENERIC_TYPE. Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
2006-05-22[MTD] Introduce MTD_BIT_WRITEABLEJoern Engel2-3/+2
o Add a flag MTD_BIT_WRITEABLE for devices that allow single bits to be cleared. o Replace MTD_PROGRAM_REGIONS with a cleared MTD_BIT_WRITEABLE flag for STMicro and Intel Sibley flashes with internal ECC. Those flashes disallow clearing of single bits, unlike regular NOR flashes, so the new flag models their behaviour better. o Remove MTD_ECC. After the STMicro/Sibley merge, this flag is only set and never checked. Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
2006-05-22[MTD] Merge STMicro NOR_ECC code with Intel Sibley codeJoern Engel1-2/+2
In 2002, STMicro started producing NOR flashes with internal ECC protection for small blocks (8 or 16 bytes). Support for those flashes was added by me. In 2005, Intel Sibley flashes copied this strategy and Nico added support for those. Merge the code for both. Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
2006-05-22[MTD] Introduce writesizeJoern Engel1-2/+2
At least two flashes exists that have the concept of a minimum write unit, similar to NAND pages, but no other NAND characteristics. Therefore, rename the minimum write unit to "writesize" for all flashes, including NAND. Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
2006-05-21[MTD] Account for MODULE_SYMBOL_PREFIX when requesting NOR chip driverDavid Woodhouse1-3/+3
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-20[MTD] Use __symbol_get() instead of symbol_get() in NOR chip probeDavid Woodhouse1-2/+2
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-17[MTD] Fix printk format error in gen_probe.cDavid Woodhouse1-1/+1
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-17cfi_cmdset_0001: factorize code to wait for flash statusNicolas Pitre1-264/+157
This allows for much better abstraction and separation of the XIP and non-XIP cases with their own specific implementations. This fixes the case where a timeout was tripped on in the XIP case by the code that was meant for the non-XIP case only. This also makes for a nice code reduction. Signed-off-by: Nicolas Pitre <nico@cam.org> CC: "Alexey, Korolev" <alexey.korolev@intel.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-17cfi-cmdset-0001: always update the chip statusNicolas Pitre1-1/+3
... otherwise xip_enable() won't do the right thing. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-17CHIPS: Fix potential starvation in cfi_cmdset_0001Josh Boyer1-0/+5
The patch below fixes a potential starvation issue that can arise when there is contention on a chip during a period when a process is currently writing to it. The starvation is avoided by conditionally rescheduling when the chip is left in a state usable by other processes. Signed-off-by: Josh Boyer <jdub@us.ibm.com> Signed-off-by: Tom Gall <tom_gall@vnet.ibm.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-14[MTD] Fix legacy character sets throughout drivers/mtd, include/linux/mtdDavid Woodhouse2-5/+5
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-14[MTD] Deal correctly with NOR chips which are smaller than the map windowDavid Woodhouse1-2/+14
We used to calculate the number of chips to be zero, allocate an array of that size, then nasty things would happen when we attempt to access the first object in that zero-sized array. Now, if the number of _full_ chips that would fit into the map is zero, we allocate an array of one anyway, and then artificially reduce the total size of the resulting MTD device to fit in the map. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-08Export cfi_cmdset_0020 and cfi_cmdset_0002 with EXPORT_SYMBOL_GPLDavid Woodhouse2-1/+2
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-08Remove use of inter_module_crap in NOR flash chip drivers.David Woodhouse7-93/+20
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-04-17Remove unchecked MTD flagsJörn Engel1-1/+1
Several flags are set by some devices, but never checked. Remove them. Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-04-01MTD: remove obsolete Kconfig optionsAnders Larsen1-21/+0
Remove the obsolete Kconfig options MTD_CFI_AMDSTD_RETRY and MTD_CFI_AMDSTD_RETRY_MAX The code that depended on these was removed in early 2004, but Kconfig was not updated accordingly. Signed-off-by: Anders Larsen <al@alarsen.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-31[PATCH] Add chip used in collie to jedec_probePavel Machek1-0/+17
This adds flash chip used in Sharp Zaurus sl5500 (collie) to jedec_probe. Values work for read-only access, but I have not figured out how to do read-write. Signed-off-by: Pavel Machek <pavel@suse.cz> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Thomas Gleixner <tglx@linutronix.de> Acked-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31[PATCH] drivers/mtd: Use ARRAY_SIZE macroTobias Klauser2-3/+3
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of the macro. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Cc: Thomas Gleixner <tglx@linutronix.de> Acked-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31[PATCH] drivers/mtd/: small cleanupsAdrian Bunk1-4/+3
- chips/sharp.c: make two needlessly global functions static - move some declarations to a header file where they belong to Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-26Kconfig help: MTD_JEDECPROBE already supports IntelAdrian Bunk1-3/+2
Intel chips are already supported. Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: David Woodhouse <dwmw2@infradead.org>
2006-02-24[PATCH] cfi: init wait queue in chip structSimon Vogl1-0/+1
Fix a kernel oops for Intel P30 flashes, where the wait queue head was not initialized for the flchip struct, which in turn caused a crash at the first read operation. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-20[PATCH] cfi_cmdset_0001: fix range for cache invalidationAlexey Korolev1-7/+7
I found an issue in cfi_cmdset0001.c. It is related to cache region invalidation in the buffered write procedure. The code performs cache invalidation from "cmd_addr" to "cmd_adr + len" in do_write_buffer() while we modify region from "adr" to "adr+len". This issue affects writes + reads of data by small chunks. Signed-off-by: Nicolas Pitre <nico@cam.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-08[PATCH] arm: fix dependencies for MTD_XIPAl Viro1-1/+1
MTD_XIP depends on having working asm/mtd-xip.h; it's not just per-architecture (arm-only, as current Kconfig would have it), but actually per-subarch as well. Introduced a new symbol (ARCH_MTD_XIP) set by arch Kconfig; MTD_XIP depends on it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-01-16[PATCH] build kernel/intermodule.c only when requiredAdrian Bunk1-0/+1
Build kernel/intermodule.c only when required. Signed-off-by: Adrian Bunk <bunk@stusta.de> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-16[PATCH] no longer mark MTD_OBSOLETE_CHIPS as BROKENAdrian Bunk1-3/+3
This patch removes the wrong dependency of MTD_OBSOLETE_CHIPS on BROKEN and marks the non-compiling MTD_AMDSTD and MTD_JEDEC drivers as BROKEN. Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-29[MTD] Make functions static, include header files with prototypesAdrian Bunk1-2/+2
This patch contains the following possible cleanups: - every file should #include the headers containing the prototypes for it's global functions - make needlessly global functions static Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29[MTD] chips: make sharps driver usable againRichard Purdie1-57/+66
Update the pre-CFI Sharp driver sharps.c so it compiles. map_read32 / map_write32 no longer exist in the kernel so the driver is totally broken as it stands. The replacement functions use different parameters resulting in the other changes. Change collie to use this driver until someone works out why the cfi driver fails on that machine. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Tested-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29[MTD] cfi_cmdset_0001: relax locking rules for multi hardware partition supportNicolas Pitre1-6/+4
Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29[MTD] CFI: Use 16-bit access to autoselect/read device id dataTodd Poynor1-3/+3
Recent models of Intel/Sharp and Spansion CFI flash now have significant bits in the upper byte of device ID codes, read via what Spansion calls "autoselect" and Intel calls "read device identifier". Currently these values are truncated to the low 8 bits in the mtd data structures, as all CFI read query info has previously been read one byte at a time. Add a new method for reading 16-bit info, currently just manufacturer and device codes; datasheets hint at future uses for upper bytes in other fields. Signed-off-by: Todd Poynor <tpoynor@mvista.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-09[PATCH] changing CONFIG_LOCALVERSION rebuilds too much, for no good reasonOlaf Hering1-1/+0
This patch removes almost all inclusions of linux/version.h. The 3 #defines are unused in most of the touched files. A few drivers use the simple KERNEL_VERSION(a,b,c) macro, which is unfortunatly in linux/version.h. There are also lots of #ifdef for long obsolete kernels, this was not touched. In a few places, the linux/version.h include was move to where the LINUX_VERSION_CODE was used. quilt vi `find * -type f -name "*.[ch]"|xargs grep -El '(UTS_RELEASE|LINUX_VERSION_CODE|KERNEL_VERSION|linux/version.h)'|grep -Ev '(/(boot|coda|drm)/|~$)'` search pattern: /UTS_RELEASE\|LINUX_VERSION_CODE\|KERNEL_VERSION\|linux\/\(utsname\|version\).h Signed-off-by: Olaf Hering <olh@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07Merge master.kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6Linus Torvalds15-639/+743
Some manual fixups for clashing kfree() cleanups etc.
2005-11-07[PATCH] kfree cleanup: drivers/mtdJesper Juhl2-4/+3
This is the drivers/mtd part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in drivers/mtd/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Acked-by: Joern Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07[MTD] chips: Clean up trailing white spacesThomas Gleixner1-1/+1
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07[MTD] chips: Clean up trailing white spacesThomas Gleixner15-493/+493
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07[MTD] chips cfi_cmdset_0002: Prevent timeout raceKonstantin Baidarov1-9/+9
We've noticed that sometimes "MTD do_write_buffer(): software timeout" message was printed out when writing to a Fujitsu NOR flash. It turned out that this was because of a race in the timeout handling do_write_buffer(). A small timeout of (HZ / 1000) + 1 is used there, and sometimes if the timer interrupt handling takes more than one or even two jiffies (which is 1-2 ms with HZ == 1000) and that interrupt happens just after chip_ready() call, the driver bails out from a ready polling loop despite the chip has actually become ready while all those interrupts were handled. To deal with this issue, extra check for chip ready is neccessary on timeout expiration (and the checks should better be reordered). As do_write_oneword() uses the same approach, it needs to also be changed. Signed-off-by: Konstantin Baidarov <kbaidarov@ru.mvista.com> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06[MTD] chips/cfi_cmdset_0001: fix for P30 cfi parsingNicolas Pitre1-3/+6
Change to the extended cfi table parsing for Intel NOR flash that uses the info in the extended table to 'walk' the table rather than using hard coding for various primary extended query table version numbers. From: Jared Hulbert <jaredeh@gmail.com> Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06[MTD] writev support for cfi-cmdset-0001Nicolas Pitre1-50/+75
While this might be useful for all supported flash types, it is mandatory for proper JFFS2 support with Sibley flash. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>