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>
This commit is contained in:
Pawel Dembicki 2018-11-29 14:03:12 +00:00 committed by Mathias Kresin
parent 30a7ab8f61
commit b5597d5cc9

View File

@ -19,6 +19,7 @@
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/version.h>
#include <linux/byteorder/generic.h> #include <linux/byteorder/generic.h>
#include "mtdsplit.h" #include "mtdsplit.h"
@ -256,9 +257,19 @@ mtdsplit_jimage_parse_generic(struct mtd_info *master,
jimage_verify_default); 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 = { static struct mtd_part_parser jimage_generic_parser = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "jimage-fw", .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, .parse_fn = mtdsplit_jimage_parse_generic,
.type = MTD_PARSER_TYPE_FIRMWARE, .type = MTD_PARSER_TYPE_FIRMWARE,
}; };