997-ralink-Introduce-fw_passed_dtb-to-arch-mips-ralink.patch 728 B

12345678910111213141516171819202122232425262728
  1. --- a/arch/mips/ralink/of.c
  2. +++ b/arch/mips/ralink/of.c
  3. @@ -81,13 +81,23 @@ extern struct boot_param_header __image_
  4. void __init plat_mem_setup(void)
  5. {
  6. + void *dtb = NULL;
  7. +
  8. set_io_port_base(KSEG1);
  9. /*
  10. * Load the builtin devicetree. This causes the chosen node to be
  11. - * parsed resulting in our memory appearing
  12. + * parsed resulting in our memory appearing. fw_passed_dtb is used
  13. + * by CONFIG_MIPS_APPENDED_RAW_DTB as well.
  14. */
  15. - __dt_setup_arch(&__image_dtb);
  16. + if (fw_passed_dtb)
  17. + dtb = (void *)fw_passed_dtb;
  18. + else if (__dtb_start != __dtb_end)
  19. + dtb = (void *)__dtb_start;
  20. + else
  21. + dtb = &__image_dtb;
  22. +
  23. + __dt_setup_arch(dtb);
  24. of_scan_flat_dt(early_init_dt_find_chosen, NULL);
  25. if (chosen_dtb)