summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
Commit message (Collapse)AuthorAgeFilesLines
* [MTD] Clarify OOB-operation interface commentsArtem Bityutskiy2007-02-091-0/+4
| | | | | | | | Add more comment to OOB I/O interface. Read/write are not symmetric which is confusing and should be documented. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] remove unused ecctype,eccsize fields from struct mtd_infoArtem Bityutskiy2007-02-091-2/+0
| | | | | | | | | | | | Remove unused and broken mtd->ecctype and mtd->eccsize fields from struct mtd_info. Do not remove them from userspace API data structures (don't want to breake userspace) but mark them as obsolete by a comment. Any userspace program which uses them should be half-broken anyway, so this is more about saving data structure size. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] [NOR] Intel: remove ugly PROGREGION macrosArtem Bityutskiy2007-02-091-10/+0
| | | | | | | | | | | | 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>
* [MTD] physmap: Add support for 64 bit resourcesStefan Roese2007-02-091-1/+1
| | | | | | | | | | This patch adds support for 64 bit resources enabled via the CONFIG_RESOURCES_64BIT option. Now a 64 bit can be passed to the physmap driver. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD] Don't include linux/mtd/map.h from linux/mtd/physmap.hHaavard Skinnemoen2007-02-091-1/+2
| | | | | | | | | Replace the inclusion of linux/mtd/map.h with a forward-declaration of struct map_info. This allows linux/mtd/physmap.h to be included by e.g. board code even if the MTD subsystem is disabled. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* Merge branch 'master' of git://git.infradead.org/~kmpark/onenand-mtd-2.6David Woodhouse2007-02-093-11/+18
|\
| * [MTD] OneNAND: Error message printing and bad block scan errosKyungmin Park2007-02-071-0/+7
| | | | | | | | | | | | | | | | 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>
| * [MTD] OneNAND: Reduce internal BufferRAM operationsKyungmin Park2007-02-021-6/+2
| | | | | | | | | | | | | | | | | | | | 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>
| * [MTD] OneNAND: Remove unused fieldsKyungmin Park2007-01-311-2/+0
| | | | | | | | | | | | | | - Remove unused fields - Fix typo Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| * [MTD] OneNAND: Update copyrights and code cleanupKyungmin Park2007-01-182-2/+3
| | | | | | | | | | | | Update copyrights and code cleanup Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| * [MTD] OneNAND: Reduce Double Density Package (DDP) operationsKyungmin Park2007-01-182-1/+6
| | | | | | | | | | | | | | - DDP code clean-up - Reduce block & bufferram operations in DDP Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* | [MTD] [NAND] Add kernel-doc for cellinfo field of struct nand_chipRandy Dunlap2007-02-091-0/+1
|/ | | | | | | | Fixes kernel-doc warning in mtd/nand.h. 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] OneNAND: Implement read-while-loadAdrian Hunter2007-01-101-0/+1
| | | | | | | 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>
* [MTD] OneNAND: add subpage write supportKyungmin Park2007-01-101-0/+2
| | | | | | OneNAND supports up to 4 writes at one NAND page. Add support of this feature. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* Merge branch 'master' of ↵David Woodhouse2006-12-011-1/+1
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
| * [PATCH] MTD: fix last kernel-doc warningRandy Dunlap2006-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | Fix the last current kernel-doc warning: Warning(/var/linsrc/linux-2619-rc3g5//include/linux/mtd/nand.h:416): No description found for parameter 'write_page' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | [MTD] add get and put methodsArtem Bityutskiy2006-11-291-0/+7
| | | | | | | | | | | | | | | | | | 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>
* | [MTD] add get_mtd_device_nm() functionArtem Bityutskiy2006-11-291-0/+1
| | | | | | | | | | | | | | | | | | 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>
* | [MTD] NAND: add subpage write supportThomas Gleixner2006-11-292-0/+11
| | | | | | | | | | | | | | 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>
* | [MTD] increase MAX_MTD_DEVICESArtem Bityutskiy2006-11-291-1/+1
| | | | | | | | Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
* | Merge git://git.infradead.org/~kmpark/onenand-mtd-2.6David Woodhouse2006-11-292-1/+5
|\ \
| * | [MTD] OneNAND: Single bit error detectionKyungmin Park2006-11-161-0/+1
| | | | | | | | | | | | | | | | | | | | | Idea from Jarkko Lavinen Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| * | [MTD] OneNAND: lock supportKyungmin Park2006-11-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Now you can use mtd lock inferface on OneNAND The idea is from Nemakal, Vijaya, thanks Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
| * | MTD: OneNAND: interrupt based wait supportKyungmin Park2006-11-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can use the two methods to wait. 1. polling: read interrupt status register 2. interrupt: use kernel ineterrupt mechanism To use interrupt method, you first connect onenand interrupt pin to your platform and configure interrupt properly Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
* | | [MTD] [NAND] remove len/ooblen confusion.Vitaly Wool2006-11-281-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As was discussed between Ricard Wanderlöf, David Woodhouse, Artem Bityutskiy and me, the current API for reading/writing OOB is confusing. The thing that introduces confusion is the need to specify ops.len together with ops.ooblen for reads/writes that concern only OOB not data area. So, ops.len is overloaded: when ops.datbuf != NULL it serves to specify the length of the data read, and when ops.datbuf == NULL, it serves to specify the full OOB read length. The patch inlined below is the slightly updated version of the previous patch serving the same purpose, but with the new Artem's comments taken into account. Artem, BTW, thanks a lot for your valuable input! Signed-off-by: Vitaly Wool <vwool@ru.mvista.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* | | [MTD] Allow variable block sizes in mtd_blkdevsRichard Purdie2006-11-281-1/+2
|/ / | | | | | | | | | | | | | | | | Currently, mtd_blkdevs enforces a block size of 512, even if the drivers can seemingly request a different size. This patch fixes mtd_blkdevs so block sizes other than 512 work correctly. Signed-off-by: Richard Purdie <rpurdie@openedhand.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* / [MTD] NAND: Combined oob buffer so it's contiguous with dataDavid Woodhouse2006-10-211-5/+1
|/ | | | | | | | | | Ditch the separate oobrbuf and oobwbuf fields from the chip buffers, and use only a single buffer immediately after the data. This accommodates NAND controllers such as the OLPC CAFÉ chip, which can't do scatter/gather DMA so needs the OOB buffer to be contiguous with the data, for both read and write. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* fix file specification in commentsUwe Zeisberger2006-10-031-1/+1
| | | | | | | Many files include the filename at the beginning, serveral used a wrong one. Signed-off-by: Uwe Zeisberger <Uwe_Zeisberger@digi.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
* [MTD ONENAND] Check OneNAND lock scheme & all block unlock command supportKyungmin Park2006-09-262-3/+7
| | | | | | | | OneNAND lock scheme depends on density and process of chip. Some OneNAND chips support all block unlock Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD NAND] Provide prototype for newly-exported nand_wait_ready()David Woodhouse2006-09-251-0/+3
| | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD NAND] Allow override of page read and write functions.David Woodhouse2006-09-251-0/+11
| | | | | | | | - allow high-level nand_write_page() function to be overridden - likewise low-level write_page_raw() and read_page_raw() functions - Clean up the abuse of chip->ecc.{write,read}_page() with MTD_OOB_RAW Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD NAND] Allocate chip->buffers separately to allow it to be overriddenDavid Woodhouse2006-09-251-2/+4
| | | | | | In particular, the board driver might need it to be DMAable. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* [MTD NAND] Split nand_scan() into two parts; allow board driver to interveneDavid Woodhouse2006-09-251-0/+5
| | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* MTD: Convert Atmel PRI information to AMD formatHaavard Skinnemoen2006-08-161-0/+13
| | | | | | | | | | | | 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>
* MTD: kernel-doc fixes + additionsRandy Dunlap2006-06-294-54/+65
| | | | | | | | | Fix some kernel-doc typos/spellos. Use kernel-doc syntax in places where it was almost used. Correct/add struct, struct field, and function param names where needed. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* MTD: fix all kernel-doc warningsRandy Dunlap2006-06-291-3/+10
| | | | | | | | | | | Fix all kernel-doc warnings in MTD headers and source files: - add some missing struct fields; - correct some function parameter names; - use kernel-doc format for function doc. headers; - nand_ecc.c contains only exported interfaces, no internal ones; Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* Merge git://git.infradead.org/hdrcleanup-2.6Linus Torvalds2006-06-205-5/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.infradead.org/hdrcleanup-2.6: (63 commits) [S390] __FD_foo definitions. Switch to __s32 types in joystick.h instead of C99 types for consistency. Add <sys/types.h> to headers included for userspace in <linux/input.h> Move inclusion of <linux/compat.h> out of user scope in asm-x86_64/mtrr.h Remove struct fddi_statistics from user view in <linux/if_fddi.h> Move user-visible parts of drivers/s390/crypto/z90crypt.h to include/asm-s390 Revert include/media changes: Mauro says those ioctls are only used in-kernel(!) Include <linux/types.h> and use __uXX types in <linux/cramfs_fs.h> Use __uXX types in <linux/i2o_dev.h>, include <linux/ioctl.h> too Remove private struct dx_hash_info from public view in <linux/ext3_fs.h> Include <linux/types.h> and use __uXX types in <linux/affs_hardblocks.h> Use __uXX types in <linux/divert.h> for struct divert_blk et al. Use __u32 for elf_addr_t in <asm-powerpc/elf.h>, not u32. It's user-visible. Remove PPP_FCS from user view in <linux/ppp_defs.h>, remove __P mess entirely Use __uXX types in user-visible structures in <linux/nbd.h> Don't use 'u32' in user-visible struct ip_conntrack_old_tuple. Use __uXX types for S390 DASD volume label definitions which are user-visible S390 BIODASDREADCMB ioctl should use __u64 not u64 type. Remove unneeded inclusion of <linux/time.h> from <linux/ufs_fs.h> Fix private integer types used in V4L2 ioctls. ... Manually resolve conflict in include/linux/mtd/physmap.h
| * Don't include linux/config.h from anywhere else in include/David Woodhouse2006-04-266-6/+0
| | | | | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* | [MTD] NAND: Fix breakage all over the placeThomas Gleixner2006-06-201-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following problems are addressed: - wrong status caused early break out of nand_wait() - removed the bogus status check in nand_wait() which is a relict of the abandoned support for interrupted erase. - status check moved to the correct place in read_oob - oob support for syndrom based ecc with strange layouts - use given offset in the AUTOOOB based oob operations Partially based on a patch from Vitaly Vool <vwool@ru.mvista.com> Thanks to Savin Zlobec <savin@epico.si> for tracking down the status problem. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | [MTD] assume mtd->writesize is 1 for NOR flashesArtem B. Bityutskiy2006-06-141-3/+6
| | | | | | | | Signed-off-by: Artem B. Bityitskiy
* | [MTD] NAND Expose the new raw mode function and status info to userspaceThomas Gleixner2006-05-301-11/+0
| | | | | | | | | | | | | | | | | | | | | | The raw read/write access to NAND (without ECC) has been changed in the NAND rework. Expose the new way - setting the file mode via ioctl - to userspace. Also allow to read out the ecc statistics information so userspace tools can see that bitflips happened and whether errors where correctable or not. Also expose the number of bad blocks for the partition, so nandwrite can check if the data fits into the parition before writing to it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | [MTD] Rework the out of band handling completelyThomas Gleixner2006-05-292-10/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hopefully the last iteration on this! The handling of out of band data on NAND was accompanied by tons of fruitless discussions and halfarsed patches to make it work for a particular problem. Sufficiently annoyed by I all those "I know it better" mails and the resonable amount of discarded "it solves my problem" patches, I finally decided to go for the big rework. After removing the _ecc variants of mtd read/write functions the solution to satisfy the various requirements was to refactor the read/write _oob functions in mtd. The major change is that read/write_oob now takes a pointer to an operation descriptor structure "struct mtd_oob_ops".instead of having a function with at least seven arguments. read/write_oob which should probably renamed to a more descriptive name, can do the following tasks: - read/write out of band data - read/write data content and out of band data - read/write raw data content and out of band data (ecc disabled) struct mtd_oob_ops has a mode field, which determines the oob handling mode. Aside of the MTD_OOB_RAW mode, which is intended to be especially for diagnostic purposes and some internal functions e.g. bad block table creation, the other two modes are for mtd clients: MTD_OOB_PLACE puts/gets the given oob data exactly to/from the place which is described by the ooboffs and ooblen fields of the mtd_oob_ops strcuture. It's up to the caller to make sure that the byte positions are not used by the ECC placement algorithms. MTD_OOB_AUTO puts/gets the given oob data automaticaly to/from the places in the out of band area which are described by the oobfree tuples in the ecclayout data structre which is associated to the devicee. The decision whether data plus oob or oob only handling is done depends on the setting of the datbuf member of the data structure. When datbuf == NULL then the internal read/write_oob functions are selected, otherwise the read/write data routines are invoked. Tested on a few platforms with all variants. Please be aware of possible regressions for your particular device / application scenario Disclaimer: Any whining will be ignored from those who just contributed "hot air blurb" and never sat down to tackle the underlying problem of the mess in the NAND driver grown over time and the big chunk of work to fix up the existing users. The problem was not the holiness of the existing MTD interfaces. The problems was the lack of time to go for the big overhaul. It's easy to add more mess to the existing one, but it takes alot of effort to go for a real solution. Improvements and bugfixes are welcome! Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | [MTD] Remove silly MTD_WRITE/READ macrosThomas Gleixner2006-05-291-15/+1
| | | | | | | | | | | | | | Most of those macros are unused and the used ones just obfuscate the code. Remove them and fixup all users. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | [MTD] NAND Replace oobinfo by ecclayoutThomas Gleixner2006-05-296-12/+13
| | | | | | | | | | | | | | | | | | The nand_oobinfo structure is not fitting the newer error correction demands anymore. Replace it by struct nand_ecclayout and fixup the users all over the place. Keep the nand_oobinfo based ioctl for user space compability reasons. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | [MTD] NAND Consolidate oobinfo handlingThomas Gleixner2006-05-291-3/+2
| | | | | | | | | | | | | | | | | | The info structure for out of band data was copied into the mtd structure. Make it a pointer and remove the ability to set it from userspace. The position of ecc bytes is defined by the hardware and should not be changed by software. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | [MTD] NAND Fix platform structure and NDFC driverThomas Gleixner2006-05-292-2/+5
| | | | | | | | | | | | | | The platform structure was lacking an oobinfo field. The NDFC driver had some remains from another tree. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | [MTD] NAND modularize write functionThomas Gleixner2006-05-261-26/+45
| | | | | | | | | | | | | | | | Modularize the write function and reorganaize the internal buffer management. Remove obsolete chip options and fixup all affected users. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | [MTD] NAND Modularize read functionThomas Gleixner2006-05-251-8/+8
| | | | | | | | | | | | | | | | Split the core of the read function out and implement seperate handling functions for software and hardware ECC. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | [MTD] NAND Add read/write function pointers to struct nand_ecc_ctrlThomas Gleixner2006-05-251-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | Add read/write function pointers to struct nand_ecc_ctrl to prepare the modulaization of nand_read/write functions. The current implementation handles every type of ecc mode software/hardware and all kinds of strange ecc placement schemes in one switch/if construct. Thats too complex to maintain and too inflexible to expand. Modularization will also shorten the code pathes of the read/write functions. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | [MTD] Add ECC statistics to struct mtd_infoThomas Gleixner2006-05-251-0/+14
| | | | | | | | | | | | | | | | FLASH - especially NAND FLASH - will become less reliable and bit flips more likely. Add an ECC statistics struct to struct mtd_info to keep track of this. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>