diff options
author | Bjørn Mork <bjorn@mork.no> | 2021-01-20 18:36:49 +0100 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2021-01-22 21:03:11 +0100 |
commit | 647fdafcc57e7bb214ba5c745be63a55211e3422 (patch) | |
tree | d07c1945c308b06b057c0ef42aad54e16902b0ca /target | |
parent | 01a1e21863aa30c7a2c252ff06b9aef0cf957970 (diff) | |
download | upstream-647fdafcc57e7bb214ba5c745be63a55211e3422.tar.gz upstream-647fdafcc57e7bb214ba5c745be63a55211e3422.tar.bz2 upstream-647fdafcc57e7bb214ba5c745be63a55211e3422.zip |
kernel: mtdsplit_uimage: replace "allnet, uimage" parser
Convert users to the generic "openwrt,uimage" using device specific
"openwrt,ih-magic" properties, and remove "allnet,uimage".
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c | 49 | ||||
-rw-r--r-- | target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts | 3 |
2 files changed, 2 insertions, 50 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 32c027d3e9..55eaca9946 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c @@ -333,54 +333,6 @@ static struct mtd_part_parser uimage_netgear_parser = { }; - -/************************************************** - * ALLNET - **************************************************/ - -#define FW_MAGIC_SG8208M 0x00000006 -#define FW_MAGIC_SG8310PM 0x83000006 - -static ssize_t uimage_verify_allnet(u_char *buf, size_t len, u32 ih_magic) -{ - struct uimage_header *header = (struct uimage_header *)buf; - - switch (be32_to_cpu(header->ih_magic)) { - case FW_MAGIC_SG8208M: - case FW_MAGIC_SG8310PM: - break; - default: - return -EINVAL; - } - - if (header->ih_os != IH_OS_LINUX) - return -EINVAL; - - return 0; -} - -static int -mtdsplit_uimage_parse_allnet(struct mtd_info *master, - const struct mtd_partition **pparts, - struct mtd_part_parser_data *data) -{ - return __mtdsplit_parse_uimage(master, pparts, data, - uimage_verify_allnet); -} - -static const struct of_device_id mtdsplit_uimage_allnet_of_match_table[] = { - { .compatible = "allnet,uimage" }, - {}, -}; - -static struct mtd_part_parser uimage_allnet_parser = { - .owner = THIS_MODULE, - .name = "allnet-fw", - .of_match_table = mtdsplit_uimage_allnet_of_match_table, - .parse_fn = mtdsplit_uimage_parse_allnet, -}; - - /************************************************** * Edimax **************************************************/ @@ -438,7 +390,6 @@ static int __init mtdsplit_uimage_init(void) { register_mtd_parser(&uimage_generic_parser); register_mtd_parser(&uimage_netgear_parser); - register_mtd_parser(&uimage_allnet_parser); register_mtd_parser(&uimage_edimax_parser); return 0; diff --git a/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts b/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts index 28c4fd2970..681d699e8a 100644 --- a/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts +++ b/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts @@ -95,7 +95,8 @@ partition@2a0000 { label = "firmware"; reg = <0x2a0000 0xd60000>; - compatible = "allnet,uimage"; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = <0x00000006>; }; }; }; |