Commit Graph

1312 Commits

Author SHA1 Message Date
Thomas Gleixner
50da7f6096 [MTD] cfi_cmdset_0001: Fix compiler warnings
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:59:55 +02:00
Artem B. Bityuckiy
515022870f [MTD] NAND nandsim: Use NAND_SKIP_BBT option
Use the new NAND_SKIP_BBT option instead of defining a fake scan_bbt
handler.

Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:59:33 +02:00
Lennert Buytenhek
167e1770e5 [MTD] ixp2000: Remove port setting code
Setting the slowport to 8-bit mode is something that ought to be
done in the IXP2000 generic code, not in the MTD map driver.  See
the description for ARM patch 2493/1 for an explanation.

http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=2493/1

Now that 2493/1 has been accepted and will be upstream soon, this
doesn't need to be done in the map driver anymore.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:58:49 +02:00
Domen Puncer
ff3bc4eb94 [MTD] Kernel Janitor fixes.
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:57:48 +02:00
Artem B. Bityuckiy
4d9527096e [JFFS2] Use function to manipulate superblock dirty flag
Use the corresponding function to mark Superblock dirty instead
of doing it directly.

Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:57:27 +02:00
Thomas Gleixner
3c45e00afc [MTD] Fix typo in Kconfig
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:56:24 +02:00
Ben Dooks
3e4ef3bb77 [MTD] NAND s3c2410: Simplify command handling
Updated with tglx's suggestion to simply the command invocation by
simply changing the address of the IO write area

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:55:50 +02:00
Nicolas Pitre
09c7933547 [MTD] cfi_cmdset_0001: Fix state after sync
oldstate has to be reset to FL_READY after sync completion.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:54:48 +02:00
Thomas Gleixner
3a70025047 [MTD] cfi_cmdset_0001: Fix the buggy status check.
The change makes the code endianess aware and replaces the bogus 
nested loop to or the status flags together.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:53:47 +02:00
Thomas Gleixner
c927cd3a22 [MTD] Add the reverse operation of cfi_build_cmd()
This is necessary to fix the broken status check in cfi_cmdset_0001

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:53:05 +02:00
Ben Dooks
fb6bb52ddd [MTD] plat-ram: removed extraneous debugging code
removed define of DEBUG
removed extraneous debugging code

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:52:23 +02:00
Ben Dooks
3b946e3f3d [MTD] NAND: Fixed unused loop variable
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:51:48 +02:00
Ben Dooks
0514cd9380 [MTD] Fixed signed 1bit bitfield
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:51:30 +02:00
Joern Engel
663259a44f [MTD] phram: Allow short reads.
Jffs2 apparently needs this.
Accept newline at the end of input.

Signed-off-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:51:00 +02:00
Joern Engel
711c11b78d [MTD] block2mtd: Remove copyright. Fix offset calculation
- Remove Gareth from the Copyrights (at his own request)
- Fix the "fscking embarrassment"

Signed-off-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:50:11 +02:00
David Vrabel
b4eab4b8d6 [MTD] Remove Elan-104NC
Remove support for the Arcom Elan-104NC since it's no longer being maintained.

Signed-off-by: David Vrabel <dvrabel@arcom.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:48:56 +02:00
Artem B. Bityuckiy
32f1a95d50 [JFFS2] Add symlink caching support.
Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:48:15 +02:00
Thomas Gleixner
20a6c21190 [MTD] NAND: Use cond_resched instead of msleep
Replace msleep by cond_resched. On machines with HZ=100 (e.g. ARM)
msleep slows down the operation by factor 10

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:47:55 +02:00
Artem B. Bityuckiy
31fbdf7aa5 [JFFS2] Fix NOR specific scan BUG
Fix fairly sad NOR-specific bug - during FS building ic->scan_dents
isn't zero, but jffs2_mark_node_obsolete() migt be called it tries to
finde the ic corresponding to ref - this requires ic->scan_dents = 0.

Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:47:15 +02:00
David Woodhouse
67e345d17f [JFFS2] Prevent ino cache removal for inodes in use
Don't remove inocache for inodes which are in read_inode() or
clear_inode() until they're done.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:46:14 +02:00
Pete Popov
002fa30170 [MTD] Replace all the Au1x mapping drivers with a simplified single driver
This driver does not have as many options but it's easier to maintain.
And, it turns out AMD never shipped boards with different flash densities.

