mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
MTD merge for 3.13
* 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 ioctl(MEMGETINFO)), 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!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
iQIcBAABAgAGBQJSgzYRAAoJEFySrpd9RFgtv8EP/3ZIS1w4fHyWafVSdgVFGR0Y
urlVDhg7iBauh9admN9xxBz6CYRwhjby8GnN87Q1qzu95Xp63RVx31nNfdBW3DGd
92vSyskijYJcUtanBxYqGp1i3EbQcpF4mumqxnre3C4KTLNije41t/wNVqnXAstU
DWho2iymZdkweKJ0DqBA7WF4l/YscdFyNDanO9JWiwII05Rh3Acv7FPMFm3Clblw
Nvfwzgp4XycYMeIQtkmQgQ3GgeWtxPgQwqMofn97MVH4zeTsmUP317ohIMukLGJD
db33J2xBdrIbk9P4D3RvjOCYyAyonu9y6/p+B1Vmj+R4CAUvQOIljhklHFoT3UZW
OzUHPxB6T0+NZyQ/5IRQIYH9As++vdb/bzsUXm/cXceI4o4I0QCPy/8adifakBOF
IUX9/BCdUOfKXvdOXY5dXMR2sY1IBg/1WfI+qcAoITsS/EVrUTrOcfSLyGqF0ERU
c7mAzXiyp4D51x66/QnfJ4aJjlioQSoa3mK1j4fXqH08YB5Zclpz938Bo1AO3lWy
/n+NYSbeXJoi4rVkNawjrRVs+0OTby2XQ5OqBlUMH6f30fqjUefPm66ZBMhbxzYu
5QFDctUbnHCyAPpOtM/WR3/NOkIqVhQl1331A+dG2TzLK0vTHs+kbt/YmIITpjI+
yn70XJGhk1F4gy8zhD+V
=z5qO
-----END PGP SIGNATURE-----
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
...
This commit is contained in:
commit
82cb6acea4
65 changed files with 925 additions and 984 deletions
|
|
@ -91,8 +91,6 @@ struct nand_bbt_descr {
|
|||
* with NAND_BBT_CREATE.
|
||||
*/
|
||||
#define NAND_BBT_CREATE_EMPTY 0x00000400
|
||||
/* Search good / bad pattern through all pages of a block */
|
||||
#define NAND_BBT_SCANALLPAGES 0x00000800
|
||||
/* Write bbt if neccecary */
|
||||
#define NAND_BBT_WRITE 0x00002000
|
||||
/* Read and write back block contents when writing bbt */
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ static inline map_word map_word_load_partial(struct map_info *map, map_word orig
|
|||
bitpos = (map_bankwidth(map)-1-i)*8;
|
||||
#endif
|
||||
orig.x[0] &= ~(0xff << bitpos);
|
||||
orig.x[0] |= buf[i-start] << bitpos;
|
||||
orig.x[0] |= (unsigned long)buf[i-start] << bitpos;
|
||||
}
|
||||
}
|
||||
return orig;
|
||||
|
|
@ -384,7 +384,7 @@ static inline map_word map_word_ff(struct map_info *map)
|
|||
|
||||
if (map_bankwidth(map) < MAP_FF_LIMIT) {
|
||||
int bw = 8 * map_bankwidth(map);
|
||||
r.x[0] = (1 << bw) - 1;
|
||||
r.x[0] = (1UL << bw) - 1;
|
||||
} else {
|
||||
for (i=0; i<map_words(map); i++)
|
||||
r.x[i] = ~0UL;
|
||||
|
|
|
|||
|
|
@ -29,9 +29,6 @@
|
|||
|
||||
#include <asm/div64.h>
|
||||
|
||||
#define MTD_CHAR_MAJOR 90
|
||||
#define MTD_BLOCK_MAJOR 31
|
||||
|
||||
#define MTD_ERASE_PENDING 0x01
|
||||
#define MTD_ERASING 0x02
|
||||
#define MTD_ERASE_SUSPEND 0x04
|
||||
|
|
@ -354,6 +351,11 @@ static inline int mtd_has_oob(const struct mtd_info *mtd)
|
|||
return mtd->_read_oob && mtd->_write_oob;
|
||||
}
|
||||
|
||||
static inline int mtd_type_is_nand(const struct mtd_info *mtd)
|
||||
{
|
||||
return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH;
|
||||
}
|
||||
|
||||
static inline int mtd_can_have_bb(const struct mtd_info *mtd)
|
||||
{
|
||||
return !!mtd->_block_isbad;
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ typedef enum {
|
|||
/* Cell info constants */
|
||||
#define NAND_CI_CHIPNR_MSK 0x03
|
||||
#define NAND_CI_CELLTYPE_MSK 0x0C
|
||||
#define NAND_CI_CELLTYPE_SHIFT 2
|
||||
|
||||
/* Keep gcc happy */
|
||||
struct nand_chip;
|
||||
|
|
@ -477,7 +478,7 @@ struct nand_buffers {
|
|||
* @badblockbits: [INTERN] minimum number of set bits in a good block's
|
||||
* bad block marker position; i.e., BBM == 11110111b is
|
||||
* not bad when badblockbits == 7
|
||||
* @cellinfo: [INTERN] MLC/multichip data from chip ident
|
||||
* @bits_per_cell: [INTERN] number of bits per cell. i.e., 1 means SLC.
|
||||
* @ecc_strength_ds: [INTERN] ECC correctability from the datasheet.
|
||||
* Minimum amount of bit errors per @ecc_step_ds guaranteed
|
||||
* to be correctable. If unknown, set to zero.
|
||||
|
|
@ -498,7 +499,6 @@ struct nand_buffers {
|
|||
* supported, 0 otherwise.
|
||||
* @onfi_set_features: [REPLACEABLE] set the features for ONFI nand
|
||||
* @onfi_get_features: [REPLACEABLE] get the features for ONFI nand
|
||||
* @ecclayout: [REPLACEABLE] the default ECC placement scheme
|
||||
* @bbt: [INTERN] bad block table pointer
|
||||
* @bbt_td: [REPLACEABLE] bad block table descriptor for flash
|
||||
* lookup.
|
||||
|
|
@ -559,7 +559,7 @@ struct nand_chip {
|
|||
int pagebuf;
|
||||
unsigned int pagebuf_bitflips;
|
||||
int subpagesize;
|
||||
uint8_t cellinfo;
|
||||
uint8_t bits_per_cell;
|
||||
uint16_t ecc_strength_ds;
|
||||
uint16_t ecc_step_ds;
|
||||
int badblockpos;
|
||||
|
|
@ -572,7 +572,6 @@ struct nand_chip {
|
|||
|
||||
uint8_t *oob_poi;
|
||||
struct nand_hw_control *controller;
|
||||
struct nand_ecclayout *ecclayout;
|
||||
|
||||
struct nand_ecc_ctrl ecc;
|
||||
struct nand_buffers *buffers;
|
||||
|
|
@ -797,4 +796,13 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip)
|
|||
return le16_to_cpu(chip->onfi_params.src_sync_timing_mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if it is a SLC nand.
|
||||
* The !nand_is_slc() can be used to check the MLC/TLC nand chips.
|
||||
* We do not distinguish the MLC and TLC now.
|
||||
*/
|
||||
static inline bool nand_is_slc(struct nand_chip *chip)
|
||||
{
|
||||
return chip->bits_per_cell == 1;
|
||||
}
|
||||
#endif /* __LINUX_MTD_NAND_H */
|
||||
|
|
|
|||
|
|
@ -10,10 +10,29 @@
|
|||
#define __LINUX_OF_NET_H
|
||||
|
||||
#ifdef CONFIG_OF_MTD
|
||||
|
||||
#include <linux/of.h>
|
||||
int of_get_nand_ecc_mode(struct device_node *np);
|
||||
int of_get_nand_bus_width(struct device_node *np);
|
||||
bool of_get_nand_on_flash_bbt(struct device_node *np);
|
||||
#endif
|
||||
|
||||
#else /* CONFIG_OF_MTD */
|
||||
|
||||
static inline int of_get_nand_ecc_mode(struct device_node *np)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int of_get_nand_bus_width(struct device_node *np)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline bool of_get_nand_on_flash_bbt(struct device_node *np)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_OF_MTD */
|
||||
|
||||
#endif /* __LINUX_OF_MTD_H */
|
||||
|
|
|
|||
|
|
@ -23,13 +23,16 @@ enum nand_io {
|
|||
};
|
||||
|
||||
enum omap_ecc {
|
||||
/* 1-bit ecc: stored at end of spare area */
|
||||
OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
|
||||
OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
|
||||
/* 1-bit ecc: stored at beginning of spare area as romcode */
|
||||
OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
|
||||
OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */
|
||||
OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */
|
||||
/* 1-bit ECC calculation by GPMC, Error detection by Software */
|
||||
OMAP_ECC_HAM1_CODE_HW = 0,
|
||||
/* 4-bit ECC calculation by GPMC, Error detection by Software */
|
||||
OMAP_ECC_BCH4_CODE_HW_DETECTION_SW,
|
||||
/* 4-bit ECC calculation by GPMC, Error detection by ELM */
|
||||
OMAP_ECC_BCH4_CODE_HW,
|
||||
/* 8-bit ECC calculation by GPMC, Error detection by Software */
|
||||
OMAP_ECC_BCH8_CODE_HW_DETECTION_SW,
|
||||
/* 8-bit ECC calculation by GPMC, Error detection by ELM */
|
||||
OMAP_ECC_BCH8_CODE_HW,
|
||||
};
|
||||
|
||||
struct gpmc_nand_regs {
|
||||
|
|
@ -63,5 +66,6 @@ struct omap_nand_platform_data {
|
|||
|
||||
/* for passing the partitions */
|
||||
struct device_node *of_node;
|
||||
struct device_node *elm_of_node;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue