mtd: rawnand: prepare the removal of ONFI/JEDEC parameter pages

The NAND chip parameter page is statically allocated within the
nand_chip structure, which reserves a lot of space. Even not ONFI nor
JEDEC chips have it embedded. Also, only a few parameters are actually
read from the parameter page after the detection.

To prepare to the removal of such huge structure, a small NAND parameter
structure is allocated statically and contains only very few members
that are generic to all chips and actually used elsewhere in the code.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
This commit is contained in:
Miquel Raynal
2018-03-19 14:47:26 +01:00
committed by Boris Brezillon
parent 107b7d6a7a
commit f4531b2b19
2 changed files with 30 additions and 22 deletions

View File

@@ -429,6 +429,16 @@ struct nand_jedec_params {
__le16 crc;
} __packed;
/**
* struct nand_parameters - NAND generic parameters from the parameter page
* @model: Model name
* @supports_set_get_features: The NAND chip supports setting/getting features
*/
struct nand_parameters {
char model[100];
bool supports_set_get_features;
};
/* The maximum expected count of bytes in the NAND ID sequence */
#define NAND_MAX_ID_LEN 8
@@ -1165,6 +1175,8 @@ int nand_op_parser_exec_op(struct nand_chip *chip,
* supported, 0 otherwise.
* @jedec_params: [INTERN] holds the JEDEC parameter page when JEDEC is
* supported, 0 otherwise.
* @parameters: [INTERN] holds generic parameters under an easily
* readable form.
* @max_bb_per_die: [INTERN] the max number of bad blocks each die of a
* this nand device will encounter their life times.
* @blocks_per_die: [INTERN] The number of PEBs in a die
@@ -1249,6 +1261,7 @@ struct nand_chip {
struct nand_onfi_params onfi_params;
struct nand_jedec_params jedec_params;
};
struct nand_parameters parameters;
u16 max_bb_per_die;
u32 blocks_per_die;