summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
...
| | * UBI: do not flush queue on each vtbl changeArtem Bityutskiy2008-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is just not necessary. We re-write whole layout copy, so the old contents cannot show up again sice scan process will drop it. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: implement atomic LEB change ioctlArtem Bityutskiy2008-01-253-28/+183
| | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: handle zero-length caseArtem Bityutskiy2008-01-251-0/+11
| | | | | | | | | | | | | | | | | | | | | ubi_eba_atomic_leb_change() has to just map the LEB to a free PEB if data length is zero. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: simplify internal interfacesArtem Bityutskiy2008-01-253-36/+36
| | | | | | | | | | | | | | | | | | | | | Instead of passing vol_id to all functions and then find struct ubi_volume, pass struct ubi_volume pointer. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: do not change file pointer while updatingArtem Bityutskiy2008-01-252-4/+1
| | | | | | | | | | | | | | | | | | | | | Since we do not change semantics of seek(), changing the file pointer while updating does not make much sense. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: add layout volume informationArtem Bityutskiy2008-01-253-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Add more information about layout volume to make userspace tools use the macros instead of constants. Also rename UBI_LAYOUT_VOL_ID to make it consistent with other macros. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: fix warningsArtem Bityutskiy2008-01-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old gcc complains: CC drivers/mtd/ubi/wl.o drivers/mtd/ubi/wl.c: In function 'wear_leveling_worker': drivers/mtd/ubi/wl.c:746: warning: 'pe' may be used uninitialized in this function CC drivers/mtd/ubi/scan.o drivers/mtd/ubi/scan.c: In function 'ubi_scan': drivers/mtd/ubi/scan.c:772: warning: 'ec' may be used uninitialized in this function drivers/mtd/ubi/scan.c:772: note: 'ec' was declared here Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: add sanity checkArtem Bityutskiy2008-01-251-1/+6
| | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: remove bogus assertionArtem Bityutskiy2008-01-251-1/+0
| | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: bugfix: calculate data offset properlyArtem Bityutskiy2008-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | Data offset is VID header offset + VID header size aligned to the min. I/O unit size up. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: amend array sizeArtem Bityutskiy2008-01-251-2/+2
| | | | | | | | | | | | | | | | | | | | | Since the data offset parameter was removed, the size of the parameters array is now 2, not 3. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: add auto-resize featureArtem Bityutskiy2008-01-256-24/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem: NAND flashes have different amount of initial bad physical eraseblocks (marked as bad by the manufacturer). For example, for 256MiB Samsung OneNAND flash there might be from 0 to 40 bad initial eraseblocks, which is about 2%. When UBI is used as the base system, one needs to know the exact amount of good physical eraseblocks, because this number is needed to create the UBI image which is put to the devices during production. But this number is not know, which forces us to use the minimum number of good physical eraseblocks. And UBI additionally reserves some percentage of physical eraseblocks for bad block handling (default is 1%), so we have 1-3% of PEBs reserved at the end, depending on the amount of initial bad PEBs. But it is desired to always have 1% (or more, depending on the configuration). Solution: this patch adds an "auto-resize" flag to the volume table. The volume which has the "auto-resize" flag will automatically be re-sized (enlarged) on the first UBI initialization. UBI clears the flag when the volume is re-sized. Only one volume may have the "auto-resize" flag. So, the production UBI image may have one volume with "auto-resize" flag set, and its size is automatically adjusted on the first boot of the device. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: use bit-fieldsArtem Bityutskiy2008-01-252-19/+9
| | | | | | | | | | | | | | | | | | Save 12 bytes of RAM per volume by using bit-fields instead of integers. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: fix warningsArtem Bityutskiy2008-01-252-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/mtd/ubi/cdev.c: In function ‘vol_cdev_read’: drivers/mtd/ubi/cdev.c:187: warning: unused variable ‘vol_id’ CC [M] drivers/mtd/ubi/kapi.o drivers/mtd/ubi/kapi.c: In function ‘ubi_leb_erase’: drivers/mtd/ubi/kapi.c:483: warning: unused variable ‘vol_id’ drivers/mtd/ubi/kapi.c: In function ‘ubi_leb_unmap’: drivers/mtd/ubi/kapi.c:544: warning: unused variable ‘vol_id’ drivers/mtd/ubi/kapi.c: In function ‘ubi_leb_map’: drivers/mtd/ubi/kapi.c:582: warning: unused variable ‘vol_id’ Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| | * UBI: get rid of ubi_ltree_slabArtem Bityutskiy2008-01-253-33/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | This slab cache is not really needed since the number of objects is low and the constructor does not make much sense because we allocate oblects when doint I/O, which is way slower then allocation. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | [MTD] [NAND] Fix Blackfin NFC ECC calculating bug with page size 512 bytesBryan Wu2008-02-031-6/+10
| | | | | | | | | | | | | | | Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | [MTD] [NAND] Remove wrong operation in PM function of the BF54x NFC driverBryan Wu2008-02-031-3/+0
| | | | | | | | | | | | | | | | | | | | | There is no suspend/resume operation in NFC driver at all, currently. Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | [MTD] [NAND] Remove unused variable in plat_nand_removeLi Zefan2008-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | With CONFIG_MTD_PARTITIONS not set, got this: drivers/mtd/nand/plat_nand.c:113: warning: unused variable 'pdata' Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | Merge git://git.infradead.org/~kmpark/onenand-mtd-2.6David Woodhouse2008-02-031-31/+28
| |\ \
| | * | [MTD] [OneNAND] Use pre-alloced oob buffer instead of local bufferKyungmin Park2008-01-291-4/+5
| | | | | | | | | | | | | | | | Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| | * | [MTD] [OneNAND] Use the u_char instead of char in oobbufSheng Yongjie (Sam2008-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In function onenand_verify_oob, local variable oobbuf shall be unsigned char. In the case of a value is >= 0x80, it's unequal in comparing the value in an unsigned char and signed char. Signed-off-by: Sheng Yongjie (Sam) <samsheng@trident.com.cn> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| | * | [MTD] [OneNAND] Check the initial bad block using ONENAND_CTRL_ERRORKyungmin Park2008-01-291-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | Some chips don't set the ONENAND_CTRL_LOAD bit. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| | * | [MTD] [OneNAND] Get correct density from device IDKyungmin Park2008-01-291-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | Use the higher bits for other purpose. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| | * | [MTD] [OneNAND] Consolidate OneNAND operation orderKyungmin Park2008-01-291-15/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Consolidate OneNAND operation order as OneNAND Spec. It also doesn't break previous operation order. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| | * | [MTD] [OneNAND] fix call to onenand_verify when writing subpagesAdrian Hunter2008-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| | * | [MTD] [OneNAND] Do not release chip twiceAdrian Hunter2008-01-291-3/+0
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| * | | Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitDavid Woodhouse2008-02-032-9/+10
| |\ \ \
| * | | | [MTD] Unlocking all Intel flash that is locked on power up.Justin Treon2008-02-034-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] [NAND] at91_nand: Make mtdparts option can override board infoAtsushi Nemoto2008-02-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call parse_mtd_partitions before checking board's partition_info, so that "mtdparts=" option can override board's default setting. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [MTD] mtdoops: Various minor cleanupsRichard Purdie2008-02-031-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various minor cleaups to mtdoops: * Don't support the mtd->erasesize < OOPS_PAGE_SIZE case * Tweak printks and make the device mtdoops connects to more visible * CON_PRINTBUFFER flag is uneeded Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [MTD] mtdoops: Ensure sequential write to the bufferRichard Purdie2008-02-031-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a spinlock to ensure writes to the mtdoops buffer memory are sequential and don't race. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [MTD] mtdoops: Perform write operations in a workqueueRichard Purdie2008-02-031-40/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Writing to the flash needs to be done in a workqueue. The console write functions may be called in any context which can lead to lockups otherwise. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [MTD] mtdoops: Add further error return code checkingRichard Purdie2008-02-031-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add further error return code checks to the mtdoops driver. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [MTD] [NOR] Test devtype, not definition in flash_probe(), ↵Roel Kluin2008-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/mtd/devices/lart.c drivers/mtd/devices/lart.c:119:#define FLASH_DEVICE_16mbit_BOTTOM 0x88f488f4 As was, unless "manufacturer != FLASH_MANUFACTURER" this returned true Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [UBI] drivers/mtd/ubi/scan.c: fix uninitialized var warningakpm@linux-foundation.org2008-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/mtd/ubi/scan.c: In function 'ubi_scan': drivers/mtd/ubi/scan.c:772: warning: 'ec' may be used uninitialized in this function Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [UBI] drivers/mtd/ubi/wl.c: fix uninitialized var warningakpm@linux-foundation.org2008-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/mtd/ubi/wl.c:746: warning: 'pe' may be used uninitialized in this function Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [UBI] drivers/mtd/ubi/cdev.c: unused varakpm@linux-foundation.org2008-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [MTD] Factor out OF partition support from the NOR driver.Scott Wood2008-02-034-62/+110
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [MTD] jedec probe: drop unnecessary forward declarationsIlpo Järvinen2008-02-031-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | | [MTD] JEDEC probe: kill some inline bloatIlpo Järvinen2008-02-031-2/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ codiff $OBJ.old $OBJ drivers/mtd/chips/jedec_probe.c: cfi_jedec_setup | -320 jedec_probe_chip | -7073 2 functions changed, 7393 bytes removed, diff: -7393 drivers/mtd/chips/jedec_probe.c: jedec_reset | +1151 1 function changed, 1151 bytes added, diff: +1151 drivers/mtd/chips/jedec_probe.o: 3 functions changed, 1151 bytes added, 7393 bytes removed, diff: -6242 Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | | [MTD] [NAND] fix s3c2410 error correctionMatt Reimer2008-01-261-14/+12
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | The single-bit error correction was, well, incorrect. For determing which bit to correct it was using P1' P2' P4' P8' instead of P1 P2 P4 P8, and it was using P16' P32' P64' P128' P256' P512' P1024' P2048' instead of P16 P32 P64 P128 P256 P512 P1024 P2048. Signed-off-by: Matt Reimer <mreimer@vpop.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | [MTD] [NAND] make s3c2410 indicate an error for multi-bit read errorsMatt Reimer2008-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | If there were multiple bit errors in the data s3c2410_nand_correct_data() was returning 0 (no error) instead of -1, so the upper layers (like JFFS2) would not know the data is corrupt. Signed-off-by: Matt Reimer <mreimer@vpop.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | [MTD] [NOR] Fix incorrect interface code for x16/x32 chipsBartlomiej Sieka2008-01-103-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | According to "Common Flash Memory Interface Publication 100" dated December 1, 2001, the interface code for x16/x32 chips is 0x0005, and not 0x0004 used so far. Signed-off-by: Bartlomiej Sieka <tur@semihalf.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | [MTD] [NAND] Don't panic if a controller driver does ecc its own way.Scott Wood2008-01-081-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some hardware, such as the enhanced local bus controller used on some mpc83xx chips, does ecc transparently when reading and writing data, rather than providing a generic calculate/correct mechanism that can be exported to the nand subsystem. The subsystem should not BUG() when calculate, correct, or hwctl are missing, if the methods that call them have been overridden. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | [MTD] [MAPS] Remove Photron PNC-2000 map driverDavid Woodhouse2008-01-083-101/+0
| | | | | | | | | | | | | | | | | | | | | It should be done as a physmap device, and people keep turning it on and whining about it. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | [MTD] mtdchar.c: ioctl always returns 0 as size written for ppc64David Scidmore2008-01-081-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "include/linux/mtd/mtd.h" declares "mtd_oob_ops.retlen" as size_t, which is 64 bits on targets with a 64 bit addressing. The MEMWRITEOOB ioctl calls copy_to_user() to write it back to "mtd_oob_buf.length", which is declared in "include/linux/mtd-abi.h" as uint32_t. Since powerpc is a big endian architecture, this only copies the upper 32 bits of the address, which is always 0. Signed-off-by: David Scidmore <dscidmore@xes-inc.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
| * | UBI: bugfix: do not forget to increment vol_countArtem Bityutskiy2007-12-262-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a new volume, do not forget to increment the vol_count variable. Also, users are not interested in internal volumes, so do not show them in the volumes_count sysfs file. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: do not support kiBArtem Bityutskiy2007-12-261-3/+1
| | | | | | | | | | | | | | | | | | Be strict and accept only KiB, MiB and GiB, not Kib, not kib, etc. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: add mtd_num sysfs attributeArtem Bityutskiy2007-12-261-1/+9
| | | | | | | | | | | | | | | | | | Expose number or the underlying MTD device in sysfs. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
| * | UBI: fix mtd device string parsingArtem Bityutskiy2007-12-261-24/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UBI allows to specify MTD device name or number when the module is being loaded. When parsing MTD device identity string, it first tries to treat it as device NAME, and if that fails, it treats it as device number. Make it vice-versa as this is more logical and makes less troubles when you have an MTD device named "1" and try to load mtd1 which has different name. This is especially easy to hit when gluebi is enabled. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
OpenPOWER on IntegriCloud