aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@foss.st.com>2022-03-21 09:13:36 +0100
committerTom Rini <trini@konsulko.com>2022-04-11 11:39:19 -0400
commitc86a4de8df611b58ec41ae6c42c6fec58e5ab54f (patch)
tree023e377e91abdc30d60ca7edfc76b61fa499abac /drivers/mtd
parent877de2a369aaeebe7fb0a2f8f1438255d249c6c0 (diff)
downloadu-boot-c86a4de8df611b58ec41ae6c42c6fec58e5ab54f.tar.gz
mtd: Add flash_node in struct mtd_info
Currently, add_mtd_partitions_of() can be used only if dev field of mtd_info struct is populated. It's the case, for example, for a spi nor flash, which has a DT compatible "jedec,spi-nor" and an associated device. mtd->dev is populated in spi_nor_scan(). But in case of a raw nand node, mtd_info's dev field can't be populated as flash node has no compatible, so no associated device. add_mtd_partitions_of() can't be used to parse "partitions" subnode. To remove this constraint, add an ofnode field in mtd_info struct which reference the DT flash node. This new field is populated by nand_scan_tail(). This new field will be used by add_mtd_partitions_of() to parse the flash node for "partitions" defined in DT. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Farhan Ali <farhan.ali@broadcom.com> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Jagan Teki <jagan@amarulasolutions.com> Cc: Marek Behun <marek.behun@nic.cz> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Simon Glass <sjg@chromium.org> Cc: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/raw/nand_base.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index f7616985d95..a007603df14 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -5257,6 +5257,7 @@ int nand_scan_tail(struct mtd_info *mtd)
break;
}
+ mtd->flash_node = chip->flash_node;
/* Fill in remaining MTD driver data */
mtd->type = nand_is_slc(chip) ? MTD_NANDFLASH : MTD_MLCNANDFLASH;
mtd->flags = (chip->options & NAND_ROM) ? MTD_CAP_ROM :