diff options
| author | Thomas Gleixner <tglx@cruncher.tec.linutronix.de> | 2006-06-20 14:05:05 -0400 |
|---|---|---|
| committer | David Woodhouse <dwmw2@infradead.org> | 2006-06-20 15:31:24 -0400 |
| commit | 7bc3312bef4d6f220812500c0de7868fb7625a41 (patch) | |
| tree | 9ad49e850cdfe9868a19a37681bbf4d403e47ed3 /include/linux/mtd | |
| parent | 7e4178f90eec862affc97469118d5008bd1b5bda (diff) | |
[MTD] NAND: Fix breakage all over the place
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>
Diffstat (limited to 'include/linux/mtd')
| -rw-r--r-- | include/linux/mtd/nand.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index bf2ce68901f5..a30969eb9afe 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -63,18 +63,21 @@ extern void nand_release (struct mtd_info *mtd); | |||
| 63 | */ | 63 | */ |
| 64 | #define NAND_CMD_READ0 0 | 64 | #define NAND_CMD_READ0 0 |
| 65 | #define NAND_CMD_READ1 1 | 65 | #define NAND_CMD_READ1 1 |
| 66 | #define NAND_CMD_RNDOUT 5 | ||
| 66 | #define NAND_CMD_PAGEPROG 0x10 | 67 | #define NAND_CMD_PAGEPROG 0x10 |
| 67 | #define NAND_CMD_READOOB 0x50 | 68 | #define NAND_CMD_READOOB 0x50 |
| 68 | #define NAND_CMD_ERASE1 0x60 | 69 | #define NAND_CMD_ERASE1 0x60 |
| 69 | #define NAND_CMD_STATUS 0x70 | 70 | #define NAND_CMD_STATUS 0x70 |
| 70 | #define NAND_CMD_STATUS_MULTI 0x71 | 71 | #define NAND_CMD_STATUS_MULTI 0x71 |
| 71 | #define NAND_CMD_SEQIN 0x80 | 72 | #define NAND_CMD_SEQIN 0x80 |
| 73 | #define NAND_CMD_RNDIN 0x85 | ||
| 72 | #define NAND_CMD_READID 0x90 | 74 | #define NAND_CMD_READID 0x90 |
| 73 | #define NAND_CMD_ERASE2 0xd0 | 75 | #define NAND_CMD_ERASE2 0xd0 |
| 74 | #define NAND_CMD_RESET 0xff | 76 | #define NAND_CMD_RESET 0xff |
| 75 | 77 | ||
| 76 | /* Extended commands for large page devices */ | 78 | /* Extended commands for large page devices */ |
| 77 | #define NAND_CMD_READSTART 0x30 | 79 | #define NAND_CMD_READSTART 0x30 |
| 80 | #define NAND_CMD_RNDOUTSTART 0xE0 | ||
| 78 | #define NAND_CMD_CACHEDPROG 0x15 | 81 | #define NAND_CMD_CACHEDPROG 0x15 |
| 79 | 82 | ||
| 80 | /* Extended commands for AG-AND device */ | 83 | /* Extended commands for AG-AND device */ |
| @@ -250,6 +253,13 @@ struct nand_ecc_ctrl { | |||
| 250 | void (*write_page)(struct mtd_info *mtd, | 253 | void (*write_page)(struct mtd_info *mtd, |
| 251 | struct nand_chip *chip, | 254 | struct nand_chip *chip, |
| 252 | const uint8_t *buf); | 255 | const uint8_t *buf); |
| 256 | int (*read_oob)(struct mtd_info *mtd, | ||
| 257 | struct nand_chip *chip, | ||
| 258 | int page, | ||
| 259 | int sndcmd); | ||
| 260 | int (*write_oob)(struct mtd_info *mtd, | ||
| 261 | struct nand_chip *chip, | ||
| 262 | int page); | ||
| 253 | }; | 263 | }; |
| 254 | 264 | ||
| 255 | /** | 265 | /** |
| @@ -339,7 +349,7 @@ struct nand_chip { | |||
| 339 | unsigned int ctrl); | 349 | unsigned int ctrl); |
| 340 | int (*dev_ready)(struct mtd_info *mtd); | 350 | int (*dev_ready)(struct mtd_info *mtd); |
| 341 | void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); | 351 | void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); |
| 342 | int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this, int state); | 352 | int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); |
| 343 | void (*erase_cmd)(struct mtd_info *mtd, int page); | 353 | void (*erase_cmd)(struct mtd_info *mtd, int page); |
| 344 | int (*scan_bbt)(struct mtd_info *mtd); | 354 | int (*scan_bbt)(struct mtd_info *mtd); |
| 345 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); | 355 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); |
