@@ -5594,8 +5594,12 @@ static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type)
manufacturer = nand_get_manufacturer(maf_id);
chip->manufacturer.desc = manufacturer;
- if (!type)
- type = nand_flash_ids;
+ if (!type) {
+ if (chip->flash_ids)
+ type = chip->flash_ids;
+ else
+ type = nand_flash_ids;
+ }
/*
* Save the NAND_BUSWIDTH_16 flag before letting auto-detection logic
@@ -1201,6 +1201,7 @@ int nand_op_parser_exec_op(struct nand_chip *chip,
* chipnr is set to %NAND_DATA_IFACE_CHECK_ONLY this
* means the configuration should not be applied but
* only checked.
+ * @flash_ids: [OPTIONAL] local NAND flash ID table
* @bbt: [INTERN] bad block table pointer
* @bbt_td: [REPLACEABLE] bad block table descriptor for flash
* lookup.
@@ -1287,6 +1288,8 @@ struct nand_chip {
unsigned long buf_align;
struct nand_hw_control hwcontrol;
+ struct nand_flash_dev *flash_ids;
+
uint8_t *bbt;
struct nand_bbt_descr *bbt_td;
struct nand_bbt_descr *bbt_md;
Add an alternate way to give to the core another ID table to later remove the one given in nand_scan_ident() as part of the migration to nand_scan(). Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> --- drivers/mtd/nand/raw/nand_base.c | 8 ++++++-- include/linux/mtd/rawnand.h | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-)