aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2016-11-29 21:28:30 -0500
committerBrian Norris <computersforpeace@gmail.com>2016-11-29 21:28:30 -0500
commit0989b0909c1f86b8a4a76c0bee101cd017c4e259 (patch)
treee12d6ba197340410a94b7a2c476d5549d4f6b90e /include/linux/mtd
parentb2c4ba5cf712fede57dd3e15922ae647dde55a82 (diff)
parent8fcfba072420518fda4b2fe00a3f3c9c3e2774e2 (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/linux/mtd')
-rw-r--r--include/linux/mtd/nand.h30
1 files changed, 30 insertions, 0 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
578static 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 */
623struct nand_sdr_timings { 649struct 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;