kernel/modules/other/mlxreg: add new package
[openwrt/openwrt.git] / package / boot / uboot-mediatek / patches / 100-05-mtd-add-a-new-mtd-device-type-for-NMBM.patch
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
5
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.
9
10 Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
11 ---
12 cmd/mtdparts.c | 3 +++
13 include/jffs2/load_kernel.h | 4 +++-
14 2 files changed, 6 insertions(+), 1 deletion(-)
15
16 --- a/cmd/mtdparts.c
17 +++ b/cmd/mtdparts.c
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;
21 p += 8;
22 + } else if (strncmp(p, "nmbm", 4) == 0) {
23 + *dev_type = MTD_DEV_TYPE_NMBM;
24 + p += 4;
25 } else {
26 printf("incorrect device type in %s\n", id);
27 return 1;
28 --- a/include/jffs2/load_kernel.h
29 +++ b/include/jffs2/load_kernel.h
30 @@ -16,11 +16,13 @@
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
35
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" : \
39 - "spi-nand"))) \
40 + (type == MTD_DEV_TYPE_SPINAND ? "spi-nand" : \
41 + "nmbm")))) \
42
43 struct mtd_device {
44 struct list_head link;