0101-mtd-add-rtn56u-support.patch 744 B

123456789101112131415161718192021222324252627
  1. --- a/drivers/mtd/mtdpart.c
  2. +++ b/drivers/mtd/mtdpart.c
  3. @@ -806,8 +806,11 @@ static void split_uimage(struct mtd_info
  4. {
  5. struct {
  6. __be32 magic;
  7. - __be32 pad[2];
  8. + __be32 pad0[2];
  9. __be32 size;
  10. + __be32 pad1[4];
  11. + __be32 name[7];
  12. + __be32 kern_size;
  13. } hdr;
  14. size_t len;
  15. @@ -817,7 +820,10 @@ static void split_uimage(struct mtd_info
  16. if (len != sizeof(hdr) || hdr.magic != cpu_to_be32(UBOOT_MAGIC))
  17. return;
  18. - len = be32_to_cpu(hdr.size) + 0x40;
  19. + if (hdr.kern_size != 0 && hdr.name[0] == 0)
  20. + len = be32_to_cpu(hdr.kern_size);
  21. + else
  22. + len = be32_to_cpu(hdr.size) + 0x40;
  23. if (config_enabled(CONFIG_MTD_SPLIT_UIMAGE_FW))
  24. pr_err("Dedicated partitioner didn't split firmware partition, please fill a bug report!\n");