311-bcm63xxpart_use_cfedetection.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --- a/drivers/mtd/bcm63xxpart.c
  2. +++ b/drivers/mtd/bcm63xxpart.c
  3. @@ -35,7 +35,7 @@
  4. #include <asm/mach-bcm63xx/bcm63xx_nvram.h>
  5. #include <asm/mach-bcm63xx/bcm963xx_tag.h>
  6. -#include <asm/mach-bcm63xx/board_bcm963xx.h>
  7. +#include <asm/mach-bcm63xx/bcm63xx_board.h>
  8. #define BCM63XX_EXTENDED_SIZE 0xBFC00000 /* Extended flash address */
  9. @@ -43,30 +43,6 @@
  10. #define BCM63XX_CFE_MAGIC_OFFSET 0x4e0
  11. -static int bcm63xx_detect_cfe(struct mtd_info *master)
  12. -{
  13. - char buf[9];
  14. - int ret;
  15. - size_t retlen;
  16. -
  17. - ret = mtd_read(master, BCM963XX_CFE_VERSION_OFFSET, 5, &retlen,
  18. - (void *)buf);
  19. - buf[retlen] = 0;
  20. -
  21. - if (ret)
  22. - return ret;
  23. -
  24. - if (strncmp("cfe-v", buf, 5) == 0)
  25. - return 0;
  26. -
  27. - /* very old CFE's do not have the cfe-v string, so check for magic */
  28. - ret = mtd_read(master, BCM63XX_CFE_MAGIC_OFFSET, 8, &retlen,
  29. - (void *)buf);
  30. - buf[retlen] = 0;
  31. -
  32. - return strncmp("CFE1CFE1", buf, 8);
  33. -}
  34. -
  35. static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
  36. struct mtd_partition **pparts,
  37. struct mtd_part_parser_data *data)
  38. @@ -85,7 +61,7 @@ static int bcm63xx_parse_cfe_partitions(
  39. u32 computed_crc;
  40. bool rootfs_first = false;
  41. - if (bcm63xx_detect_cfe(master))
  42. + if (!bcm63xx_is_cfe_present())
  43. return -EINVAL;
  44. cfe_erasesize = max_t(uint32_t, master->erasesize,