aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Dembicki <paweldembicki@gmail.com>2018-11-29 14:03:12 +0000
committerMathias Kresin <dev@kresin.me>2018-11-30 00:22:04 +0100
commitb5597d5cc9b07832ca1f2b8ef7e77e096e1a00da (patch)
tree3bde25bc88c352af9cf75f6d376bda28c1a2c2d8
parent30a7ab8f61c8a5f1a4428f8c7cf9a1d6a12b096b (diff)
downloadupstream-b5597d5cc9b07832ca1f2b8ef7e77e096e1a00da.tar.gz
upstream-b5597d5cc9b07832ca1f2b8ef7e77e096e1a00da.tar.bz2
upstream-b5597d5cc9b07832ca1f2b8ef7e77e096e1a00da.zip
kernel: add DT binding support to the jimage parser
It allows specifying jimage parser directly in the DT. Tested on LAVA LR-25G001 Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_jimage.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_jimage.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_jimage.c
index 51544a794b..5c6c5b09ef 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_jimage.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_jimage.c
@@ -19,6 +19,7 @@
#include <linux/vmalloc.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
+#include <linux/version.h>
#include <linux/byteorder/generic.h>
#include "mtdsplit.h"
@@ -256,9 +257,19 @@ mtdsplit_jimage_parse_generic(struct mtd_info *master,
jimage_verify_default);
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+static const struct of_device_id mtdsplit_jimage_of_match_table[] = {
+ { .compatible = "amit,jimage" },
+ {},
+};
+#endif
+
static struct mtd_part_parser jimage_generic_parser = {
.owner = THIS_MODULE,
.name = "jimage-fw",
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ .of_match_table = mtdsplit_jimage_of_match_table,
+#endif
.parse_fn = mtdsplit_jimage_parse_generic,
.type = MTD_PARSER_TYPE_FIRMWARE,
};