diff options
| author | Brian Norris <computersforpeace@gmail.com> | 2016-11-29 21:28:30 -0500 |
|---|---|---|
| committer | Brian Norris <computersforpeace@gmail.com> | 2016-11-29 21:28:30 -0500 |
| commit | 0989b0909c1f86b8a4a76c0bee101cd017c4e259 (patch) | |
| tree | e12d6ba197340410a94b7a2c476d5549d4f6b90e /include | |
| parent | b2c4ba5cf712fede57dd3e15922ae647dde55a82 (diff) | |
| parent | 8fcfba072420518fda4b2fe00a3f3c9c3e2774e2 (diff) | |
Merge tag 'nand/for-4.10' of github.com:linux-nand/linux
From Boris Brezillon:
"""
This pull request contains the following notable changes:
- new tango NAND controller driver
- new ox820 NAND controller driver
- addition of a new full-ID entry in the nand_ids table
- rework of the s3c240 driver to support DT
- extension of the nand_sdr_timings to expose tCCS, tPROG and tR
- addition of a new flag to ask the core to wait for tCCS when sending
a RNDIN/RNDOUT command
- addition of a new flag to ask the core to let the controller driver
send the READ/PROGPAGE command
This pull request also contains minor fixes/cleanup/cosmetic changes:
- properly support 512 ECC step size in the sunxi driver
- improve the error messages in the pxa probe path
- fix module autoload in the omap2 driver
- cleanup of several nand drivers to return nand_scan{_tail}() error
code instead of returning -EIO
- various cleanups in the denali driver
- cleanups in the ooblayout handling (MTD core)
- fix an error check in nandsim
"""
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/mtd/nand.h | 30 | ||||
| -rw-r--r-- | include/linux/platform_data/mtd-nand-s3c2410.h | 7 |
2 files changed, 35 insertions, 2 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index d8905a229f34..c5f3a012ae62 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -142,6 +142,12 @@ enum nand_ecc_algo { | |||
| 142 | */ | 142 | */ |
| 143 | #define NAND_ECC_GENERIC_ERASED_CHECK BIT(0) | 143 | #define NAND_ECC_GENERIC_ERASED_CHECK BIT(0) |
| 144 | #define NAND_ECC_MAXIMIZE BIT(1) | 144 | #define NAND_ECC_MAXIMIZE BIT(1) |
| 145 | /* | ||
| 146 | * If your controller already sends the required NAND commands when | ||
| 147 | * reading or writing a page, then the framework is not supposed to | ||
| 148 | * send READ0 and SEQIN/PAGEPROG respectively. | ||
| 149 | */ | ||
| 150 | #define NAND_ECC_CUSTOM_PAGE_ACCESS BIT(2) | ||
| 145 | 151 | ||
| 146 | /* Bit mask for flags passed to do_nand_read_ecc */ | 152 | /* Bit mask for flags passed to do_nand_read_ecc */ |
| 147 | #define NAND_GET_DEVICE 0x80 | 153 | #define NAND_GET_DEVICE 0x80 |
| @@ -186,6 +192,7 @@ enum nand_ecc_algo { | |||
| 186 | /* Macros to identify the above */ | 192 | /* Macros to identify the above */ |
| 187 | #define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG)) | 193 | #define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG)) |
| 188 | #define NAND_HAS_SUBPAGE_READ(chip) ((chip->options & NAND_SUBPAGE_READ)) | 194 | #define NAND_HAS_SUBPAGE_READ(chip) ((chip->options & NAND_SUBPAGE_READ)) |
| 195 | #define NAND_HAS_SUBPAGE_WRITE(chip) !((chip)->options & NAND_NO_SUBPAGE_WRITE) | ||
| 189 | 196 | ||
| 190 | /* Non chip related options */ | 197 | /* Non chip related options */ |
| 191 | /* This option skips the bbt scan during initialization. */ | 198 | /* This option skips the bbt scan during initialization. */ |
| @@ -210,6 +217,16 @@ enum nand_ecc_algo { | |||
| 210 | */ | 217 | */ |
| 211 | #define NAND_USE_BOUNCE_BUFFER 0x00100000 | 218 | #define NAND_USE_BOUNCE_BUFFER 0x00100000 |
| 212 | 219 | ||
| 220 | /* | ||
| 221 | * In case your controller is implementing ->cmd_ctrl() and is relying on the | ||
| 222 | * default ->cmdfunc() implementation, you may want to let the core handle the | ||
| 223 | * tCCS delay which is required when a column change (RNDIN or RNDOUT) is | ||
| 224 | * requested. | ||
| 225 | * If your controller already takes care of this delay, you don't need to set | ||
| 226 | * this flag. | ||
| 227 | */ | ||
| 228 | #define NAND_WAIT_TCCS 0x00200000 | ||
| 229 | |||
| 213 | /* Options set by nand scan */ | 230 | /* Options set by nand scan */ |
| 214 | /* Nand scan has allocated controller struct */ | 231 | /* Nand scan has allocated controller struct */ |
| 215 | #define NAND_CONTROLLER_ALLOC 0x80000000 | 232 | #define NAND_CONTROLLER_ALLOC 0x80000000 |
| @@ -558,6 +575,11 @@ struct nand_ecc_ctrl { | |||
| 558 | int page); | 575 | int page); |
| 559 | }; | 576 | }; |
| 560 | 577 | ||
| 578 | static inline int nand_standard_page_accessors(struct nand_ecc_ctrl *ecc) | ||
| 579 | { | ||
| 580 | return !(ecc->options & NAND_ECC_CUSTOM_PAGE_ACCESS); | ||
| 581 | } | ||
| 582 | |||
| 561 | /** | 583 | /** |
| 562 | * struct nand_buffers - buffer structure for read/write | 584 | * struct nand_buffers - buffer structure for read/write |
| 563 | * @ecccalc: buffer pointer for calculated ECC, size is oobsize. | 585 | * @ecccalc: buffer pointer for calculated ECC, size is oobsize. |
| @@ -584,6 +606,10 @@ struct nand_buffers { | |||
| 584 | * | 606 | * |
| 585 | * All these timings are expressed in picoseconds. | 607 | * All these timings are expressed in picoseconds. |
| 586 | * | 608 | * |
| 609 | * @tBERS_max: Block erase time | ||
| 610 | * @tCCS_min: Change column setup time | ||
| 611 | * @tPROG_max: Page program time | ||
| 612 | * @tR_max: Page read time | ||
| 587 | * @tALH_min: ALE hold time | 613 | * @tALH_min: ALE hold time |
| 588 | * @tADL_min: ALE to data loading time | 614 | * @tADL_min: ALE to data loading time |
| 589 | * @tALS_min: ALE setup time | 615 | * @tALS_min: ALE setup time |
| @@ -621,6 +647,10 @@ struct nand_buffers { | |||
| 621 | * @tWW_min: WP# transition to WE# low | 647 | * @tWW_min: WP# transition to WE# low |
| 622 | */ | 648 | */ |
| 623 | struct nand_sdr_timings { | 649 | struct nand_sdr_timings { |
| 650 | u32 tBERS_max; | ||
| 651 | u32 tCCS_min; | ||
| 652 | u32 tPROG_max; | ||
| 653 | u32 tR_max; | ||
| 624 | u32 tALH_min; | 654 | u32 tALH_min; |
| 625 | u32 tADL_min; | 655 | u32 tADL_min; |
| 626 | u32 tALS_min; | 656 | u32 tALS_min; |
diff --git a/include/linux/platform_data/mtd-nand-s3c2410.h b/include/linux/platform_data/mtd-nand-s3c2410.h index c55e42ee57fa..f01659026b26 100644 --- a/include/linux/platform_data/mtd-nand-s3c2410.h +++ b/include/linux/platform_data/mtd-nand-s3c2410.h | |||
| @@ -12,9 +12,10 @@ | |||
| 12 | #ifndef __MTD_NAND_S3C2410_H | 12 | #ifndef __MTD_NAND_S3C2410_H |
| 13 | #define __MTD_NAND_S3C2410_H | 13 | #define __MTD_NAND_S3C2410_H |
| 14 | 14 | ||
| 15 | #include <linux/mtd/nand.h> | ||
| 16 | |||
| 15 | /** | 17 | /** |
| 16 | * struct s3c2410_nand_set - define a set of one or more nand chips | 18 | * struct s3c2410_nand_set - define a set of one or more nand chips |
| 17 | * @disable_ecc: Entirely disable ECC - Dangerous | ||
| 18 | * @flash_bbt: Openmoko u-boot can create a Bad Block Table | 19 | * @flash_bbt: Openmoko u-boot can create a Bad Block Table |
| 19 | * Setting this flag will allow the kernel to | 20 | * Setting this flag will allow the kernel to |
| 20 | * look for it at boot time and also skip the NAND | 21 | * look for it at boot time and also skip the NAND |
| @@ -31,7 +32,6 @@ | |||
| 31 | * a warning at boot time. | 32 | * a warning at boot time. |
| 32 | */ | 33 | */ |
| 33 | struct s3c2410_nand_set { | 34 | struct s3c2410_nand_set { |
| 34 | unsigned int disable_ecc:1; | ||
| 35 | unsigned int flash_bbt:1; | 35 | unsigned int flash_bbt:1; |
| 36 | 36 | ||
| 37 | unsigned int options; | 37 | unsigned int options; |
| @@ -40,6 +40,7 @@ struct s3c2410_nand_set { | |||
| 40 | char *name; | 40 | char *name; |
| 41 | int *nr_map; | 41 | int *nr_map; |
| 42 | struct mtd_partition *partitions; | 42 | struct mtd_partition *partitions; |
| 43 | struct device_node *of_node; | ||
| 43 | }; | 44 | }; |
| 44 | 45 | ||
| 45 | struct s3c2410_platform_nand { | 46 | struct s3c2410_platform_nand { |
| @@ -51,6 +52,8 @@ struct s3c2410_platform_nand { | |||
| 51 | 52 | ||
| 52 | unsigned int ignore_unset_ecc:1; | 53 | unsigned int ignore_unset_ecc:1; |
| 53 | 54 | ||
| 55 | nand_ecc_modes_t ecc_mode; | ||
| 56 | |||
| 54 | int nr_sets; | 57 | int nr_sets; |
| 55 | struct s3c2410_nand_set *sets; | 58 | struct s3c2410_nand_set *sets; |
| 56 | 59 | ||
