Skip to content

Commit

Permalink
mtd: nand: support ONFI timing mode retrieval for non-ONFI
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinjaffer committed Sep 16, 2014
1 parent 9182270 commit 816e182
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -3776,6 +3776,7 @@ static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
chip->options |= type->options;
chip->ecc_strength_ds = NAND_ECC_STRENGTH(type);
chip->ecc_step_ds = NAND_ECC_STEP(type);
chip->onfi_timing_mode_ds = type->onfi_timing_mode_ds;

*busw = type->options & NAND_BUSWIDTH_16;

Expand Down
7 changes: 7 additions & 0 deletions include/linux/mtd/nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ 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_ds:[INTERN] ONFI timing mode deduced from datasheet.
* @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
Expand Down Expand Up @@ -727,6 +728,7 @@ struct nand_chip {
uint8_t bits_per_cell;
uint16_t ecc_strength_ds;
uint16_t ecc_step_ds;
int onfi_timing_mode_ds;
int badblockpos;
int badblockbits;

Expand Down Expand Up @@ -831,6 +833,10 @@ struct nand_chip {
* @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_ds: the ONFI timing mode supported by this NAND chip. This
* should be deduced from timings described in the
* datasheet.
*
*/
struct nand_flash_dev {
char *name;
Expand All @@ -851,6 +857,7 @@ struct nand_flash_dev {
uint16_t strength_ds;
uint16_t step_ds;
} ecc;
int onfi_timing_mode_ds;
};

/**
Expand Down

0 comments on commit 816e182

Please sign in to comment.