aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-03-06Merge git://git.infradead.org/ubi-2.6Linus Torvalds5-87/+198
* git://git.infradead.org/ubi-2.6: UBI: add write checking UBI: simplify debugging return codes UBI: fix attaching error path UBI: support attaching by MTD character device name UBI: mark few variables as __initdata
2010-03-02Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel-stableRussell King1-1/+1
Conflicts: arch/arm/Makefile
2010-03-01Merge with mainline to remove plat-omap/Kconfig conflictTony Lindgren6-196/+54
Conflicts: arch/arm/plat-omap/Kconfig
2010-03-01MTD: fix pismo build errorRussell King1-1/+1
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-02-27MIPS: Alchemy: physmap-flash for all devboardsManuel Lauss3-173/+0
Replace the devboard NOR MTD mapping driver with physmap-flash support. Also honor the "swapboot" switch settings wrt. to the layout of the NOR partitions. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Cc: Linux-MIPS <linux-mips@linux-mips.org> Acked-By: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-27MIPS: Alchemy: devboard register abstractionManuel Lauss1-1/+3
All Alchemy development boards have external CPLDs with a few registers in them. They all share an identical register layout with only a few minor differences (except the PB1000) in bit functions and base addresses. This patch - adds a primitive facility to initialize and use these external registers, - replaces all occurrences of bcsr->xxx accesses with calls to the new functions (the pb1200 cascade irq handling code is special). - collects BCSR register information scattered throughout the board headers in a central place. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-02-26mtd: r852 fix pci IDMaxim Levitsky1-1/+1
The PCI_DEVICE_ID_RICOH_R5C852 was missed in the edited commit, and on second thought I just open code it. This fixes compile error. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: Few follow up cleanups for Smartmedia/xD supportMaxim Levitsky4-12/+18
* Test results of few functions that were declared with __must_check * Fix bogus gcc warning about uinitialized variable 'ret' * Remove unused variable from mtdblock_remove_dev * Don't use deprecated DMA_32BIT_MASK Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand: Add driver for Ricoh xD/SmartMedia readerMaxim Levitsky4-0/+1292
This adds a driver for Ricoh R5C852 xD card reader. This reader is a part of larger mulifunction chip and found at least in R5C832 Driver is complete, but bewere of the fact that some (probably only type M) xD cards are 'fake' which means that they have an on board CPU and expose emulated nand command set These cards don't even store the oob area on the flash, but generate it on the fly from something else. Thus they demand to have proper values written in the oob area, and therefore only useful with SmartMedia FTL. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: Add new SmartMedia/xD FTLMaxim Levitsky4-0/+1400
This implements new readwrite SmartMedia/xd FTL. mtd driver must have support proper ECC and badblock verification based on oob parts for 512 bytes nand. Also mtd driver must define read_oob and write_oob, which are used to read and write both data and oob together. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6David Woodhouse13-271/+373
The SmartMedia FTL code depends on new kfifo bits from 2.6.33
2010-02-26mtd: nand: Add SmartMedia device table to sm_common moduleDavid Woodhouse2-7/+38
(and remove the CONFIG_MTD_NAND_SMARTMEDIA option which isn't going to be used now that we're doing it this way) Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: Workaround wrong write protect status on some xD cardsMaxim Levitsky1-1/+7
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand: Allow caller to pass alternative ID table to nand_scan_ident()David Woodhouse12-25/+27
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: common module for smartmedia/xD supportMaxim Levitsky4-0/+178
This small module implements few helpers that are usefull for nand drivers for SmartMedia/xD card readers. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand: add ->badblockbits for minimum number of set bits in bad block byteMaxim Levitsky1-4/+9
This can be used to protect against bitflips in that field, but now mostly for smartmedia. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand: make reads using MTD_OOB_RAW affect only ECC validationMaxim Levitsky2-16/+29
This changes the behavier of MTD_OOB_RAW. It used to read both OOB and data to the data buffer, however you would still need to specify the dummy oob buffer. This is only used in one place, but makes it hard to read data+oob without ECC test, thus I removed that behavier, and fixed the user. Now MTD_OOB_RAW behaves just like MTD_OOB_PLACE, but doesn't do ECC validation Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand: cleanup the nand_do_write_opsMaxim Levitsky1-7/+17
nand_do_write_ops was broken in regard to writing several pages, each with its own oob. Although nand_do_write_ops intends to allow such mode, it fails do do so Probably this was never tested. Also add missing checks for attempts to write at illegal offsets. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand: make MTD_OOB_PLACE work correctly.Maxim Levitsky1-1/+5
MTD_OOB_PLACE is supposed to read/write the raw oob data similiar to the MTD_OOB_RAW however due to a bug, currently it is not possible to read more data that is specified by the oob 'free' regions. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand: make suspend work if device is accessed by kernel threads.Maxim Levitsky1-3/+0
Since all userspace threads are frozen at the time the nand_suspend is called, they aren't inside any nand function. We don't call try_to_freeze in nand ether. Thus the only user that can be inside the nand functions is an non freezeable kernel thread. Thus we can safely wait for it to finish. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: blktrans: allow FTL drivers to export sysfs attributesMaxim Levitsky1-0/+8
This patch adds an ability to export sysfs attributes below the block disk device. This can be used to pass the udev an information about the FTL and could include the vendor, serial, version, etc... Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: call the remove notifiers before assuming it is in useMaxim Levitsky1-8/+11
Now that mtd block common layer is prepared for proper hotplug support, enable it here Now all users of the mtd device have a chance to put the mtd device when they are notified to do so, and they have to do so to make hotplug work. [dwmw2: There's more work to be done to fix hotplug in the general case, but this is a reasonable start] Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: mtdblock: test return value of add_mtd_blktrans_dev, because if can failMaxim Levitsky2-2/+4
This prevents a memory leak Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: blktrans: Hotplug fixesMaxim Levitsky8-62/+148
* Add locking where it was missing. * Don't do a get_mtd_device in blktrans_open because it would lead to a deadlock; instead do that in add_mtd_blktrans_dev. * Only free the mtd_blktrans_dev structure when the last user exits. * Flush request queue on device removal. * Track users, and call tr->release in del_mtd_blktrans_dev Due to that ->open and release aren't called more that once. Now it is safe to call del_mtd_blktrans_dev while the device is still in use. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: blktrans: remove mtd_blkcore_priv, switch to per device queue and threadMaxim Levitsky1-66/+58
This is the biggest change. To make hotplug possible, and this layer clean, the mtd_blktrans_dev now contains everything for a single mtd block translation device. Also removed some very old leftovers. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: create unlocked versions of {get,put}_mtd_deviceMaxim Levitsky1-21/+39
Use these only if you know that you already hold mtd_table_mutex Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand: Add MPC5121 NAND Flash Controller driverAnatolij Gustschin3-0/+924
Adds NAND Flash Controller driver for MPC5121 Revision 2. All device features, except hardware ECC and power management, are supported. Signed-off-by: Piotr Ziecik <kosmo@semihalf.com> Signed-off-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand_bcm: fix hot spin and code duplicationRoel Kluin1-46/+25
In the branch where pagesize equalled NAND_DATA_ACCESS_SIZE, NumToRead wasn't decremented in the `while (numToRead > 11)' loop. Also the first and last while loops were duplicated in both branches. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Leo Chen <leochen@broadcom.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: omap2 fix prefetch mode read issueVimal Singh1-4/+7
There is a bug in nand prefetch read routine, which comes into effect only if nand device is a 16-bit device (as we have in zoom boards). This bug is effective only with below combination of conditions: 1. nand deivce, in use, is a 16 bit device 2. nand driver supports 'subpage' read 3. SW ECC is in use This was not seen old kernel (ex: .23), because when, in early days, we tested this (nand prefetch read in LDP boards) there was no 'subpage read' support. Later when we had subpage read in (.27) kernel, we had hw ecc enabled always in our internal tree. So, we missed this bug. This patch fixes the issue. Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: omap2: correct 'info' pointer in 'omap_nand_remove'Vimal Singh1-1/+2
Removing OMAP NAND driver, when loaded as a module, gives error and does not get success. This fixes this and makes driver loadable and removable run time. Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: omap2: fixing compilation warningVimal Singh1-1/+1
Fixing below warning in compilation: drivers/mtd/nand/omap2.c: In function 'omap_write_buf_dma_pref': drivers/mtd/nand/omap2.c:508: warning: passing argument 2 of 'omap_nand_dma_transfer' discards qualifiers from pointer target type Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: move more manufacturers to the common cfi.h header fileGuillaume LECERF1-9/+5
Move MANUFACTURER_MACRONIX and MANUFACTURER_SST definitions to the include/linux/mtd/cfi.h header file and rename them to CFI_MFR_MACRONIX and CFI_MFR_SST. All references in drivers/mtd/chips/cfi_cmdset_0002.c are updated to reflect this. Signed-off-by: Guillaume LECERF <glecerf@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: mxc_nand: add RESET command supportEric Benard1-0/+1
mxc_nand driver must support the RESET Command in order to support Micron NAND which need a reset before any other command. Signed-off-by: Eric Benard <eric@eukrea.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: inftl: misplaced parenthesis in find_boot_recordRoel Kluin1-3/+4
The parenthesis was misplaced, upon error a one was shown. [dwmw2: Fix the code not to do the assignment within the if() statement] Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: OneNAND: do not use DMA if oops in progressAaro Koskinen1-2/+2
Otherwise we may hang if we are called from panic() through mtdoops. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand: add lock/unlock routinesVimal Singh1-0/+164
Add nand lock / unlock routines. At least 'micron' parts support this. Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: nand: create a helper verification functionVimal Singh1-18/+30
... verification for 'nand_erase_nand' These checks are expected to be used by 'nand_lock' and 'nand_unlock' routines too. As all these three are block aligned operations. So, creating a helper function for this makes sense. Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: maps: ceiva: do not return random numbersArtem Bityutskiy1-1/+1
When machine_is_ceiva() returns zero, 'clps_setup_flash()' returns a value of an unitialized variable. Fix this. Spotted by David Binderman. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtdchar: Register the full range of minor numbersBen Hutchings1-2/+3
register_chrdev() registers minor numbers up to 255, but we can now potentially have much larger numbers. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: Raise limit on block device minor numbersBen Hutchings1-2/+5
add_mtd_blktrans_dev() imposes a maximum of 257 devices per block translator. This was presumably meant to prevent overflow back in the days of 8-bit minor numbers. Instead, check against MINORMASK and the limits of the partition naming scheme. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: Replace static array of devices with an idr structureBen Hutchings2-82/+81
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: mtdblock: Dynamically allocate cache info structuresBen Hutchings1-43/+31
Since we allocate struct mtd_blktrans_dev for each block device, we can add our own structure members to the end. Therefore embed struct mtd_blktrans_dev in struct mtdblk_dev and remove the static array of struct mtdblk_dev. Also remove the redundant pointer to struct mtd_info. This is preparation for removing the static limit on the number of MTD devices. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: Remove unnecessary comparisons with MAX_MTD_DEVICESBen Hutchings3-10/+2
MAX_MTD_DEVICES is about to be removed. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: nandsim: Define CONFIG_NANDSIM_MAX_PARTS and use it instead of MAX_MTD_DEVICESBen Hutchings1-2/+5
MAX_MTD_DEVICES is about to be removed. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: Use get_mtd_device_nm() to find named device in get_sb_mtd()Ben Hutchings1-12/+6
This removes the need to know the number of MTD devices. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: Introduce and use iteration macro for reading the MTD device tableBen Hutchings3-34/+45
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: change positive error return into negativeRoel Kluin1-1/+1
Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: maps: Blackfin async: rename local funcs to avoid common clashesMike Frysinger1-8/+8
There are new Blackfin MMR helper functions that use the same name as some of the local functions in this driver, so have the driver use more specific names to avoid the issue. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: fix different address space noiseH Hartley Sweeten1-1/+1
In mtd_ioctl MEMGETREGIONINFO the region_user_info pointer ur is cast in __kernel space. This produces a number of sparse warnings like: warning: cast removes address space of expression warning: incorrect type in initializer (different address spaces) expected unsigned int const [noderef] <asn:1>*register __p got unsigned int *<noident> Since argp is already a void __user * just use it dirrectly without the cast and make ur a __user *. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: ixp4xx: fix reading from half-word boundaryJon Ringle1-2/+2
Fix handling of reads that don't start on a half-word boundary. Signed-off-by: Jon Ringle <jon@ringle.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>