1 From d26a789c451068caf4bbb4d1ac7bc1f592b5493e Mon Sep 17 00:00:00 2001
2 From: Weijie Gao <weijie.gao@mediatek.com>
3 Date: Mon, 25 Jul 2022 10:58:06 +0800
4 Subject: [PATCH 39/71] mtd: add a new mtd device type for NMBM
6 This patch adds a new mtd device type for NMBM so that mtdparts can be
7 correctly probed. And this also gives us an opportunity to add NMBM support
8 for filesystems in the future.
10 Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
12 cmd/mtdparts.c | 3 +++
13 include/jffs2/load_kernel.h | 4 +++-
14 2 files changed, 6 insertions(+), 1 deletion(-)
18 @@ -1057,6 +1057,9 @@ int mtd_id_parse(const char *id, const c
19 } else if (strncmp(p, "spi-nand", 8) == 0) {
20 *dev_type = MTD_DEV_TYPE_SPINAND;
22 + } else if (strncmp(p, "nmbm", 4) == 0) {
23 + *dev_type = MTD_DEV_TYPE_NMBM;
26 printf("incorrect device type in %s\n", id);
28 --- a/include/jffs2/load_kernel.h
29 +++ b/include/jffs2/load_kernel.h
31 #define MTD_DEV_TYPE_NAND 0x0002
32 #define MTD_DEV_TYPE_ONENAND 0x0004
33 #define MTD_DEV_TYPE_SPINAND 0x0008
34 +#define MTD_DEV_TYPE_NMBM 0x0010
36 #define MTD_DEV_TYPE(type) (type == MTD_DEV_TYPE_NAND ? "nand" : \
37 (type == MTD_DEV_TYPE_NOR ? "nor" : \
38 (type == MTD_DEV_TYPE_ONENAND ? "onenand" : \
40 + (type == MTD_DEV_TYPE_SPINAND ? "spi-nand" : \
44 struct list_head link;