Commit Graph
20 Commits
Author SHA1 Message Date
Adrian Hunter c36c46d53b [MTD] [OneNAND] Exit loop only when column start with 0
The JFFS2 requests OOB function from column 0.
But the oobtest in nand-tests doesn't.
So we only exit loop only when column start with 0.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-04-25 11:09:37 +01:00
Adrian Hunter 7f762ab24c [JFFS2] Disable summary after wbuf recovery
After a write error, any data in the write buffer must
be relocated.  This is handled by the jffs2_wbuf_recover
function.  This function does not fix up the erase block
summary information that is collected for writing at the
end of the block, which results in an incorrect summary
(or BUG if the summary was found to be empty).

As the summary is not essential (it is an optimisation),
it may be disabled for the current erase block when this
situation arises.  This patch does that.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-04-17 13:56:44 -04:00
Adrian Hunter 99c2594f0e [JFFS2] Prevent list corruption when handling write errors
If a write error occurs, the affected block is placed on the
bad_used_list.  In the case that the write error occured
when writing summary data the block was also being placed on
the dirty_list, which caused list corruption and ultimately
a soft lockup in jffs2_mark_node_obsolete. This fixes that.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-04-17 13:56:23 -04:00
Adrian Hunter a5ac8aeb29 [MTD] nandsim: enhance nandsim to allow arbitrary NAND size
A new module parameter has been added called 'overridesize',
which overrides the size that would be determined by the
ID bytes. 'overridesize' is specified in erase blocks and
as the exponent of a power of two e.g. 5 means a size of
32 erase blocks.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-04-17 13:55:55 -04:00
Adrian Hunter 57aa6b545f [MTD] nandsim: Enhance nandsim optionally to report wear information
A new module parameter 'rptwear' specifies how many erases between
reporting wear information.  Zero means never.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-04-17 13:55:29 -04:00
Adrian Hunter 514087e74f [MTD] nandsim: enhance nandsim to simulate flash errors
New module parameters have been added to nandsim to
simulate:

        bitflips        random bit flips
        badblocks       blocks that are initially marked bad
        weakblocks      blocks that fail to erase after a
                        small number of erase cycles
        weakpages       pages that fail to write after a
                        small number of successful writes
        gravepages      pages that fail to read after a
                        small number of successful reads

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-04-17 13:55:08 -04:00
Adrian Hunter 2b77a0ed54 [MTD] nandsim: add partition capability to nandsim
Enhance nandsim to be able to create more than 1 partition.
A new module parameter 'parts' may be used to specify partition
sizes.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-04-17 13:54:50 -04:00
Adrian Hunter 81280d5879 [MTD] [OneNAND] add Nokia Copyright and a credit
add Nokia Copyright and a credit

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-03-09 08:05:57 +00:00
Adrian Hunter 74641d7527 [MTD] Correct partition failed erase address
If an erase operation fails, the address at which the
failure occurred is returned by the driver.  The MTD
partition must adjust this address (by subtracting the
partition offset) before returning to the caller.
This was not happening, which caused JFFS2 to mark
the wrong block bad!

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-03-08 10:45:04 +00:00
Adrian Hunter 480b9dfb1f [MTD] OneNAND: Invalidate bufferRAM after erase
OneNAND has internal bufferRAMs.  The driver keeps track of
what is in the bufferRAM to save having to load from the
NAND core.  After an erase operation, the driver must
mark bufferRAM invalid if it refers to the erased block.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-02-09 15:16:55 +00:00
Adrian Hunter 0373615579 [MTD] [NAND] Correctly validate out-of-band offset and length
Add checks to ensure that out-of-band reads and writes are
not attempted with an invalid offset or length.  Specifically,
the offset must be less than the size of oob for a page
and the length must not go beyond the size of the device.
Additionally the checks must adjust for auto-placement
(MTD_OOB_AUTO) of oob data.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2007-02-09 15:02:40 +00:00
Adrian Hunter cde36b37d6 [MTD] OneNAND: Select correct chip's bufferRAM for DDP
OneNAND double-density package (DDP) has two chips, each with
their own bufferRAM.  The driver will skip loading data from
the NAND core if the data can be found in a bufferRAM, however
in that case, the correct chip's bufferRAM must be selected
before reading from bufferRAM.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
2007-02-09 09:42:42 +09:00
Adrian Hunter 81f38e1123 [MTD] OneNAND: Subpage write returned incorrect length written
When a write is done, the length written is returned.  When a
single subpage is written the length returned should be the
subpage size, however the page size was being returned.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
2007-02-07 10:55:23 +09:00
Adrian Hunter 52e4200a6d [MTD] OneNAND: Do not allow oob write past end of page
OneNAND can write oob to successive pages, but NAND
does not do that.  For compatibility, disallow OneNAND
from writing past the end of the page.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
2007-02-06 09:15:39 +09:00
Adrian Hunter a5e7c7b447 [MTD] OneNAND: Add support for auto-placement of out-of-band data
Enable the use of oob operation mode MTD_OOB_AUTO with OneNAND.
Note that MTD_OOB_RAW is still not supported.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
2007-02-01 09:28:18 +09:00
Adrian Hunter 8b29c0b6eb [MTD] OneNAND: Amend write-verify to compare to original buffer
When write-verify is enabled (CONFIG_MTD_ONENAND_VERIFY_WRITE),
the data written is read back and compared.  The comparison
was being made between dataRAM buffers, but this does not
verify that the data made it to the dataRAM correctly in
the first place.  This patch amends write-verify to
compare back to the original buffer.  It also now verifies
sub-page writes.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
2007-01-25 14:06:33 +09:00
Adrian Hunter ec255e3406 [MTD] OneNAND: Check first or second pages for bad block information
OneNAND records bad block information in the out-of-band area of either the first or second page of a block.  Due to a logic error, only the first page was being checked.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
2007-01-22 21:30:31 +09:00
Adrian Hunter f00b0046d2 [MTD] OneNAND: Free the bad block table when the device is released
OneNAND does 2 memory allocations for bad block information.
Only one of them was being freed.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
2007-01-22 21:27:56 +09:00
Adrian Hunter 0fc2ccea4c [MTD] OneNAND: Handle DDP chip boundary during read-while-load
The read-while-load method of reading from OneNAND needs to allow
for the change of bufferRAM address at the boundary between the
two chips in a double density (DDP) device.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
2007-01-10 15:05:22 +02:00
Adrian Hunter a8de85d557 [MTD] OneNAND: Implement read-while-load
Read-while-load enables higher performance read operations.

Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
2007-01-10 14:58:42 +02:00