1 From e1b9d122030220d8b8176d9e23568e26fa2f9d23 Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Fri, 19 Oct 2018 08:56:41 +0200
4 Subject: [PATCH 10/18] mtd: partitions: Add second compatible for redboot
6 Simple backport of the upstream redboot partition table
7 bindings that are used in the mainline Linux kernel.
9 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
11 drivers/mtd/redboot.c | 29 ++++++++++++++++++++++++++++-
12 1 file changed, 28 insertions(+), 1 deletion(-)
14 --- a/drivers/mtd/redboot.c
15 +++ b/drivers/mtd/redboot.c
17 #include <linux/slab.h>
18 #include <linux/init.h>
19 #include <linux/vmalloc.h>
21 +#include <linux/of.h>
22 #include <linux/mtd/mtd.h>
23 #include <linux/mtd/partitions.h>
24 #include <linux/module.h>
25 @@ -56,6 +56,31 @@ static inline int redboot_checksum(struc
30 +static void parse_redboot_of(struct mtd_info *master)
32 + struct device_node *np;
36 + np = mtd_get_of_node(master);
39 + ret = of_property_read_u32(np, "fis-index-block", &dirblock);
43 + * Assign the block found in the device tree to the local
44 + * directory block pointer.
46 + directory = dirblock;
49 +static void parse_redboot_of(struct mtd_info *master)
54 static int parse_redboot_partitions(struct mtd_info *master,
55 const struct mtd_partition **pparts,
56 struct mtd_part_parser_data *data)
57 @@ -75,6 +100,7 @@ static int parse_redboot_partitions(stru
58 #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
59 static char nullstring[] = "unallocated";
61 + parse_redboot_of(master);
63 if ( directory < 0 ) {
64 offset = master->size + directory * master->erasesize;
65 @@ -298,6 +324,7 @@ static int parse_redboot_partitions(stru
67 static const struct of_device_id redboot_parser_of_match_table[] = {
68 { .compatible = "ecoscentric,redboot-fis-partitions" },
69 + { .compatible = "redboot-fis" },
72 MODULE_DEVICE_TABLE(of, redboot_parser_of_match_table);