0120-MIPS-lantiq-add-support-for-device-tree-file-from-bo.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From a32285ed4ba970b868b7fb49b716d776f4410ef6 Mon Sep 17 00:00:00 2001
  2. From: Hauke Mehrtens <hauke@hauke-m.de>
  3. Date: Sat, 19 Mar 2016 16:52:46 +0100
  4. Subject: [PATCH] MIPS: lantiq: add support for device tree file from boot
  5. loader
  6. This fetches the device tree file like it is specified in the MIPS UHI
  7. interface if one was found. This is also used when the device tree file
  8. was appended to the kernel image with cat.
  9. This code is copied from arch/mips/bmips/setup.c.
  10. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  11. ---
  12. arch/mips/lantiq/prom.c | 13 +++++++++++--
  13. 1 file changed, 11 insertions(+), 2 deletions(-)
  14. --- a/arch/mips/lantiq/prom.c
  15. +++ b/arch/mips/lantiq/prom.c
  16. @@ -65,6 +65,8 @@ static void __init prom_init_cmdline(voi
  17. void __init plat_mem_setup(void)
  18. {
  19. + void *dtb;
  20. +
  21. ioport_resource.start = IOPORT_RESOURCE_START;
  22. ioport_resource.end = IOPORT_RESOURCE_END;
  23. iomem_resource.start = IOMEM_RESOURCE_START;
  24. @@ -72,11 +74,18 @@ void __init plat_mem_setup(void)
  25. set_io_port_base((unsigned long) KSEG1);
  26. + if (fw_arg0 == -2) /* UHI interface */
  27. + dtb = (void *)fw_arg1;
  28. + else if (__dtb_start != __dtb_end)
  29. + dtb = (void *)__dtb_start;
  30. + else
  31. + panic("no dtb found");
  32. +
  33. /*
  34. - * Load the builtin devicetree. This causes the chosen node to be
  35. + * Load the devicetree. This causes the chosen node to be
  36. * parsed resulting in our memory appearing
  37. */
  38. - __dt_setup_arch(__dtb_start);
  39. + __dt_setup_arch(dtb);
  40. }
  41. void __init device_tree_init(void)