summaryrefslogtreecommitdiff
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2021-05-26 14:08:19 +0200
committerJagan Teki <jagan@amarulasolutions.com>2021-06-24 11:53:15 +0530
commitdc339bf784f08707583a5b6465381354f48d4fa8 (patch)
tree219b53b6ce55e9b7cf7f652be1390dbc0426166d /include/linux/mtd
parent0e116bea52af1b665a656d49c328468e976be913 (diff)
downloadu-boot-dc339bf784f08707583a5b6465381354f48d4fa8.tar.gz
u-boot-dc339bf784f08707583a5b6465381354f48d4fa8.tar.bz2
u-boot-dc339bf784f08707583a5b6465381354f48d4fa8.zip
mtd: add support for parsing partitions defined in OF
Add support for parsing partitions defined in device-trees via the `partitions` node with `fixed-partitions` compatible. The `mtdparts`/`mtdids` mechanism takes precedence. If some partitions are defined for a MTD device via this mechanism, the code won't register partitions for that MTD device from OF, even if they are defined. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Cc: Simon Glass <sjg@chromium.org> Cc: Heiko Schocher <hs@denx.de> Cc: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/mtd.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 927854950a..3b302fb8c3 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -581,6 +581,16 @@ static inline int del_mtd_partitions(struct mtd_info *mtd)
}
#endif
+#if defined(CONFIG_MTD_PARTITIONS) && CONFIG_IS_ENABLED(DM) && \
+ CONFIG_IS_ENABLED(OF_CONTROL)
+int add_mtd_partitions_of(struct mtd_info *master);
+#else
+static inline int add_mtd_partitions_of(struct mtd_info *master)
+{
+ return 0;
+}
+#endif
+
struct mtd_info *__mtd_next_device(int i);
#define mtd_for_each_device(mtd) \
for ((mtd) = __mtd_next_device(0); \