summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips/cfi_cmdset_0001.c
Commit message (Collapse)AuthorAgeFilesLines
* mtd: do not duplicate length and offset checks in driversArtem Bityutskiy2012-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We already verify that offset and length are within the MTD device size in the MTD API functions. Let's remove the duplicated checks in drivers. This patch only affects the following API's: 'mtd_erase()' 'mtd_point()' 'mtd_unpoint()' 'mtd_get_unmapped_area()' 'mtd_read()' 'mtd_write()' 'mtd_panic_write()' 'mtd_lock()' 'mtd_unlock()' 'mtd_is_locked()' 'mtd_block_isbad()' 'mtd_block_markbad()' This patch adds a bit of noise by removing too sparse empty lines, but this is not too bad. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: return error code from mtd_unpointArtem Bityutskiy2012-03-271-6/+10
| | | | | | | | | | | | | The 'mtd_unpoint()' API function should be able to return an error code because it may fail if you specify incorrect offset. This patch changes this MTD API function and amends all the drivers correspondingly. Also return '-EOPNOTSUPP' from 'mtd_unpoint()' when the '->unpoint()' method is undefined. We do not really need this currently, but this just makes sense to be consistent with 'mtd_point()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: add leading underscore to all mtd functionsArtem Bityutskiy2012-03-271-20/+20
| | | | | | | | | | | | | | | | | | | | | This patch renames all MTD functions by adding a "_" prefix: mtd->erase -> mtd->_erase mtd->read_oob -> mtd->_read_oob ... The reason is that we are re-working the MTD API and from now on it is an error to use MTD function pointers directly - we have a corresponding API call for every pointer. By adding a leading "_" we achieve the following: 1. Make sure we convert every direct pointer users 2. A leading "_" suggests that this interface is internal and it becomes less likely that people will use them directly 3. Make sure all the out-of-tree modules stop compiling and the owners spot the big API change and amend them. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: remove duplicate assignment of chip->stateTadashi Abe2011-05-251-1/+0
| | | | | | | | | This is a trivial patch which removes unnecessary assignment of chip->state in put_chip(). It's duplicated. Signed-off-by: Tadashi Abe <tabe@mvista.com> Acked-by: Joakim Tjernlund <joakim.tjernlund@transmode.se> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: fix hang-up in cfi erase and read contentionTadashi Abe2011-05-251-6/+3
| | | | | | | | | | | | | | cfi erase command hangs up when erase and read contention occurs. If read runs at the same address as erase operation, read issues Erase-Suspend via get_chip() and the erase goes into sleep in wait queue. But in this case, read operation exits by time-out without waking it up. I think the other variants (0001, 0020 and lpddr) have the same problem too. Tested and verified the patch only on CFI-0002 flash, though. Signed-off-by: Tadashi Abe <tabe@mvista.com> Acked-by: Joakim Tjernlund <joakim.tjernlund@transmode.se> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* Fix common misspellingsLucas De Marchi2011-03-311-2/+2
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* mtd: cfi: fix writebufsize initializationAnatolij Gustschin2011-03-111-1/+1
| | | | | | | | | | | | When initializing mtd->writebufsize, we must take into account possible flash chip interleaving. Wrong writebufsize initialization caused UBIFS recovery issues resulting in unmountable UBIFS file system on NOR flash partitions. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Guillaume LECERF <glecerf@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: fix race in cfi_cmdset_0001 driverJoakim Tjernlund2011-03-111-21/+22
| | | | | | | | | | | | | | As inval_cache_and_wait_for_operation() drop and reclaim the lock to invalidate the cache, some other thread may suspend the operation before reaching the for(;;) loop. Therefore the loop must start with checking the chip->state before reading status from the chip. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Acked-by: Michael Cashwell <mboards@prograde.net> Acked-by: Stefan Bigler <stefan.bigler@keymile.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Cc: stable@kernel.org
* mtd: cfi: add writebufsize initializationAnatolij Gustschin2011-01-061-0/+1
| | | | | | | | | Initialize mtd->writebufsize to the value obtained by CFI query command at probe time. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: cfi_fixup: remove unused 'param' parameterGuillaume LECERF2010-12-031-27/+27
| | | | | | | | | The 'param' parameter has never been used since its introduction, so simply remove it. Signed-off-by: Guillaume LECERF <glecerf@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: cfi_cmdset_0001: use defined value of P_ID_INTEL_PERFORMANCE instead of ↵Guillaume LECERF2010-10-261-2/+2
| | | | | | | hardcoded one Signed-off-by: Guillaume LECERF <glecerf@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: Remove obsolete <mtd/compatmac.h> includeDavid Woodhouse2010-08-081-1/+0
| | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: change struct flchip_shared spinlock locking into mutexStefani Seibold2010-08-061-10/+10
| | | | | | | | | | | | This patch prevent to schedule while atomic by changing the flchip_shared spinlock into a mutex. This should be save since no atomic path will use this lock. It was suggested by Arnd Bergmann and Vasiliy Kulikov. Signed-off-by: Stefani Seibold <stefani@seibold.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: add an ioctl to query the lock status of a flash sectorRichard Cochran2010-08-021-0/+10
| | | | | | | | | | This patchs adds a way for user space programs to find out whether a flash sector is locked. An optional driver method in the mtd_info struct provides the information. Signed-off-by: Richard Cochran <richard.cochran@omicron.at> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: fix a huge latency problem in the MTD CFI and LPDDR flash drivers.Stefani Seibold2010-05-101-66/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of a memcpy() during a spinlock operation will cause very long thread context switch delays if the flash chip bandwidth is low and the data to be copied large, because a spinlock will disable preemption. For example: A flash with 6,5 MB/s bandwidth will cause under ubifs, which request sometimes 128 KiB (the flash erase size), a preemption delay of 20 milliseconds. High priority threads will not be served during this time, regardless whether this threads access the flash or not. This behavior breaks real time. The patch changes all the use of spin_lock operations for xxxx->mutex into mutex operations, which is exact what the name says and means. I have checked the code of the drivers and there is no use of atomic pathes like interrupt or timers. The mtdoops facility will also not be used by this drivers. So it is dave to replace the spin_lock against mutex. There is no performance regression since the mutex is normally not acquired. Changelog: 06.03.2010 First release 26.03.2010 Fix mutex[1] issue and tested it for compile failure Signed-off-by: Stefani Seibold <stefani@seibold.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: cfi: remove unneeded NULL checksJiri Slaby2010-02-251-4/+2
| | | | | | | | | In cfi_intelext_setup and cfi_amdstd_setup, mtd is never NULL. Remove unnecessary checks. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: move manufacturer to the common cfi.h header fileHans-Christian Egtvedt2009-11-301-10/+10
| | | | | | | | | | | | | | This patch moves the MANUFACTURER_ST and MANUFACTURER_INTEL to the include/linux/mtd/cfi.h header file and renames them to CFI_MFR_ST and CFI_MFR_INTEL. CFI_MFR_ST was already present there. All references in drivers/mtd/chips/cfi_cmdset_0001.c are updated to reflect this. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Acked-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: add lock fixup for AT49BV640D and AT49BV640DT chipsHans-Christian Egtvedt2009-11-301-0/+14
| | | | | | | | | | | | | | | | This patch sets the MTD_POWERUP_LOCK flag for AT49BV640D and AT49BV640DT devices, since the devices are locked when powered up and needs to be unlocked before interfaced. Quote datasheet; "At power-up and reset, all sectors have their Softlock protection mode enabled.". Tested on AVR32 hardware platform with an AT49BV640D flash device. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Acked-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: add missing put_chip() in cfi_intelext_reset()Nicolas Pitre2009-11-301-0/+1
| | | | | | Signed-off-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* Nicolas Pitre has a new email addressNicolas Pitre2009-09-151-1/+1
| | | | | | | | Due to problems at cam.org, my nico@cam.org email address is no longer valid. FRom now on, nico@fluxnic.net should be used instead. Signed-off-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* mtd: CFI 1.0 and CFI 1.1Daniel Ribeiro2009-06-051-4/+10
| | | | | | | | | | | | | | | This patch allows otpinfo for CFI >= 1.0 and burst read for CFI >= 1.1. references: 1.0: http://www.datasheetcatalog.org/datasheets2/81/816884_1.pdf 1.1: http://milkymist.org/doc/MT28F640J3.pdf http://www.delorie.com/agenda/specs/29066709.pdf Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: CFI: quirk for PF38F4476.Daniel Ribeiro2009-06-051-0/+12
| | | | | | | | | | | | This chip reports CFI 1.3, but the CFI PRI is like CFI 1.1. Add a quirk to pass probe on this chip. This patch depends on "MTD: CFI 1.0 and CFI 1.1" Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* [MTD] [CHIPS] cfi_cmdset_0001.c: Fix a bug in ↵Graff Yang2009-03-201-2/+6
| | | | | | | | | | | inval_cache_and_wait_for_operation(). If the inval_cache_and_wait_for_operation() is re-entered by write operation when erase operation is in progress, the chip->erase_suspended will be cleared, this cause the erase timeo is not reset and will result time out error for erase. Signed-off-by: Graff Yang <graff.yang@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* [MTD] update internal API to support 64-bit device sizeAdrian Hunter2008-12-101-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | MTD internal API presently uses 32-bit values to represent device size. This patch updates them to 64-bits but leaves the external API unchanged. Extending the external API is a separate issue for several reasons. First, no one needs it at the moment. Secondly, whether the implementation is done with IOCTLs, sysfs or both is still debated. Thirdly external API changes require the internal API to be accepted first. Note that although the MTD API will be able to support 64-bit device sizes, existing drivers do not and are not required to do so, although NAND base has been updated. In general, changing from 32-bit to 64-bit values cause little or no changes to the majority of the code with the following exceptions: - printk message formats - division and modulus of 64-bit values - NAND base support - 32-bit local variables used by mtdpart and mtdconcat - naughtily assuming one structure maps to another in MEMERASE ioctl Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* [MTD] [NOR] fix cfi_cmdset_0001 FL_SYNCING race (take 2)Alexander Belyakov2008-09-261-2/+15
| | | | | | | | | | | | The patch fixes CFI issue with multipartitional devices leading to the set of errors or even deadlock. The problem is CFI FL_SYNCING state race with flash operations (e.g. erase suspend). It is reproduced by running intensive writes on one JFFS2 partition and simultaneously performing mount/unmount cycle on another partition of the same chip. Signed-off-by: Alexander Belyakov <abelyako@googlemail.com> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* [MTD] [NOR] cfi_cmdset_0001: Timeouts for erase, write and unlock operationsAnders Grafström2008-08-061-14/+38
| | | | | | | | | | | | | | | | | | Timeouts are currently given by the typical operation time times 8. It works in the general well-behaved case but not when an erase block is failing. For erase operations, it seems that a failing erase block will keep the device state machine in erasing state until the vendor specified maximum timeout period has passed. By this time the driver would have long since timed out, left erasing state and attempted further operations which all fail. This patch implements timeouts using values from the CFI Query structure when available. The patch also sets a longer timeout for locking operations. The current value used for locking/unlocking given by 1000000/HZ microseconds is too short for devices like J3 and J5 Strataflash which have a typical clear lock-bits time of 0.5 seconds. Signed-off-by: Anders Grafström <grfstrm@users.sourceforge.net> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* [MTD] Use DIV_ROUND_UPJulia Lawall2008-08-021-1/+1
| | | | | | | | The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* [MTD] [NOR] Fix -ETIMEO errors in CFI driverAlexey Korolev2008-07-251-1/+8
| | | | | | | | | | | | | | | | | | | | | Existing CFI driver has problems with excessive writes during erase. If CFI driver does many writes during one erase cycle we may face the messages with -ETIMEO error on erase operation. It may cause the following data corruption and kernel panics. The reason of the issue is related to specifics of suspend operation: if we write to flash during erase, suspend operation will cost some time to erase procedure (for P30 it could be significant). In current version of cfi driver the problem of many suspends is partially workarounded by adding some time reserv to any operation (8xerase_time) but if we have many writes during one erase the problem appears. This patch detects the suspend and resets timer if suspend occured. It has been well verified on different chips. No problems were found. Could you please include the patch as it is simple and fixes bad issue. Signed-off-by: Alexey Korolev <akorolev@infradead.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* MTD/JFFS2: remove CVS keywordsAdrian Bunk2008-06-041-2/+0
| | | | | | | | | | | | Once upon a time, the MTD repository was using CVS. This patch therefore removes all usages of the no longer updated CVS keywords from the MTD code. This also includes code that printed them to the user. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NOR] Support for M50FLW080A and M50FLW080BNate Case2008-05-141-0/+4
| | | | | | | | | Add support for M50FLW080A and M50FLW080B revisions of LPC flash devices. Signed-off-by: Aaron Lindner <alindner@xes-inc.com> Signed-off-by: Nate Case <ncase@xes-inc.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NOR] Remove cfi_cmdset_0001.c erase suspend fixup typoAlexander Belyakov2008-05-061-1/+1
| | | | | | | | | | | Fix typo in erase suspend while write fixup code leading to compile time error if CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE was defined. drivers/mtd/chips/cfi_cmdset_0001.c: In function 'fixup_intel_strataflash': drivers/mtd/chips/cfi_cmdset_0001.c:212: error: 'struct cfi_pri_amdstd' has no member named 'SuspendCmdSupport' Signed-off-by: Alexander Belyakov <abelyako@googlemail.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD][NOR] Add physical address to point() methodJared Hulbert2008-05-011-6/+8
| | | | | | | | | | | | Adding the ability to get a physical address from point() in addition to virtual address. This physical address is required for XIP of userspace code from flash. Signed-off-by: Jared Hulbert <jaredeh@gmail.com> Reviewed-by: Jörn Engel <joern@logfs.org> Acked-by: Nicolas Pitre <nico@cam.org> Acked-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NOR] Fix Intel CFI driver for collie flashThomas Kunze2008-04-231-0/+3
| | | | | | | | | | | collie seems to contain LH28F640BF flash chips. According to http://sharp-world.com/products/device/flash/pdf/*FUM00701*@E.pdf (page 83) if they have 0x51 of Extended Query Table (number of hardware partitions) set to zero, they have a single fixed partition. This patch makes those chips work. Signed-off-by: Thomas Kunze <thommycheck@gmx.de> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] XIP: Use generic xip_iprefetch() instead of asm volatile (...)Paulius Zaleckas2008-04-221-2/+2
| | | | | | | | | Untested, but shouldn't break anything... Makes MTD_XIP arch independent. I guess this is why xip_iprefetch() was made for. Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-221-6/+6
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* mtd: fix broken state in CFI driver caused by FL_SHUTDOWNAlexey Korolev2008-04-041-5/+5
| | | | | | | | | | | | | | | | | | | THe CFI driver in 2.6.24 kernel is broken. Not so intensive read/write operations cause incomplete writes which lead to kernel panics in JFFS2. We investigated the issue - it is caused by bug in FL_SHUTDOWN parsing code. Sometimes chip returns -EIO as if it is in FL_SHUTDOWN state when it should wait in FL_PONT (error in order of conditions). The following patch fixes the bug in state parsing code of CFI. Also I've added comments to notify developers if they want to add new case in future. Signed-off-by: Alexey Korolev <akorolev@infradead.org> Reviewed-by: Joern Engel <joern@logfs.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitDavid Woodhouse2008-02-031-2/+5
|\
| * cache invalidation error for buffered writeMassimo Cirillo2008-01-111-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug causes corruptions of data read from flash. The original code performs cache invalidation from "adr" to "adr + len" in do_write_buffer(). Since len and adr could be updated in the code before invalidation - it causes improper setting of cache invalidation regions. Signed-off-by: Massimo Cirillo <maxcir@gmail.com> Signed-off-by: Giuseppe D'Eliseo <giuseppedeliseo@gmail.com> Acked-by: Nicolas Pitre <nico@cam.org> Acked-by: Jörn Engel <joern@logfs.org> Signed-off-by: David Woohouse <dwmw2@infradead.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | [MTD] Unlocking all Intel flash that is locked on power up.Justin Treon2008-02-031-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch for unlocking all Intel flash that has instant locking on power up. The patch has been tested on Intel M18, P30 and J3D Strata Flash. 1. The automatic unlocking can be disabled for a particular partition in the map or the command line. a. For the bit mask in the map it should look like: .mask_flags = MTD_POWERUP_LOCK, b. For the command line parsing it should look like: mtdparts=0x80000(bootloader)lk 2. This will only unlock parts with instant individual block locking. Intel parts with legacy unlocking will not be unlocked. Signed-off-by: Justin Treon <justin_treon@yahoo.com> Signed-off-by: Jared Hulbert <jaredeh@gmail.com> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* | [MTD] [NOR] Prevent erase command invocation on suspended chipAlexander Belyakov2007-11-261-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | while running stress tests we have met cfi_cmdset_0001.c driver issue. Working on multipartitional devices with erase suspend on write feature enabled it is possible to get erase operation invoked on chip with suspended erase. get_chip() looses information about earlier suspended erase and new erase operation gets issued. New erase operations report successful completion, but blocks remain dirty causing, for example, JFFS2 error messages like: ... Newly-erased block contained word 0x20031985 at offset 0x00200000 Newly-erased block contained word 0x20031985 at offset 0x00280000 Newly-erased block contained word 0x20031985 at offset 0x00240000 ... The patch below fixes that issue. Signed-off-by: Alexander Belyakov <alexander.belyakov@intel.com> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* | [MTD] [NOR] Support Intel P3x flash support with CFI version 1.5Alexey Korolev2007-11-231-1/+1
| | | | | | | | | | Signed-off-by: Alexey Korolev <akorolev@infradead.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* | [MTD] [NOR] More CFI fixups for Atmel chipsHans-Christian Egtvedt2007-10-301-0/+43
|/ | | | | | | | | | | | Convert CFI tables from Atmel cmdset_0001 chips to Intel format and set BufWrite timeouts to 0 for Atmel cmdset_0001 and cmdset_0002 chips. Some chips may indicate support for buffered writes even though they only support dual-word writes. The CFI fixup must run before fixup_use_write_buffers for this to work. Signed-off-by: Håvard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NOR] Fix deadlock in Intel chip driver caused by get_chip recursionAlexey Korolev2007-10-231-69/+77
| | | | | | | | | | This patch solves kernel deadlock issue seen on JFFF2 simultaneous operations. Detailed investigation of the issue showed that the kernel deadlock is caused by tons of recursive get_chip calls. Signed-off-by: Alexey Korolev <akorolev@infradead.org> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NOR] fix ctrl-alt-del can't reboot for intel flash bugKevin Hao2007-10-131-3/+6
| | | | | | | | | | | | When we press ctrl-alt-del,kernel_restart_prepare will invoke cfi_intelext_reboot which will set flash to read array mode, but later when device_shutdown is invoked which may put current work queue to sleep and other process may be scheduled to running and programming flash in not FL_READY mode again. So we can't boot up if this flash is used for bootloader. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] fix CFI point method for discontiguous mapsAndy Lowe2007-09-231-4/+11
| | | | | | | | | | | | | | The CFI probe routine is capable of detecting flash banks consisting of identical chips mapped to physically discontiguous addresses. (One common way this can occur is if a flash bank is populated with chips of less capacity than the hardware was designed to support.) The CFI point() routine currently ignores any such gaps. This patch fixes the CFI point() routine so that it truncates any request that would span a gap. Signed-off-by: Andy Lowe <alowe@mvista.com> Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [CHIPS] fix tiny spelling error in comment in cfi_cmdset_0001.cJesper Juhl2007-07-041-1/+1
| | | | | | | | Trivial fix of a spelling error in a comment in cfi_cmdset_0001.c s/ships/chips/ Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NOR] Use NULL instead of 0 for pointer to shut sparse up.Randy Dunlap2007-06-281-4/+4
| | | | | | | | | | | Use NULL instead of 0 for pointer: drivers/mtd/chips/cfi_cmdset_0001.c:2258:43: warning: Using plain integer as NULL pointer Other changes by inspection. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NOR] cfi_cmdset_0001.c: sparse fixesBen Dooks2007-06-281-2/+2
| | | | | | | | | | Fix sparse warnings generated from cfi_cmdset_0001.c. drivers/mtd/chips/cfi_cmdset_0001.c:1783:5: warning: symbol 'cfi_intelext_erase_varsize' was not declared. Should it be static? drivers/mtd/chips/cfi_cmdset_0001.c:2258:43: warning: Using plain integer as NULL pointer Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NOR] Support for auto locking flash on power upRodolfo Giometti2007-04-021-3/+90
| | | | | | | | Auto unlock sectors on resume for auto locking flash on power up. Signed-off-by: Rodolfo Giometti <giometti@enneenne.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NOR] Intel: remove ugly PROGREGION macrosArtem Bityutskiy2007-02-091-4/+2
| | | | | | | | | | | | Remove ugly and weird MTD_PROGREGION_CTRLMODE_VALID() and MTD_PROGREGION_CTRLMODE_INVALID() macros. There is only one user of them and they are used locally just for printing. Anyway, this patch is a preparation for removing mtd->ecctype and mtd->eccsize, but these macros use them. Fix this. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>