mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 05:29:04 -04:00
MTD updates for 3.18
NAND
* Cleanup for Denali driver
* Atmel: add support for new page sizes
* Atmel: fix up 'raw' mode support
* Atmel: miscellaneous cleanups
* New timing mode helpers for non-ONFI NAND
* OMAP: allow driver to be (properly) built as a module
* bcm47xx: RESET support and other cleanups
SPI NOR
* Miscellaneous cleanups, to prepare framework for wider use (some further
work still pending)
* Compile-time configuration to select 4K vs. 64K support for flash that
support both (necessary for using UBIFS on some SPI NOR)
A few scattered code quality fixes, detected by Coverity
See the changesets for more.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJUP2dfAAoJEFySrpd9RFgtiUYQAKHmzTw4UR5lZNwBHLPIk5mV
d11If+kGwY5wVTG0f7+d0RxXWQLP11LnWn7S9JK3ttvuc5L8ev4jCjtbR6aRQZgy
6vdqqvOv/kqP+Q4FclVIdEPzEgLurg4zCuVoDaMkhIKkdmrcw3inWSt7F+/2dJYb
OAPRoOSv8hnmQheH85v8zpHrovcYLY9tGoSlv0Yu8pKapyp7LT2E/wPaXh16VjZG
A8Qr6NsSZR/5UY5RZmMewkKkB/T25miPwwdiXvdwbWoKRn8pPlg/NJ9ae8BXcyFg
GsOuQWnjdDJE+Orud5IBWEARpW98SbtksQSVtoZPLE4iK9gglsUgiXAI2W8/MQkP
cvmGDz1q80jNF4m/RJSY9frGXRCK3ICOue6g24JDmgioQYZ/Weqo0gtpYQnYiWPb
lYsNgNrOM2clLVnVbUMD5LwFf7oEspgZkyqirwaqJ+lP3Elyc6VTr3BvClQpdpyb
tZ7g5PC/zlU+IcFbiGCgsvkoFsWQ7aT0thchNn4RmP8QbNNL/OJ1gIMat0at2Aon
nqYfkJVi/a7lHCYmhP9rdEWqhOSljtvyjeE7A5XSPVlYxP+xSOyyEKDCcIbh8chH
pC11WASnbDRP/ldAuZf67s2ot62u1sD3Az4fdYgf04wFpq7s52MLkeThUrSsm2L0
ljLrSCV/8l2XYqvyYBQm
=/jCH
-----END PGP SIGNATURE-----
Merge tag 'for-linus-20141015' of git://git.infradead.org/linux-mtd
Pull MTD update from Brian Norris:
"Sorry for delaying this a bit later than usual. There's one mild
regression from 3.16 that was noticed during the 3.17 cycle, and I
meant to send a fix for it along with this pull request. I'll
probably try to queue it up for a later pull request once I've had a
better look at it, hopefully by -rc2 at the latest.
Summary for this pull:
NAND
- Cleanup for Denali driver
- Atmel: add support for new page sizes
- Atmel: fix up 'raw' mode support
- Atmel: miscellaneous cleanups
- New timing mode helpers for non-ONFI NAND
- OMAP: allow driver to be (properly) built as a module
- bcm47xx: RESET support and other cleanups
SPI NOR
- Miscellaneous cleanups, to prepare framework for wider use (some
further work still pending)
- Compile-time configuration to select 4K vs. 64K support for flash
that support both (necessary for using UBIFS on some SPI NOR)
A few scattered code quality fixes, detected by Coverity
See the changesets for more"
* tag 'for-linus-20141015' of git://git.infradead.org/linux-mtd: (59 commits)
mtd: nand: omap: Correct CONFIG_MTD_NAND_OMAP_BCH help message
mtd: nand: Force omap_elm to be built as a module if omap2_nand is a module
mtd: move support for struct flash_platform_data into m25p80
mtd: spi-nor: add Kconfig option to disable 4K sectors
mtd: nand: Move ELM driver and rename as omap_elm
nand: omap2: Replace pr_err with dev_err
nand: omap2: Remove horrible ifdefs to fix module probe
mtd: nand: add Hynix's H27UCG8T2ATR-BC to nand_ids table
mtd: nand: support ONFI timing mode retrieval for non-ONFI NANDs
mtd: physmap_of: Add non-obsolete map_rom probe
mtd: physmap_of: Fix ROM support via OF
MAINTAINERS: add l2-mtd.git, 'next' tree for MTD
mtd: denali: fix indents and other trivial things
mtd: denali: remove unnecessary parentheses
mtd: denali: remove another set-but-unused variable
mtd: denali: fix include guard and license block of denali.h
mtd: nand: don't break long print messages
mtd: bcm47xxnflash: replace some magic numbers
mtd: bcm47xxnflash: NAND_CMD_RESET support
mtd: bcm47xxnflash: add cmd_ctrl handler
...
This commit is contained in:
commit
511c41d9e6
45 changed files with 757 additions and 562 deletions
|
|
@ -153,7 +153,7 @@ struct cfi_ident {
|
|||
uint16_t MaxBufWriteSize;
|
||||
uint8_t NumEraseRegions;
|
||||
uint32_t EraseRegionInfo[0]; /* Not host ordered */
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
/* Extended Query Structure for both PRI and ALT */
|
||||
|
||||
|
|
@ -161,7 +161,7 @@ struct cfi_extquery {
|
|||
uint8_t pri[3];
|
||||
uint8_t MajorVersion;
|
||||
uint8_t MinorVersion;
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
/* Vendor-Specific PRI for Intel/Sharp Extended Command Set (0x0001) */
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ struct cfi_pri_intelext {
|
|||
uint8_t FactProtRegSize;
|
||||
uint8_t UserProtRegSize;
|
||||
uint8_t extra[0];
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
struct cfi_intelext_otpinfo {
|
||||
uint32_t ProtRegAddr;
|
||||
|
|
@ -188,7 +188,7 @@ struct cfi_intelext_otpinfo {
|
|||
uint8_t FactProtRegSize;
|
||||
uint16_t UserGroups;
|
||||
uint8_t UserProtRegSize;
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
struct cfi_intelext_blockinfo {
|
||||
uint16_t NumIdentBlocks;
|
||||
|
|
@ -196,7 +196,7 @@ struct cfi_intelext_blockinfo {
|
|||
uint16_t MinBlockEraseCycles;
|
||||
uint8_t BitsPerCell;
|
||||
uint8_t BlockCap;
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
struct cfi_intelext_regioninfo {
|
||||
uint16_t NumIdentPartitions;
|
||||
|
|
@ -205,7 +205,7 @@ struct cfi_intelext_regioninfo {
|
|||
uint8_t NumOpAllowedSimEraMode;
|
||||
uint8_t NumBlockTypes;
|
||||
struct cfi_intelext_blockinfo BlockTypes[1];
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
struct cfi_intelext_programming_regioninfo {
|
||||
uint8_t ProgRegShift;
|
||||
|
|
@ -214,7 +214,7 @@ struct cfi_intelext_programming_regioninfo {
|
|||
uint8_t Reserved2;
|
||||
uint8_t ControlInvalid;
|
||||
uint8_t Reserved3;
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
/* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ struct cfi_pri_amdstd {
|
|||
uint8_t VppMin;
|
||||
uint8_t VppMax;
|
||||
uint8_t TopBottom;
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
/* Vendor-Specific PRI for Atmel chips (command set 0x0002) */
|
||||
|
||||
|
|
@ -245,18 +245,18 @@ struct cfi_pri_atmel {
|
|||
uint8_t BottomBoot;
|
||||
uint8_t BurstMode;
|
||||
uint8_t PageMode;
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
struct cfi_pri_query {
|
||||
uint8_t NumFields;
|
||||
uint32_t ProtField[1]; /* Not host ordered */
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
struct cfi_bri_query {
|
||||
uint8_t PageModeReadCap;
|
||||
uint8_t NumFields;
|
||||
uint32_t ConfField[1]; /* Not host ordered */
|
||||
} __attribute__((packed));
|
||||
} __packed;
|
||||
|
||||
#define P_ID_NONE 0x0000
|
||||
#define P_ID_INTEL_EXT 0x0001
|
||||
|
|
|
|||
|
|
@ -587,6 +587,11 @@ struct nand_buffers {
|
|||
* @ecc_step_ds: [INTERN] ECC step required by the @ecc_strength_ds,
|
||||
* also from the datasheet. It is the recommended ECC step
|
||||
* size, if known; if unknown, set to zero.
|
||||
* @onfi_timing_mode_default: [INTERN] default ONFI timing mode. This field is
|
||||
* either deduced from the datasheet if the NAND
|
||||
* chip is not ONFI compliant or set to 0 if it is
|
||||
* (an ONFI chip is always configured in mode 0
|
||||
* after a NAND reset)
|
||||
* @numchips: [INTERN] number of physical chips
|
||||
* @chipsize: [INTERN] the size of one chip for multichip arrays
|
||||
* @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
|
||||
|
|
@ -671,6 +676,7 @@ struct nand_chip {
|
|||
uint8_t bits_per_cell;
|
||||
uint16_t ecc_strength_ds;
|
||||
uint16_t ecc_step_ds;
|
||||
int onfi_timing_mode_default;
|
||||
int badblockpos;
|
||||
int badblockbits;
|
||||
|
||||
|
|
@ -766,12 +772,17 @@ struct nand_chip {
|
|||
* @options: stores various chip bit options
|
||||
* @id_len: The valid length of the @id.
|
||||
* @oobsize: OOB size
|
||||
* @ecc: ECC correctability and step information from the datasheet.
|
||||
* @ecc.strength_ds: The ECC correctability from the datasheet, same as the
|
||||
* @ecc_strength_ds in nand_chip{}.
|
||||
* @ecc.step_ds: The ECC step required by the @ecc.strength_ds, same as the
|
||||
* @ecc_step_ds in nand_chip{}, also from the datasheet.
|
||||
* For example, the "4bit ECC for each 512Byte" can be set with
|
||||
* NAND_ECC_INFO(4, 512).
|
||||
* @onfi_timing_mode_default: the default ONFI timing mode entered after a NAND
|
||||
* reset. Should be deduced from timings described
|
||||
* in the datasheet.
|
||||
*
|
||||
*/
|
||||
struct nand_flash_dev {
|
||||
char *name;
|
||||
|
|
@ -792,6 +803,7 @@ struct nand_flash_dev {
|
|||
uint16_t strength_ds;
|
||||
uint16_t step_ds;
|
||||
} ecc;
|
||||
int onfi_timing_mode_default;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,8 +42,24 @@ struct elm_errorvec {
|
|||
int error_loc[16];
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_MTD_NAND_OMAP_BCH)
|
||||
void elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc,
|
||||
struct elm_errorvec *err_vec);
|
||||
int elm_config(struct device *dev, enum bch_ecc bch_type,
|
||||
int ecc_steps, int ecc_step_size, int ecc_syndrome_size);
|
||||
#else
|
||||
static inline void
|
||||
elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc,
|
||||
struct elm_errorvec *err_vec)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int elm_config(struct device *dev, enum bch_ecc bch_type,
|
||||
int ecc_steps, int ecc_step_size,
|
||||
int ecc_syndrome_size)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
#endif /* CONFIG_MTD_NAND_ECC_BCH */
|
||||
|
||||
#endif /* __ELM_H */
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ struct omap_nand_platform_data {
|
|||
struct mtd_partition *parts;
|
||||
int nr_parts;
|
||||
bool dev_ready;
|
||||
bool flash_bbt;
|
||||
enum nand_io xfer_type;
|
||||
int devsize;
|
||||
enum omap_ecc ecc_opt;
|
||||
|
|
|
|||
Loading…
Reference in a new issue