Signed-off-by: Pete Popov <ppopov@pacbell.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:45:13 +02:00
Joern Engel
d30f11d225 [MTD] Use after free, found by the Coverity tool
Signed-off-by: Alexander Nyberg <alexn@dsv.su.se>
Signed-off-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:43:32 +02:00
Thomas Gleixner
3b88775c75 [MTD] NAND: Check command timeout
Check timeout while we wait for the command to finish. No worry about a
false result. This prevents deadlocking when detecting an unknown number
of chips and is useful for removable media too.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:42:49 +02:00
Thomas Gleixner
dfd6129440 [MTD] DiskOnChip: Wait for the command to finish.
Do not use the ready function here, as it might hang for ever. 
The result will show, whether the chip is there or not

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:42:18 +02:00
Ben Dooks
fdf2fd5274 [MTD] Sparse fixes
Fix sparse errors due to lack of address-space markers
Updated header comments
Small re-format of initialiser

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:41:32 +02:00
Artem B. Bityuckiy
4945079584 [MTD] Fix unregister_mtd_user() public function documentation.
Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:41:03 +02:00
Ben Dooks
7685359656 [MTD] Update BAST driver configuration
update the BAST driver config (which already supports the vr1000) to
be selected only if the vr1000 has been configured

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:40:28 +02:00
Nicolas Pitre
332d71f768 [MTD] Make OTP actually work.
The OTP code is rather broken without this.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:39:55 +02:00
Artem B. Bityuckiy
b81226c5d5 [JFFS2] Fix node lookup
Look the ref->next_phys field instead of ->next_in_ino to determine
if the block has more then one node.

Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:39:35 +02:00
Artem B. Bityuckiy
171650af9c [MTD] NAND: Fix bad block table scan for small page devices
Scan 1st and 2nd pages of SP devices for BB marker by default.
Fix more then one page scanning in create_bbt.c.

Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:38:33 +02:00
Nicolas Pitre
f16407d73e [MTD] Quiet unused variable warning
Signed-off-by: Nioclas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:37:52 +02:00
Kyungmin Park
0ea4a7558f [MTD] NAND: Early Manufacturer ID lookup
Move manufacturer ID search to display correct ID in case of buswidth
mismatch.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:36:30 +02:00
Ben Dooks
88ec7c50bf [MTD] Add SST 39VF1601 (MPF+) ID
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:34:00 +02:00
Ben Dooks
011b2a3627 [MTD] Fixup probing logic for single 16bit devices
The change to the generic probe to look for the
smallest width of chip first is causing some problems
on boards with a single 16bit device.

The problem seems to be the jedec_match() is truncating
the device-id read from the table to match against the
one read from the hardware, causing a match against the
partial id of some chips with 16bit IDs (such as the
SST39LF160)

This fixes things for my own board, but something may
need to be done if the same problem is exhibited for
chips with an 8bit ID

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:33:26 +02:00
Artem B. Bityuckiy
eeada24da8 [MTD] NAND: Read only OOB bytes during bad block scan
When scanning NAND for bad blocks, don't read the whole page, read
only needed OOB bytes instead. Also check the return code of the
nand_read_raw() function. Correctly free the this->bbt array in
case of failure. Tested with Large page NAND.

Fix debugging message.

Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:32:18 +02:00
Artem B. Bityuckiy
41ce921440 [MTD] NAND: Allow operation without bad block table
Small bugfix. Sometimes it may be handy not to have bbt.
So, this->bbt might be NULL.

Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:31:01 +02:00
Thomas Gleixner
0040bf382c [MTD] NAND: Skip bad block table scan on request
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:30:07 +02:00
Andrew Victor
2f82ce1eb6 [JFFS2] Use a single config option for write buffer support
This patch replaces the current CONFIG_JFFS2_FS_NAND, CONFIG_JFFS2_FS_NOR_ECC
and CONFIG_JFFS2_FS_DATAFLASH with a single configuration option -
CONFIG_JFFS2_FS_WRITEBUFFER.

The only functional change of this patch is that the slower div/mod
calculations for SECTOR_ADDR(), PAGE_DIV() and PAGE_MOD() are now always
used when CONFIG_JFFS2_FS_WRITEBUFFER is enabled.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:29:43 +02:00
Andrew Victor
8f15fd55f9 [JFFS2] Add support for JFFS2-on-Dataflash devices.
For Dataflash, can_mark_obsolete = false and the NAND write buffering
code (wbuf.c) is used.

Since the DataFlash chip will automatically erase pages when writing,
the cleanmarkers are not needed - so cleanmarker_oob = false and
cleanmarker_size = 0

DataFlash page-sizes are not a power of two (they're multiples of 528
bytes).  The SECTOR_ADDR macro (added in the previous core patch) is
replaced with a (slower) div/mod version if CONFIG_JFFS2_FS_DATAFLASH is
selected.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:28:03 +02:00
Andrew Victor
3be36675d4 [JFFS2] Core changes required to support JFFS2-on-Dataflash devices.
DataFlash page-sizes are not a power of two (they're multiples of 528
bytes).  There are a few places in JFFS2 code where sector_size is used
as a bitmask.  A new macro (SECTOR_ADDR) was defined to calculate these
sector addresses. For non-DataFlash devices, the original (faster)
bitmask operation is still used.

In scan.c, the EMPTY_SCAN_SIZE was a constant of 1024.
Since this could be larger than the sector size of the DataFlash, this
is now basically set to MIN(sector_size, 1024).

Addition of a jffs2_is_writebuffered() macro.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:27:09 +02:00
Nicolas Pitre
045e9a5d51 [MTD] Unabuse file-f_mode for OTP purpose
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:26:40 +02:00
Nicolas Pitre
31f4233bae [MTD] User interface to Protection Registers
This is implemented using a ioctl to switch the MTD char device into
one of the different OTP "modes", at which point read/write/seek can
operate on the selected OTP area.  Also some extra ioctls to query
for size and lock protection segments or groups.  Some example user
space utilities are provided.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:26:04 +02:00
Nicolas Pitre
f77814dd57 [MTD] Support for protection register support on Intel FLASH chips
This enables support for reading, writing and locking so called
"Protection Registers" present on some flash chips.
A subset of them are pre-programmed at the factory with a
unique set of values. The rest is user-programmable.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:25:23 +02:00
Estelle Hammache
67d9e95c39 [JFFS2] Prevent deadlock during write buffer recovery
Prevent deadlock when checking erased block for
space allocation during wbuf recovery.

Signed-off-by: Estelle Hammache <estelle.hammache@st.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:23:54 +02:00
Nicolas Pitre
72b56a2d7d [MTD] Add OTP basisc
add structure definition for OTP region info

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:22:37 +02:00
Jonas Holmberg
322b12eb57 [MTD] amd_flash: Fix chip ID clash
* Removed table entry for AM29BDS643D, since device ID clashes with AM29DL640G
and both chips support CFI.

Signed-off-by: Jonas Holmberg <jonas.holmberg@axis.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:21:41 +02:00
David Woodhouse
8aee6ac144 [JFFS2] Remove NAND dependencies for NOR FLASH
make NAND code work on NOR flash again

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:20:43 +02:00
Thomas Gleixner
f29a4b86f5 [MTD] DiskOnChip: big endian fix for NFTL devices
Make NFTL devices work on big endian machines.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:18:59 +02:00
Thomas Gleixner
39605398cd [MTD] DiskOnChip code cleanup
Remove commented ugliness

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:17:42 +02:00
Thomas Gleixner
651078ba3a [MTD] DiskOnChip use CONFIG_ options instead of random symbols
Using the CONFIG_ options from KConfig seems to work better :8

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-05-23 12:17:03 +02:00