aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-10-25jffs2: Reduce excessive scan of empty blocksJoakim Tjernlund
Scanning 1024 bytes to see if an EB is empty is a bit much. Lower it to 256 bytes and make sure the while loop is optimized. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25jffs2: Fix serious write stall due to eraseJoakim Tjernlund
Drop the alloc_sem before erasing flash in jffs2_garbage_collect_pass(). Otherwise writes are put on hold until the erase has finised. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: omap2: fix static declaration warningG, Manjunath Kondaiah
This patch fixes sparse warning for static declaration of variable "use_dma" drivers/mtd/nand/omap2.c:114:11: warning: symbol 'use_dma' was not declared. Should it be static? Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25jffs2: Dynamically choose inocache hash sizeDaniel Drake
When JFFS2 is used for large volumes, the mount times are quite long. Increasing the hash size provides a significant speed boost on the OLPC XO-1 laptop. Add logic that dynamically selects a hash size based on the size of the medium. A 64mb medium will result in a hash size of 128, and a 512mb medium will result in a hash size of 1024. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: remove junk tabs in nand.hSebastian Andrzej Siewior
Remove tabs between type and name. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: cleanup nand.hSebastian Andrzej Siewior
- *var instead of * var - proper multiline comment - func(args) instead of func (args) - 80 lines So from |total: 2 errors, 37 warnings, 654 lines checked we got to one warning. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: Fix endianness issues from device treeIan Munsie
This patch adds the appropriate conversions to correct the endianness issues in the MTD driver whenever it accesses the device tree (which is always big endian). Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: m25p80.c: Add support for S25FL032P spi-nor flash devices.David Jander
Signed-off-by: David Jander <david@protonic.nl> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: nandsim: add module param for BBT handlingSebastian Andrzej Siewior
I used this to check the BBT on flash together with a hack in mtdchar in order to read bad blocks. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: nand: introduce NAND_CREATE_EMPTY_BBTSebastian Andrzej Siewior
it will create an empty BBT table without considering vendor's BBT information. Vendor's information may be unavailable if the NAND controller has a different DATA & OOB layout or this information may be allready purged. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: nand: add support for BBT without OOBSebastian Andrzej Siewior
The first (sixt) byte in the OOB area contains vendor's bad block information. During identification of the NAND chip this information is collected by scanning the complete chip. The option NAND_USE_FLASH_BBT is used to store this information in a sector so we don't have to scan the complete flash. Unfortunately the code stores a marker in order to recognize the BBT in the OOB area. This will fail if the OOB area is completely used for ECC. This patch introduces the option NAND_USE_FLASH_BBT_NO_OOB which has to be used with NAND_USE_FLASH_BBT. It will then store BBT on flash without touching the OOB area. The BBT format on flash remains same except the first page starts with the recognition pattern followed by the version byte. This change was tested in nandsim and it looks good so far :) Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: nand: pull in td into read_bbt()Sebastian Andrzej Siewior
No code change. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: nand: use ALIGN where possibleSebastian Andrzej Siewior
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: OneNAND: S5PC210 OneNAND supportKyungmin Park
S5PC210 has the same OneNAND controller as S5PC110 Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: OneNAND: S5PC110: Implement DMA interrupt methodKyungmin Park
Implement DMA interrupt method. previous time it polls the DMA status. It can reduce the CPU power but decrease the performance a little. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: OneNAND: S5PC110: Fix wrong DMA handling when HIGHMEMKyungmin Park
When use HIGHMEM, dma_map_single doesn't get the proper DMA address. So use the dma_map_page in this case. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: OneNAND: S5PC100: Only S5PC110 use the command map methodKyungmin Park
After S5PC110 use the generic method for OneNAND. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: MLC device check in OneNAND driverRohit Hassan Sathyanarayan
The MLC NAND Flash differs from the SLC NAND flash in functioning and the cell structure. Therefore we are considering it as a different Flash type. Signed-off-by: Rohit H.S <rohit.hs@samsung.com> Signed-off-by: Raghav Gupta <gupta.raghav@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: Define MLC Flash as a different flash typeRohit Hassan Sathyanarayan
MLC NAND Flash has a different cell structure and differs in functioning than the SLC NAND Flash. Hence we are considering it as a different Flash type. Signed-off-by: Rohit H.S <rohit.hs@samsung.com> Signed-off-by: Raghav Gupta <gupta.raghav@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: OneNAND: S5PC110: Add timeout to prevent the endless loopKyungmin Park
There's no case timeout but add it for some H/W problem or wrong codes implementation Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: add init_size hook for NAND driverHuang Shijie
Not all the NAND devices have all the information in additional id bytes. So add a hook in the nand_chip{} is a good method to calculate the right value of oobsize, erasesize and so on. Without the hook,you will get the wrong value, and you have to hack in the ->scan_bbt() to change the wrong value which make the code mess. Signed-off-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25jffs2: drop unused model argumentMike Frysinger
The jffs2 compression framework provides a "model" argument when compressing and decompressing, but the caller always passes in NULL and the callees never use it. So punt this useless overhead. 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-10-25mtd: add BLKPG API based repartition supportRoman Tereshonkov
Add support for mtd repartition based on the block device BLKPG interface: BLKPG_ADD_PARTITION - for partition creation; BLKPG_DEL_PARTITION - for partition delete The usage is based on BLKPG ioctl called with struct blkpg_ioctl_arg argument which includes the reference to struct blkpg_partition discribing the partition offset and length. Disadvantage: there is no implementation for mtd flags control. The flags are always borrowed from the master device. Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: prepare partition add and del functions for ioctl requestsRoman Tereshonkov
mtd_is_master, mtd_add_partition and mtd_del_partition functions are added to give the possibility of partition manipulation by ioctl request. The old partition add function is modified to fit the dynamic allocation. Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25ARM: platform data to use the FSMC NAND with the U300Linus Walleij
Just as it says, if this is merged along with the other patch, the driver supports the U300 NAND flash interface. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: generic FSMC NAND MTD driverLinus Walleij
This is the same driver submitted by ST Micros SPEAr team but generalized and tested on the ST-Ericsson U300. It probably easily works on the NHK8815 too. Signed-off-by: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar@st.com> Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com> Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25jffs2: use cond_resched() instead of yield()Wolfram Sang
yield() has different semantics meanwhile and even causes RT-kernels to BUG. Replace the only appearance left in jffs2. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: m25p80: Add support for the Winbond W25Q64Thierry Reding
This patch adds support for the Winbond W25Q64 serial flash. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: nand_base: do not cache pages with uncorrectable ECC errorsArtem Bityutskiy
Currently MTD caches the last read NAND page, even if there was an uncorrectable ECC error. This patch prevents caching in case of uncorrectable ECC errors. The reason is that we want to allow the user to re-read the NAND page several times. In case of unstable bits re-trying may help. Moreover, current behavior is wrong because the first read returns -EBADMSG (correctly) but the second read succeeds and incorrectly returns 0 (because we read from the cache). Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: add Broadcom BCM63xx image tag partition parserFlorian Fainelli
This patch adds support for parsing Broadcom BCM63xx image tag format and creating MTD partitions accordingly. This driver is a platform_device which can be instantiated accordingly by bcm63xx board support code. Signed-off-by: Daniel Dickinson <cshore@csolve.net> Signed-off-by: Mike Albon <malbon@openwrt.org> Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: sanity check ioctl inputDan Carpenter
If "ur_idx" is wrong we could go past the end of the array. The "ur_idx" comes from root so it's not a huge deal, but adding a sanity check makes the code more robust. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: fix the build warning for fsl_upm.cRoy Zang
Fix the build warning: drivers/mtd/nand/fsl_upm.c: In function 'fun_chip_init': drivers/mtd/nand/fsl_upm.c:190: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'resource_size_t' Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: fix almost all checkpatch warnings in nand_base.cFlorian Fainelli
Only 3 warnings are left, one is off by one character, but splitting the line would reduce the readability. One is for a for loop statement, which would also not improve readability. The last one is a false positive on a test. Artem: it is much easier to verify patches against nand_base.c with checkpatch.pl when nand_base.c itself does not have so many checkpatch.pl warnings. Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: fix all checkpatch errors in nand_base.cFlorian Fainelli
Artem: it is much easier to verify patches against nand_base.c with checkpatch.pl when nand_base.c itself does not have so many checkpatch.pl warnings. Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: davinci: relax a timeout for ECC-initializationWolfram Sang
Sudhakar found out that 100µs are enough. Sadly, his updated patch was overlooked and an older version still using 100ms was merged. Fix this. Reference: http://patchwork.ozlabs.org/patch/59180/ Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: m25p80: Add support for two new Spansion SPI devices (S25FL-K)Gernot Hoyler
This patch adds support for Spansion S25FL016K and S25FL064K SPI flash. It has been tested with physical devices. Note that both parts exhibit a Winbond manufacturer ID so they might also be added to that section. Signed-off-by: Gernot Hoyler <Gernot.Hoyler@spansion.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: nand: split ONFI detection logic to its own functionFlorian Fainelli
In order to reduce the indentation and improve the readability of nand_get_ flash_type, split the ONFI detection logic to its own function. The detection logic inside nand_flash_detect_onfi is also rewritten to allow for less indentation. Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: nand: add support for reading ONFI parameters from NAND deviceFlorian Fainelli
This patch adds support for reading NAND device ONFI parameters and use the ONFI informations to define its geometry. In case the device supports ONFI, the onfi_version field in struct nand_chip contains the version (BCD) and the onfi_params structure can be used by drivers to set up timings and such. We currently only support ONFI 1.0 parameters. Signed-off-by: Brian Norris <norris@broadcom.com> Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com> Signed-off-by: Maxime Bizon <mbizon@freebox.fr> Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: nand: denali should also handle NAND_CMD_PARAMFlorian Fainelli
Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: nand: add NAND_CMD_PARAM (0xec) definitionFlorian Fainelli
This command is used to read the device ONFI parameters page. Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: OneNAND: Remove unused cmd_map at s5pc110Kyungmin Park
S5PC110 OneNAND controller use the generic functions provided from onenand_base. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: nand: Samsung MLC - new OOB sizesBrian Norris
There are some additions to the detection scheme used by Samsung MLC NAND. These simple changes to support the 400- and 436-byte OOB are found in the following data sheet: Samsung K9GBG08U0M (p.40) Signed-off-by: Brian Norris <norris@broadcom.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: davinci: fix comment to match the codeWolfram Sang
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: pcmciamtd: remove dead codeDan Carpenter
This code isn't reachable. I looked through the git history and it hasn't been reachable for years. Someone removed the label to silence gcc's unused label warning but these few lines accidentally got left behind. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: mpc5121_nfc: fix memory leak on error pathJulia Lawall
Add a call to of_node_put in the error handling code following a call to of_find_compatible_node. Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: pxa3xx_nand: set oob length in the runtimeLei Wen
For different command need different oob requirement, set the proper oob length by different cmd. Signed-off-by: Lei Wen <leiwen@marvell.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: pxa3xx_nand: remove the flash info in driver structureLei Wen
After probe, all info already transfer to driver structure. There is no need to keep the original flash info. So that we could safely free the flash info in memory, which may grows larger when more flash is suported. Signed-off-by: Lei Wen <leiwen@marvell.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: pxa3xx_nand: introduce default timing to reduce read id timesLei Wen
We certainly don't need to send read id command times by times, since we already know what the id is after the first read id... So create a default timing which could ensure it would successfully read id out all supported chip. Then follow the build-in table to reconfigure the timing. Signed-off-by: Lei Wen <leiwen@marvell.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: pxa3xx_nand: condense the flash definitionLei Wen
Adding a new flash definition would need less code. Keep the platform passing flash definition method. If one flash is both defined in platform data and builtin table, driver would select the one from platform data first. By this way, platform could select the timing most suit for itself, not need to follow the common settings. Signed-off-by: Lei Wen <leiwen@marvell.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-24mtd: nand: support new Toshiba SLCBrian Norris
Toshiba does not use ONFI for their NAND flash. So we have to continue to add new IDs used by Toshiba devices as well as heuristic detection for scanning the 2nd page for a BBM. This is a relatively harmless start at supporting many of them. These chips mostly follow the same ID fields of previous generations, but there is a need for a tweak. These chips introduce a strange 576 byte OOB (that's 36 bytes per 512 bytes of page). In the preliminary data, Toshiba has not defined exactly how their ID strings should decode. In the future, a new tweak must be added. Data is taken from, among others, Toshiba TC58TxG4S2FBAxx Signed-off-by: Brian Norris <norris@broadcom.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>