aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-11-22 13:20:04 +0100
committerRafał Miłecki <rafal@milecki.pl>2018-11-24 08:31:56 +0100
commita22311e6a6d4fe439dd99281c02c36cfb415a452 (patch)
tree4f78668bb39ee49fcfaf3c0cae36c8ba14f12598
parent934edb764dfd9fffe88478ecd315bee6ca0a781a (diff)
downloadupstream-a22311e6a6d4fe439dd99281c02c36cfb415a452.tar.gz
upstream-a22311e6a6d4fe439dd99281c02c36cfb415a452.tar.bz2
upstream-a22311e6a6d4fe439dd99281c02c36cfb415a452.zip
kernel: add DT binding support to the uimage parsers
It allows specifying default and Netgear parsers directly in the DT. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c
index bd1c723e74..e9b8314978 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c
@@ -16,6 +16,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"
@@ -239,9 +240,19 @@ mtdsplit_uimage_parse_generic(struct mtd_info *master,
uimage_verify_default);
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+static const struct of_device_id mtdsplit_uimage_of_match_table[] = {
+ { .compatible = "denx,uimage" },
+ {},
+};
+#endif
+
static struct mtd_part_parser uimage_generic_parser = {
.owner = THIS_MODULE,
.name = "uimage-fw",
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ .of_match_table = mtdsplit_uimage_of_match_table,
+#endif
.parse_fn = mtdsplit_uimage_parse_generic,
.type = MTD_PARSER_TYPE_FIRMWARE,
};
@@ -296,9 +307,19 @@ mtdsplit_uimage_parse_netgear(struct mtd_info *master,
uimage_verify_wndr3700);
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+static const struct of_device_id mtdsplit_uimage_netgear_of_match_table[] = {
+ { .compatible = "netgear,uimage" },
+ {},
+};
+#endif
+
static struct mtd_part_parser uimage_netgear_parser = {
.owner = THIS_MODULE,
.name = "netgear-fw",
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ .of_match_table = mtdsplit_uimage_netgear_of_match_table,
+#endif
.parse_fn = mtdsplit_uimage_parse_netgear,
.type = MTD_PARSER_TYPE_FIRMWARE,
};