diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 22:31:43 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 22:31:43 -0500 |
| commit | 82cb6acea4d10fa4080612c58deb63993f558e5a (patch) | |
| tree | ba6f0b8281e37c7e1830ef2162d38d8a2bc2fbb7 /include/linux | |
| parent | 0d522ee7499e4abe7189b2f1728e838959b8ddde (diff) | |
| parent | 885d71e5838f68d5dbee92ab952cc90ad6c1dc6b (diff) | |
Merge tag 'for-linus-20131112' of git://git.infradead.org/linux-mtd
Pull MTD changes from Brian Norris:
- Unify some compile-time differences so that we have fewer uses of
#ifdef CONFIG_OF in atmel_nand
- Other general cleanups (removing unused functions, options,
variables, fields; use correct interfaces)
- Fix BUG() for new odd-sized NAND, which report non-power-of-2
dimensions via ONFI
- Miscellaneous driver fixes (SPI NOR flash; BCM47xx NAND flash; etc.)
- Improve differentiation between SLC and MLC NAND -- this clarifies an
ABI issue regarding the MTD "type" (in sysfs and in the MEMGETINFO
ioctl), where the MTD_MLCNANDFLASH type was present but
inconsistently used
- Extend GPMI NAND to support multi-chip-select NAND for some platforms
- Many improvements to the OMAP2/3 NAND driver, including an expanded
DT binding to bring us closer to mainline support for some OMAP
systems
- Fix a deadlock in the error path of the Atmel NAND driver probe
- Correct the error codes from MTD mmap() to conform to POSIX and the
Linux Programmer's Manual. This is an acknowledged change in the MTD
ABI, but I can't imagine somebody relying on the non-standard -ENOSYS
error code specifically. Am I just being unimaginative? :)
- Fix a few important GPMI NAND bugs (one regression from 3.12 and one
long-standing race condition)
- More? Read the log!
* tag 'for-linus-20131112' of git://git.infradead.org/linux-mtd: (98 commits)
mtd: gpmi: fix the NULL pointer
mtd: gpmi: fix kernel BUG due to racing DMA operations
mtd: mtdchar: return expected errors on mmap() call
mtd: gpmi: only scan two chips for imx6
mtd: gpmi: Use devm_kzalloc()
mtd: atmel_nand: fix bug driver will in a dead lock if no nand detected
mtd: nand: use a local variable to simplify the nand_scan_tail
mtd: nand: remove deprecated IRQF_DISABLED
mtd: dataflash: Say if we find a device we don't support
mtd: nand: omap: fix error return code in omap_nand_probe()
mtd: nand_bbt: kill NAND_BBT_SCANALLPAGES
mtd: m25p80: fixup device removal failure path
mtd: mxc_nand: Include linux/of.h header
mtd: remove duplicated include from mtdcore.c
mtd: m25p80: add support for Macronix mx25l3255e
mtd: nand: omap: remove selection of BCH ecc-scheme via KConfig
mtd: nand: omap: updated devm_xx for all resource allocation and free calls
mtd: nand: omap: use drivers/mtd/nand/nand_bch.c wrapper for BCH ECC instead of lib/bch.c
mtd: nand: omap: clean-up ecc layout for BCH ecc schemes
mtd: nand: omap2: clean-up BCHx_HW and BCHx_SW ECC configurations in device_probe
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mtd/bbm.h | 2 | ||||
| -rw-r--r-- | include/linux/mtd/map.h | 4 | ||||
| -rw-r--r-- | include/linux/mtd/mtd.h | 8 | ||||
| -rw-r--r-- | include/linux/mtd/nand.h | 16 | ||||
| -rw-r--r-- | include/linux/of_mtd.h | 21 | ||||
| -rw-r--r-- | include/linux/platform_data/mtd-nand-omap2.h | 18 |
6 files changed, 50 insertions, 19 deletions
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index 95fc482cef36..36bb6a503f19 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
| @@ -91,8 +91,6 @@ struct nand_bbt_descr { | |||
| 91 | * with NAND_BBT_CREATE. | 91 | * with NAND_BBT_CREATE. |
| 92 | */ | 92 | */ |
| 93 | #define NAND_BBT_CREATE_EMPTY 0x00000400 | 93 | #define NAND_BBT_CREATE_EMPTY 0x00000400 |
| 94 | /* Search good / bad pattern through all pages of a block */ | ||
| 95 | #define NAND_BBT_SCANALLPAGES 0x00000800 | ||
| 96 | /* Write bbt if neccecary */ | 94 | /* Write bbt if neccecary */ |
| 97 | #define NAND_BBT_WRITE 0x00002000 | 95 | #define NAND_BBT_WRITE 0x00002000 |
| 98 | /* Read and write back block contents when writing bbt */ | 96 | /* Read and write back block contents when writing bbt */ |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 4b02512e421c..5f487d776411 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
| @@ -365,7 +365,7 @@ static inline map_word map_word_load_partial(struct map_info *map, map_word orig | |||
| 365 | bitpos = (map_bankwidth(map)-1-i)*8; | 365 | bitpos = (map_bankwidth(map)-1-i)*8; |
| 366 | #endif | 366 | #endif |
| 367 | orig.x[0] &= ~(0xff << bitpos); | 367 | orig.x[0] &= ~(0xff << bitpos); |
| 368 | orig.x[0] |= buf[i-start] << bitpos; | 368 | orig.x[0] |= (unsigned long)buf[i-start] << bitpos; |
| 369 | } | 369 | } |
| 370 | } | 370 | } |
| 371 | return orig; | 371 | return orig; |
| @@ -384,7 +384,7 @@ static inline map_word map_word_ff(struct map_info *map) | |||
| 384 | 384 | ||
| 385 | if (map_bankwidth(map) < MAP_FF_LIMIT) { | 385 | if (map_bankwidth(map) < MAP_FF_LIMIT) { |
| 386 | int bw = 8 * map_bankwidth(map); | 386 | int bw = 8 * map_bankwidth(map); |
| 387 | r.x[0] = (1 << bw) - 1; | 387 | r.x[0] = (1UL << bw) - 1; |
| 388 | } else { | 388 | } else { |
| 389 | for (i=0; i<map_words(map); i++) | 389 | for (i=0; i<map_words(map); i++) |
| 390 | r.x[i] = ~0UL; | 390 | r.x[i] = ~0UL; |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index f9bfe526d310..8cc0e2fb6894 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -29,9 +29,6 @@ | |||
| 29 | 29 | ||
| 30 | #include <asm/div64.h> | 30 | #include <asm/div64.h> |
| 31 | 31 | ||
| 32 | #define MTD_CHAR_MAJOR 90 | ||
| 33 | #define MTD_BLOCK_MAJOR 31 | ||
| 34 | |||
| 35 | #define MTD_ERASE_PENDING 0x01 | 32 | #define MTD_ERASE_PENDING 0x01 |
| 36 | #define MTD_ERASING 0x02 | 33 | #define MTD_ERASING 0x02 |
| 37 | #define MTD_ERASE_SUSPEND 0x04 | 34 | #define MTD_ERASE_SUSPEND 0x04 |
| @@ -354,6 +351,11 @@ static inline int mtd_has_oob(const struct mtd_info *mtd) | |||
| 354 | return mtd->_read_oob && mtd->_write_oob; | 351 | return mtd->_read_oob && mtd->_write_oob; |
| 355 | } | 352 | } |
| 356 | 353 | ||
| 354 | static inline int mtd_type_is_nand(const struct mtd_info *mtd) | ||
| 355 | { | ||
| 356 | return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH; | ||
| 357 | } | ||
| 358 | |||
| 357 | static inline int mtd_can_have_bb(const struct mtd_info *mtd) | 359 | static inline int mtd_can_have_bb(const struct mtd_info *mtd) |
| 358 | { | 360 | { |
| 359 | return !!mtd->_block_isbad; | 361 | return !!mtd->_block_isbad; |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index ac8e89d5a792..9e6c8f9f306e 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -198,6 +198,7 @@ typedef enum { | |||
| 198 | /* Cell info constants */ | 198 | /* Cell info constants */ |
| 199 | #define NAND_CI_CHIPNR_MSK 0x03 | 199 | #define NAND_CI_CHIPNR_MSK 0x03 |
| 200 | #define NAND_CI_CELLTYPE_MSK 0x0C | 200 | #define NAND_CI_CELLTYPE_MSK 0x0C |
| 201 | #define NAND_CI_CELLTYPE_SHIFT 2 | ||
| 201 | 202 | ||
| 202 | /* Keep gcc happy */ | 203 | /* Keep gcc happy */ |
| 203 | struct nand_chip; | 204 | struct nand_chip; |
| @@ -477,7 +478,7 @@ struct nand_buffers { | |||
| 477 | * @badblockbits: [INTERN] minimum number of set bits in a good block's | 478 | * @badblockbits: [INTERN] minimum number of set bits in a good block's |
| 478 | * bad block marker position; i.e., BBM == 11110111b is | 479 | * bad block marker position; i.e., BBM == 11110111b is |
| 479 | * not bad when badblockbits == 7 | 480 | * not bad when badblockbits == 7 |
| 480 | * @cellinfo: [INTERN] MLC/multichip data from chip ident | 481 | * @bits_per_cell: [INTERN] number of bits per cell. i.e., 1 means SLC. |
| 481 | * @ecc_strength_ds: [INTERN] ECC correctability from the datasheet. | 482 | * @ecc_strength_ds: [INTERN] ECC correctability from the datasheet. |
| 482 | * Minimum amount of bit errors per @ecc_step_ds guaranteed | 483 | * Minimum amount of bit errors per @ecc_step_ds guaranteed |
| 483 | * to be correctable. If unknown, set to zero. | 484 | * to be correctable. If unknown, set to zero. |
| @@ -498,7 +499,6 @@ struct nand_buffers { | |||
| 498 | * supported, 0 otherwise. | 499 | * supported, 0 otherwise. |
| 499 | * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand | 500 | * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand |
| 500 | * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand | 501 | * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand |
| 501 | * @ecclayout: [REPLACEABLE] the default ECC placement scheme | ||
| 502 | * @bbt: [INTERN] bad block table pointer | 502 | * @bbt: [INTERN] bad block table pointer |
| 503 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash | 503 | * @bbt_td: [REPLACEABLE] bad block table descriptor for flash |
| 504 | * lookup. | 504 | * lookup. |
| @@ -559,7 +559,7 @@ struct nand_chip { | |||
| 559 | int pagebuf; | 559 | int pagebuf; |
| 560 | unsigned int pagebuf_bitflips; | 560 | unsigned int pagebuf_bitflips; |
| 561 | int subpagesize; | 561 | int subpagesize; |
| 562 | uint8_t cellinfo; | 562 | uint8_t bits_per_cell; |
| 563 | uint16_t ecc_strength_ds; | 563 | uint16_t ecc_strength_ds; |
| 564 | uint16_t ecc_step_ds; | 564 | uint16_t ecc_step_ds; |
| 565 | int badblockpos; | 565 | int badblockpos; |
| @@ -572,7 +572,6 @@ struct nand_chip { | |||
| 572 | 572 | ||
| 573 | uint8_t *oob_poi; | 573 | uint8_t *oob_poi; |
| 574 | struct nand_hw_control *controller; | 574 | struct nand_hw_control *controller; |
| 575 | struct nand_ecclayout *ecclayout; | ||
| 576 | 575 | ||
| 577 | struct nand_ecc_ctrl ecc; | 576 | struct nand_ecc_ctrl ecc; |
| 578 | struct nand_buffers *buffers; | 577 | struct nand_buffers *buffers; |
| @@ -797,4 +796,13 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip) | |||
| 797 | return le16_to_cpu(chip->onfi_params.src_sync_timing_mode); | 796 | return le16_to_cpu(chip->onfi_params.src_sync_timing_mode); |
| 798 | } | 797 | } |
| 799 | 798 | ||
| 799 | /* | ||
| 800 | * Check if it is a SLC nand. | ||
| 801 | * The !nand_is_slc() can be used to check the MLC/TLC nand chips. | ||
| 802 | * We do not distinguish the MLC and TLC now. | ||
| 803 | */ | ||
| 804 | static inline bool nand_is_slc(struct nand_chip *chip) | ||
| 805 | { | ||
| 806 | return chip->bits_per_cell == 1; | ||
| 807 | } | ||
| 800 | #endif /* __LINUX_MTD_NAND_H */ | 808 | #endif /* __LINUX_MTD_NAND_H */ |
diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h index ed7f267e6389..6f10e938ff7e 100644 --- a/include/linux/of_mtd.h +++ b/include/linux/of_mtd.h | |||
| @@ -10,10 +10,29 @@ | |||
| 10 | #define __LINUX_OF_NET_H | 10 | #define __LINUX_OF_NET_H |
| 11 | 11 | ||
| 12 | #ifdef CONFIG_OF_MTD | 12 | #ifdef CONFIG_OF_MTD |
| 13 | |||
| 13 | #include <linux/of.h> | 14 | #include <linux/of.h> |
| 14 | int of_get_nand_ecc_mode(struct device_node *np); | 15 | int of_get_nand_ecc_mode(struct device_node *np); |
| 15 | int of_get_nand_bus_width(struct device_node *np); | 16 | int of_get_nand_bus_width(struct device_node *np); |
| 16 | bool of_get_nand_on_flash_bbt(struct device_node *np); | 17 | bool of_get_nand_on_flash_bbt(struct device_node *np); |
| 17 | #endif | 18 | |
| 19 | #else /* CONFIG_OF_MTD */ | ||
| 20 | |||
| 21 | static inline int of_get_nand_ecc_mode(struct device_node *np) | ||
| 22 | { | ||
| 23 | return -ENOSYS; | ||
| 24 | } | ||
| 25 | |||
| 26 | static inline int of_get_nand_bus_width(struct device_node *np) | ||
| 27 | { | ||
| 28 | return -ENOSYS; | ||
| 29 | } | ||
| 30 | |||
| 31 | static inline bool of_get_nand_on_flash_bbt(struct device_node *np) | ||
| 32 | { | ||
| 33 | return false; | ||
| 34 | } | ||
| 35 | |||
| 36 | #endif /* CONFIG_OF_MTD */ | ||
| 18 | 37 | ||
| 19 | #endif /* __LINUX_OF_MTD_H */ | 38 | #endif /* __LINUX_OF_MTD_H */ |
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h index 6bf9ef43ddb1..4da5bfa2147f 100644 --- a/include/linux/platform_data/mtd-nand-omap2.h +++ b/include/linux/platform_data/mtd-nand-omap2.h | |||
| @@ -23,13 +23,16 @@ enum nand_io { | |||
| 23 | }; | 23 | }; |
| 24 | 24 | ||
| 25 | enum omap_ecc { | 25 | enum omap_ecc { |
| 26 | /* 1-bit ecc: stored at end of spare area */ | 26 | /* 1-bit ECC calculation by GPMC, Error detection by Software */ |
| 27 | OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */ | 27 | OMAP_ECC_HAM1_CODE_HW = 0, |
| 28 | OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */ | 28 | /* 4-bit ECC calculation by GPMC, Error detection by Software */ |
| 29 | /* 1-bit ecc: stored at beginning of spare area as romcode */ | 29 | OMAP_ECC_BCH4_CODE_HW_DETECTION_SW, |
| 30 | OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */ | 30 | /* 4-bit ECC calculation by GPMC, Error detection by ELM */ |
| 31 | OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */ | 31 | OMAP_ECC_BCH4_CODE_HW, |
| 32 | OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */ | 32 | /* 8-bit ECC calculation by GPMC, Error detection by Software */ |
| 33 | OMAP_ECC_BCH8_CODE_HW_DETECTION_SW, | ||
| 34 | /* 8-bit ECC calculation by GPMC, Error detection by ELM */ | ||
| 35 | OMAP_ECC_BCH8_CODE_HW, | ||
| 33 | }; | 36 | }; |
| 34 | 37 | ||
| 35 | struct gpmc_nand_regs { | 38 | struct gpmc_nand_regs { |
| @@ -63,5 +66,6 @@ struct omap_nand_platform_data { | |||
| 63 | 66 | ||
| 64 | /* for passing the partitions */ | 67 | /* for passing the partitions */ |
| 65 | struct device_node *of_node; | 68 | struct device_node *of_node; |
| 69 | struct device_node *elm_of_node; | ||
| 66 | }; | 70 | }; |
| 67 | #endif | 71 | #endif |
