diff options
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r-- | include/linux/mtd/nand.h | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 9e6c8f9f306e..32f8612469d8 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -219,6 +219,9 @@ struct nand_chip; | |||
219 | /* ONFI feature address */ | 219 | /* ONFI feature address */ |
220 | #define ONFI_FEATURE_ADDR_TIMING_MODE 0x1 | 220 | #define ONFI_FEATURE_ADDR_TIMING_MODE 0x1 |
221 | 221 | ||
222 | /* Vendor-specific feature address (Micron) */ | ||
223 | #define ONFI_FEATURE_ADDR_READ_RETRY 0x89 | ||
224 | |||
222 | /* ONFI subfeature parameters length */ | 225 | /* ONFI subfeature parameters length */ |
223 | #define ONFI_SUBFEATURE_PARAM_LEN 4 | 226 | #define ONFI_SUBFEATURE_PARAM_LEN 4 |
224 | 227 | ||
@@ -279,16 +282,17 @@ struct nand_onfi_params { | |||
279 | __le16 io_pin_capacitance_typ; | 282 | __le16 io_pin_capacitance_typ; |
280 | __le16 input_pin_capacitance_typ; | 283 | __le16 input_pin_capacitance_typ; |
281 | u8 input_pin_capacitance_max; | 284 | u8 input_pin_capacitance_max; |
282 | u8 driver_strenght_support; | 285 | u8 driver_strength_support; |
283 | __le16 t_int_r; | 286 | __le16 t_int_r; |
284 | __le16 t_ald; | 287 | __le16 t_ald; |
285 | u8 reserved4[7]; | 288 | u8 reserved4[7]; |
286 | 289 | ||
287 | /* vendor */ | 290 | /* vendor */ |
288 | u8 reserved5[90]; | 291 | __le16 vendor_revision; |
292 | u8 vendor[88]; | ||
289 | 293 | ||
290 | __le16 crc; | 294 | __le16 crc; |
291 | } __attribute__((packed)); | 295 | } __packed; |
292 | 296 | ||
293 | #define ONFI_CRC_BASE 0x4F4E | 297 | #define ONFI_CRC_BASE 0x4F4E |
294 | 298 | ||
@@ -326,6 +330,26 @@ struct onfi_ext_param_page { | |||
326 | */ | 330 | */ |
327 | } __packed; | 331 | } __packed; |
328 | 332 | ||
333 | struct nand_onfi_vendor_micron { | ||
334 | u8 two_plane_read; | ||
335 | u8 read_cache; | ||
336 | u8 read_unique_id; | ||
337 | u8 dq_imped; | ||
338 | u8 dq_imped_num_settings; | ||
339 | u8 dq_imped_feat_addr; | ||
340 | u8 rb_pulldown_strength; | ||
341 | u8 rb_pulldown_strength_feat_addr; | ||
342 | u8 rb_pulldown_strength_num_settings; | ||
343 | u8 otp_mode; | ||
344 | u8 otp_page_start; | ||
345 | u8 otp_data_prot_addr; | ||
346 | u8 otp_num_pages; | ||
347 | u8 otp_feat_addr; | ||
348 | u8 read_retry_options; | ||
349 | u8 reserved[72]; | ||
350 | u8 param_revision; | ||
351 | } __packed; | ||
352 | |||
329 | /** | 353 | /** |
330 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices | 354 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices |
331 | * @lock: protection lock | 355 | * @lock: protection lock |
@@ -432,6 +456,8 @@ struct nand_buffers { | |||
432 | * flash device. | 456 | * flash device. |
433 | * @read_byte: [REPLACEABLE] read one byte from the chip | 457 | * @read_byte: [REPLACEABLE] read one byte from the chip |
434 | * @read_word: [REPLACEABLE] read one word from the chip | 458 | * @read_word: [REPLACEABLE] read one word from the chip |
459 | * @write_byte: [REPLACEABLE] write a single byte to the chip on the | ||
460 | * low 8 I/O lines | ||
435 | * @write_buf: [REPLACEABLE] write data from the buffer to the chip | 461 | * @write_buf: [REPLACEABLE] write data from the buffer to the chip |
436 | * @read_buf: [REPLACEABLE] read data from the chip into the buffer | 462 | * @read_buf: [REPLACEABLE] read data from the chip into the buffer |
437 | * @select_chip: [REPLACEABLE] select chip nr | 463 | * @select_chip: [REPLACEABLE] select chip nr |
@@ -451,6 +477,8 @@ struct nand_buffers { | |||
451 | * commands to the chip. | 477 | * commands to the chip. |
452 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on | 478 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on |
453 | * ready. | 479 | * ready. |
480 | * @setup_read_retry: [FLASHSPECIFIC] flash (vendor) specific function for | ||
481 | * setting the read-retry mode. Mostly needed for MLC NAND. | ||
454 | * @ecc: [BOARDSPECIFIC] ECC control structure | 482 | * @ecc: [BOARDSPECIFIC] ECC control structure |
455 | * @buffers: buffer structure for read/write | 483 | * @buffers: buffer structure for read/write |
456 | * @hwcontrol: platform-specific hardware control structure | 484 | * @hwcontrol: platform-specific hardware control structure |
@@ -497,6 +525,7 @@ struct nand_buffers { | |||
497 | * non 0 if ONFI supported. | 525 | * non 0 if ONFI supported. |
498 | * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is | 526 | * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is |
499 | * supported, 0 otherwise. | 527 | * supported, 0 otherwise. |
528 | * @read_retries: [INTERN] the number of read retry modes supported | ||
500 | * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand | 529 | * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand |
501 | * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand | 530 | * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand |
502 | * @bbt: [INTERN] bad block table pointer | 531 | * @bbt: [INTERN] bad block table pointer |
@@ -521,6 +550,7 @@ struct nand_chip { | |||
521 | 550 | ||
522 | uint8_t (*read_byte)(struct mtd_info *mtd); | 551 | uint8_t (*read_byte)(struct mtd_info *mtd); |
523 | u16 (*read_word)(struct mtd_info *mtd); | 552 | u16 (*read_word)(struct mtd_info *mtd); |
553 | void (*write_byte)(struct mtd_info *mtd, uint8_t byte); | ||
524 | void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); | 554 | void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
525 | void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); | 555 | void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); |
526 | void (*select_chip)(struct mtd_info *mtd, int chip); | 556 | void (*select_chip)(struct mtd_info *mtd, int chip); |
@@ -544,6 +574,7 @@ struct nand_chip { | |||
544 | int feature_addr, uint8_t *subfeature_para); | 574 | int feature_addr, uint8_t *subfeature_para); |
545 | int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip, | 575 | int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip, |
546 | int feature_addr, uint8_t *subfeature_para); | 576 | int feature_addr, uint8_t *subfeature_para); |
577 | int (*setup_read_retry)(struct mtd_info *mtd, int retry_mode); | ||
547 | 578 | ||
548 | int chip_delay; | 579 | int chip_delay; |
549 | unsigned int options; | 580 | unsigned int options; |
@@ -568,6 +599,8 @@ struct nand_chip { | |||
568 | int onfi_version; | 599 | int onfi_version; |
569 | struct nand_onfi_params onfi_params; | 600 | struct nand_onfi_params onfi_params; |
570 | 601 | ||
602 | int read_retries; | ||
603 | |||
571 | flstate_t state; | 604 | flstate_t state; |
572 | 605 | ||
573 | uint8_t *oob_poi; | 606 | uint8_t *oob_poi; |
@@ -600,6 +633,8 @@ struct nand_chip { | |||
600 | #define NAND_MFR_AMD 0x01 | 633 | #define NAND_MFR_AMD 0x01 |
601 | #define NAND_MFR_MACRONIX 0xc2 | 634 | #define NAND_MFR_MACRONIX 0xc2 |
602 | #define NAND_MFR_EON 0x92 | 635 | #define NAND_MFR_EON 0x92 |
636 | #define NAND_MFR_SANDISK 0x45 | ||
637 | #define NAND_MFR_INTEL 0x89 | ||
603 | 638 | ||
604 | /* The maximum expected count of bytes in the NAND ID sequence */ | 639 | /* The maximum expected count of bytes in the NAND ID sequence */ |
605 | #define NAND_MAX_ID_LEN 8 | 640 | #define NAND_MAX_ID_LEN 8 |