0005-mtd-physmap_of-Move-custom-initialization.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 58ecb60d53d43e8d584708722a2cf851ba88f9e1 Mon Sep 17 00:00:00 2001
  2. From: Linus Walleij <[email protected]>
  3. Date: Thu, 11 Oct 2018 19:53:40 +0200
  4. Subject: [PATCH 05/18] mtd: physmap_of: Move custom initialization
  5. In order to be able to assign custom complex mappings
  6. to the physmap_of plugin for Gemini, move the initialization
  7. so that the simple map is initialized before we enter the
  8. platform-specific functions so the latter can override
  9. them.
  10. Signed-off-by: Linus Walleij <[email protected]>
  11. ---
  12. drivers/mtd/maps/physmap_of_core.c | 15 ++++++++-------
  13. 1 file changed, 8 insertions(+), 7 deletions(-)
  14. --- a/drivers/mtd/maps/physmap_of_core.c
  15. +++ b/drivers/mtd/maps/physmap_of_core.c
  16. @@ -239,13 +239,6 @@ static int of_flash_probe(struct platfor
  17. else if (of_property_read_bool(dp, "little-endian"))
  18. info->list[i].map.swap = CFI_LITTLE_ENDIAN;
  19. - err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
  20. - if (err)
  21. - goto err_out;
  22. - err = of_flash_probe_versatile(dev, dp, &info->list[i].map);
  23. - if (err)
  24. - goto err_out;
  25. -
  26. err = -ENOMEM;
  27. info->list[i].map.virt = ioremap(info->list[i].map.phys,
  28. info->list[i].map.size);
  29. @@ -257,6 +250,14 @@ static int of_flash_probe(struct platfor
  30. simple_map_init(&info->list[i].map);
  31. + /* Variants can override map accessors */
  32. + err = of_flash_probe_gemini(dev, dp, &info->list[i].map);
  33. + if (err)
  34. + goto err_out;
  35. + err = of_flash_probe_versatile(dev, dp, &info->list[i].map);
  36. + if (err)
  37. + goto err_out;
  38. +
  39. /*
  40. * On some platforms (e.g. MPC5200) a direct 1:1 mapping
  41. * may cause problems with JFFS2 usage, as the local bus (LPB)