aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/chips
AgeCommit message (Collapse)AuthorFilesLines
2011-03-31Fix common misspellingsLucas De Marchi5-10/+10
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <[email protected]>
2011-03-11mtd: cfi: add support for AMIC flashes (e.g. A29L160AT)Steffen Sledz1-0/+1
Signed-off-by: Steffen Sledz <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-03-11mtd: cfi: fix writebufsize initializationAnatolij Gustschin3-3/+3
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 <[email protected]> Acked-by: Guillaume LECERF <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-03-11mtd: fix race in cfi_cmdset_0001 driverJoakim Tjernlund1-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 <[email protected]> Acked-by: Michael Cashwell <[email protected]> Acked-by: Stefan Bigler <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]> Cc: [email protected]
2011-03-11mtd: jedec_probe: initialise make sector erase command variableAntony Pavlov1-2/+3
In the commit 08968041bef437ec363623cd3218c2b083537ada (mtd: cfi_cmdset_0002: make sector erase command variable) introdused a field sector_erase_cmd. In the same commit initialisation of cfi->sector_erase_cmd made in cfi_chip_setup() (file drivers/mtd/chips/cfi_probe.c), so the CFI chip has no problem: ... cfi->cfi_mode = CFI_MODE_CFI; cfi->sector_erase_cmd = CMD(0x30); ... But for the JEDEC chips this initialisation is not carried out, so the JEDEC chips have sector_erase_cmd == 0. This patch adds the missing initialisation. Signed-off-by: Antony Pavlov <[email protected]> Acked-by: Guillaume LECERF <[email protected]> Signed-off-by: David Woodhouse <[email protected]> CC: [email protected]
2011-03-11mtd: jedec_probe: Change variable name from cfi_p to cfiAntony Pavlov1-16/+16
In the following commit, we'll need to use the CMD() macro in order to fix the initialisation of the sector_erase_cmd field. That requires the local variable to be called 'cfi', so change it first in a simple patch. Signed-off-by: Antony Pavlov <[email protected]> Acked-by: Guillaume LECERF <[email protected]> Signed-off-by: David Woodhouse <[email protected]> CC: [email protected]
2011-01-06mtd: cfi: add writebufsize initializationAnatolij Gustschin3-0/+6
Initialize mtd->writebufsize to the value obtained by CFI query command at probe time. Signed-off-by: Anatolij Gustschin <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-01-06mtd: cfi_cmdset_0002: add support for Samsung K8D3x16UxC NOR chipsGuillaume LECERF1-1/+3
These chips report CFI v3.3 [1], so patch them on the fly to the more correct v1.3. Discussed and tested by the OpenWRT people [2]. [1] http://www.samsung.com/global/system/business/semiconductor/product/2007/6/11/NORFlash/32Mbit/K8D3216UBC/ds_K8D3x16UxC_rev17.pdf [2] https://dev.openwrt.org/ticket/866 Signed-off-by: Guillaume LECERF <[email protected]> Acked-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-01-06mtd: cfi_cmdset_0002: add support for Samsung K8D6x16UxM NOR chipsGuillaume LECERF1-3/+13
These chips report CFI v0.0 [1], so extend cfi_fixup_major_minor() to patch all Samsung chips from 0.0 to 1.0. Discussed and tested by the OpenWRT people [2]. [1] http://www.samsung.com/global/system/business/semiconductor/product/2007/6/11/NORFlash/64Mbit/K8D6316UTM/ds_K8D6x16UxM_rev16.pdf [2] https://dev.openwrt.org/ticket/7348 Signed-off-by: Guillaume LECERF <[email protected]> Acked-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-12-03mtd: cfi_fixup: remove unused 'param' parameterGuillaume LECERF4-76/+76
The 'param' parameter has never been used since its introduction, so simply remove it. Signed-off-by: Guillaume LECERF <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-10-30Merge branch 'master' of ↵David Woodhouse1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git Conflicts: drivers/mtd/mtd_blkdevs.c Merge Grant's device-tree bits so that we can apply the subsequent fixes. Signed-off-by: David Woodhouse <[email protected]>
2010-10-26Revert "mtd: cleanup Kconfig dependencies"David Woodhouse1-22/+24
This reverts commit 432dc821c90114f9b0e00f6752a700e937516ade. The individual CFI geometry options were carefully set up to get sane default values if the CFI_ADV_OPTIONS wasn't set, and it wasn't appropriate to move them into an if/endif block. Signed-off-by: David Woodhouse <[email protected]>
2010-10-26mtd: cfi_cmdset_0002: make sector erase command variableGuillaume LECERF2-4/+8
Some old SST chips use 0x50 as sector erase command, instead of 0x30. Make this value variable to handle such chips. Signed-off-by: Guillaume LECERF <[email protected]> Acked-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-10-26mtd: cfi_cmdset_0002: add CFI detection for SST 38VF640x chipsGuillaume LECERF1-0/+26
Add support for SST38VF640x chips in CFI mode. Signed-off-by: Guillaume LECERF <[email protected]> Signed-off-by: yidong zhang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-10-26mtd: cfi_util: add support for switching SST 39VF640xB chips into QRY modeGuillaume LECERF1-0/+7
Signed-off-by: Guillaume LECERF <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-10-26mtd: cfi_cmdset_0001: use defined value of P_ID_INTEL_PERFORMANCE instead of ↵Guillaume LECERF1-2/+2
hardcoded one Signed-off-by: Guillaume LECERF <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-10-25mtd: cfi_cmdset_0002: code cleanupsWolfram Sang1-39/+8
- remove disabled code (hasn't been touched since the beginning of git and should be reimplemented if really needed) - convert remaining c++-comments to plain c-style Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Guillaume LECERF <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-10-24mtd: cleanup Kconfig dependenciesH Hartley Sweeten1-24/+22
Remove the MTD!=n dependency since that is handled by drivers/mtd/Kconfig. Simplify the dependency checks for mtd/chips by using if/endif blocks. Remove all default n since that is the Kconfig default. Signed-off-by: H Hartley Sweeten <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-10-18Update broken web addresses in the kernel.Justin P. Mattock1-2/+2
The patch below updates broken web addresses in the kernel Signed-off-by: Justin P. Mattock <[email protected]> Cc: Maciej W. Rozycki <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Finn Thain <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Matt Turner <[email protected]> Cc: Dimitry Torokhov <[email protected]> Cc: Mike Frysinger <[email protected]> Acked-by: Ben Pfaff <[email protected]> Acked-by: Hans J. Koch <[email protected]> Reviewed-by: Finn Thain <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2010-08-08mtd: Remove obsolete <mtd/compatmac.h> includeDavid Woodhouse8-8/+0
Signed-off-by: David Woodhouse <[email protected]>
2010-08-06mtd: cfi_cmdset_0002: consider version 1.4 as a valid primary extension versionGuillaume LECERF1-3/+4
The Spansion S29WS-P device family uses CFI version 1.4 [1]. Consider it as a valid version. [1] http://www.spansion.com/Support/Datasheets/s29ws-p_00_a12_e.pdf Signed-off-by: Guillaume LECERF <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-08-06mtd: change struct flchip_shared spinlock locking into mutexStefani Seibold1-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 <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-08-04mtd: cfi_cmdset_0002: fix the check for valid primary extension versionsGuillaume LECERF1-3/+12
Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3 [1][2]. Fix the check in cfi_cmdset_0002 accordingly. [1] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf, page 19 [2] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_100_20011201.pdf Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Guillaume LECERF <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-08-02mtd: cfi_probe: print manufacturer and id of probed chipGuillaume LECERF1-2/+2
Signed-off-by: Guillaume LECERF <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-08-02mtd: add an ioctl to query the lock status of a flash sectorRichard Cochran1-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 <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-20mtd: cfi_cmdset_0002: use AMD standard command-set with Winbond flash chipsGuillaume LECERF2-0/+4
Tested with W19L320SBT9C [1]. [1] http://www.datasheetarchive.com/pdf-datasheets/Datasheets-40/DSA-795343.pdf [dwmw2: Fix MODULE_ALIAS and linkage] Signed-off-by: Obinou <[email protected]> Signed-off-by: Guillaume LECERF <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-20mtd: cfi_cmdset_0002: Fix MODULE_ALIAS and linkage for new 0701 commandset IDDavid Woodhouse1-0/+3
Signed-off-by: Guillaume LECERF <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: cfi_cmdset_0002: Fix argument order in bootloc warningDavid Woodhouse1-1/+1
Doh. Pointed out by Guillaume LECERF <[email protected]> since I managed to miss it in my test builds. S'what I get for hacking at 2am, I suppose. Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: chips: add SST39WF160x NOR-flashesWolfram Sang1-0/+30
Due to a broken CFI, they have to be added to jedec_probe. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: jedec_probe: remove spaces before tabsArtem Bityutskiy1-4/+4
Nothing very important, this just makes git am stop producing warnings. Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: chips: use common manufacturer codes in jedec_probe()Wolfram Sang1-135/+117
Factor out old manufacturers and use the generic ones from cfi.h Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: cfi_util: do not printk if no extended query tableGuillaume LECERF1-1/+2
Signed-off-by: Guillaume LECERF <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: cfi_cmdset_0002: add CFI detection for SST 39VF{32, 64}xxB chipsGuillaume LECERF1-0/+15
This patch adds support for detecting SST 39VF32xxB and 39VF64xxB chips in CFI mode. Signed-off-by: Guillaume LECERF <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: cfi_cmdset_0002: add CFI detection for SST 39VF{16, 32}xx chipsGuillaume LECERF2-0/+36
SST 39VF{16,32}xx chips use the 0x0701 command set, fully compatible with the AMD one. This patch adds support for detecting them in CFI mode. Signed-off-by: Guillaume LECERF <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: cfi_cmdset_0002: Tone down warning messages about TopBottom CFI fieldDavid Woodhouse1-4/+5
Accept values of 2-5 for TopBottom, where the newly-added 4 and 5 values mean a uniform layout. It does indicate WP layout but we don't handle that. Also don't say "broken" when swapping erase regions in a top-boot chip. That got retrospectively documented in the spec. Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: cfi_cmdset_0002: do not fail on no extended query table as they are ↵Guillaume LECERF1-44/+45
both optional After looking at AMD's CFI specification [1], both of the extended query tables are optional. Thus, it looks like relying that at least one of those tables exist is a bug in cfi_cmdset_0002. This patch inverts the logic and checks for unlock function pointers before exiting on error. This approach leaves place to add a call to a fixup function to try to handle chips compatible with the early AMD specification from 1995 [2]. [1] http://www.amd.com/us-en/assets/content_type/DownloadableAssets/cfi_r20.pdf [2] http://noel.feld.cvut.cz/hw/amd/20158a.pdf Signed-off-by: Guillaume LECERF <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: cfi_probe: use P_ID_* definitions instead of hardcoded valuesGuillaume LECERF1-5/+5
Use P_ID_* definitions already in include/linux/mtd/cfi.h instead of the hardcoded values. Make the code more readable. Signed-off-by: Guillaume LECERF <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: cfi_probe: add support for SST 0x0701 vendornameGuillaume LECERF1-0/+8
SST 39VF160x and 39VF320x chips use vendorname id 0x0701 and alternative unlock addresses. Add support for them in cfi_probe.c. Signed-off-by: Guillaume LECERF <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: cfi_probe: make the addresses used to enter Auto Select Mode variableGuillaume LECERF1-3/+4
Make the addresses used to enter Auto Select Mode variable to leave place for handling chips using non-standard addresses. Signed-off-by: Guillaume LECERF <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-14mtd: cfi_probe: enter Auto Select Mode after filling cfi->cfiq membersGuillaume LECERF1-23/+24
Move the code to enter Auto Select Mode down to be able to use cfi->cfiq members to add support for chips using alternative sequence / unlock addresses. Signed-off-by: Guillaume LECERF <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-10mtd: cfi_cmdset_0002: Add reboot notifier for AMD flashesKevin Cernekee1-0/+56
Ensure that the flash device is in a quiescent state before rebooting. The implementation is closely modeled after the cfi_cmdset_0001 reboot notifier, commit 963a6fb0a0d336d0513083b7e4b5c3ff9d6d2061 . Signed-off-by: Kevin Cernekee <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-05-10mtd: fix a huge latency problem in the MTD CFI and LPDDR flash drivers.Stefani Seibold5-200/+198
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 <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-03-26Merge branch 'master' of ↵David Woodhouse2-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: drivers/mtd/nand/sh_flctl.c Maxim's patch to initialise sysfs attributes depends on the patch which actually adds sysfs_attr_init().
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 <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-02-25mtd: cfi: remove unneeded NULL checksJiri Slaby2-8/+4
In cfi_intelext_setup and cfi_amdstd_setup, mtd is never NULL. Remove unnecessary checks. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2010-02-09tree-wide: Assorted spelling fixesDaniel Mack1-1/+1
In particular, several occurances of funny versions of 'success', 'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address', 'beginning', 'desirable', 'separate' and 'necessary' are fixed. Signed-off-by: Daniel Mack <[email protected]> Cc: Joe Perches <[email protected]> Cc: Junio C Hamano <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2010-02-04tree wide: remove execute flag from .c filesSebastian Andrzej Siewior1-0/+0
Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2009-12-16Merge git://git.infradead.org/mtd-2.6Linus Torvalds4-28/+39
* git://git.infradead.org/mtd-2.6: (90 commits) jffs2: Fix long-standing bug with symlink garbage collection. mtd: OneNAND: Fix test of unsigned in onenand_otp_walk() mtd: cfi_cmdset_0002, fix lock imbalance Revert "mtd: move mxcnd_remove to .exit.text" mtd: m25p80: add support for Macronix MX25L4005A kmsg_dump: fix build for CONFIG_PRINTK=n mtd: nandsim: add support for 4KiB pages mtd: mtdoops: refactor as a kmsg_dumper mtd: mtdoops: make record size configurable mtd: mtdoops: limit the maximum mtd partition size mtd: mtdoops: keep track of used/unused pages in an array mtd: mtdoops: several minor cleanups core: Add kernel message dumper to call on oopses and panics mtd: add ARM pismo support mtd: pxa3xx_nand: Fix PIO data transfer mtd: nand: fix multi-chip suspend problem mtd: add support for switching old SST chips into QRY mode mtd: fix M29W800D dev_id and uaddr mtd: don't use PF_MEMALLOC mtd: Add bad block table overrides to Davinci NAND driver ... Fixed up conflicts (mostly trivial) in drivers/mtd/devices/m25p80.c drivers/mtd/maps/pcmciamtd.c drivers/mtd/nand/pxa3xx_nand.c kernel/printk.c
2009-12-10mtd: cfi_cmdset_0002, fix lock imbalanceJiri Slaby1-1/+0
Stanse found a double unlock in get_chip. get_chip is called with chip->mutex held and caller is responsible for unlocking it too. Do not unlock the lock in get_chip on a fail path. This would mean a double unlock. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2009-11-30mtd: add support for switching old SST chips into QRY modeGuillaume LECERF1-0/+7
SST 39VF160x/39VF320x and some old SST chips need a special command sequence to enter CFI QueRY mode [1]. This patch adds the relevant sequence to cfi_qry_mode_on(). Tested with 39VF3201. Signed-off-by: Guillaume LECERF <[email protected]> Signed-off-by: David Woodhouse <[email protected]>