From e44d1e17da089fdc7e7cb1cfa48334993e8aa427 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Sat, 26 Jan 2019 13:36:49 +0100 Subject: gemini: Add v4.19 kernel patches This is the remainder of kernel patches for the v4.19 kernel. A whole slew of the previous patch stack is now upstream, so this mainly contains the stuff that was added upstream between v4.19 and v5.0-rc1, and then the USB FOTG201 patches from Hans. Signed-off-by: Linus Walleij --- ...titions-Add-second-compatible-for-redboot.patch | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 target/linux/gemini/patches-4.19/0010-mtd-partitions-Add-second-compatible-for-redboot.patch (limited to 'target/linux/gemini/patches-4.19/0010-mtd-partitions-Add-second-compatible-for-redboot.patch') diff --git a/target/linux/gemini/patches-4.19/0010-mtd-partitions-Add-second-compatible-for-redboot.patch b/target/linux/gemini/patches-4.19/0010-mtd-partitions-Add-second-compatible-for-redboot.patch new file mode 100644 index 0000000000..451ba3af8b --- /dev/null +++ b/target/linux/gemini/patches-4.19/0010-mtd-partitions-Add-second-compatible-for-redboot.patch @@ -0,0 +1,77 @@ +From e1b9d122030220d8b8176d9e23568e26fa2f9d23 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Fri, 19 Oct 2018 08:56:41 +0200 +Subject: [PATCH 10/18] mtd: partitions: Add second compatible for redboot + +Simple backport of the upstream redboot partition table +bindings that are used in the mainline Linux kernel. + +Signed-off-by: Linus Walleij +--- + drivers/mtd/redboot.c | 29 ++++++++++++++++++++++++++++- + 1 file changed, 28 insertions(+), 1 deletion(-) + +diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c +index fe3df7437483..e9c21579ba35 100644 +--- a/drivers/mtd/redboot.c ++++ b/drivers/mtd/redboot.c +@@ -25,7 +25,7 @@ + #include + #include + #include +- ++#include + #include + #include + #include +@@ -56,6 +56,31 @@ static inline int redboot_checksum(struct fis_image_desc *img) + return 1; + } + ++#ifdef CONFIG_OF ++static void parse_redboot_of(struct mtd_info *master) ++{ ++ struct device_node *np; ++ u32 dirblock; ++ int ret; ++ ++ np = mtd_get_of_node(master); ++ if (!np) ++ return; ++ ret = of_property_read_u32(np, "fis-index-block", &dirblock); ++ if (ret) ++ return; ++ /* ++ * Assign the block found in the device tree to the local ++ * directory block pointer. ++ */ ++ directory = dirblock; ++} ++#else ++static void parse_redboot_of(struct mtd_info *master) ++{ ++} ++#endif ++ + static int parse_redboot_partitions(struct mtd_info *master, + const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) +@@ -75,6 +100,7 @@ static int parse_redboot_partitions(struct mtd_info *master, + #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED + static char nullstring[] = "unallocated"; + #endif ++ parse_redboot_of(master); + + if ( directory < 0 ) { + offset = master->size + directory * master->erasesize; +@@ -298,6 +324,7 @@ static int parse_redboot_partitions(struct mtd_info *master, + + static const struct of_device_id redboot_parser_of_match_table[] = { + { .compatible = "ecoscentric,redboot-fis-partitions" }, ++ { .compatible = "redboot-fis" }, + {}, + }; + MODULE_DEVICE_TABLE(of, redboot_parser_of_match_table); +-- +2.19.2 + -- cgit v1.2.3