280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. From 5f2d5915f8ea4785bc2b8a26955e176a7898c15b Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <[email protected]>
  3. Date: Tue, 12 Apr 2022 21:00:43 +0100
  4. Subject: [PATCH] image-fdt: save name of FIT configuration in '/chosen' node
  5. It can be useful for the OS (Linux) to know which configuration has
  6. been chosen by U-Boot when launching a FIT image.
  7. Store the name of the FIT configuration node used in a new string
  8. property called 'u-boot,bootconf' in the '/chosen' node in device tree.
  9. Signed-off-by: Daniel Golle <[email protected]>
  10. Reviewed-by: Tom Rini <[email protected]>
  11. ---
  12. boot/image-fdt.c | 6 ++++++
  13. 1 file changed, 6 insertions(+)
  14. --- a/boot/image-fdt.c
  15. +++ b/boot/image-fdt.c
  16. @@ -637,6 +637,12 @@ int image_setup_libfdt(struct bootm_head
  17. images->fit_uname_cfg,
  18. strlen(images->fit_uname_cfg) + 1, 1);
  19. + /* Store name of configuration node as u-boot,bootconf in /chosen node */
  20. + if (images->fit_uname_cfg)
  21. + fdt_find_and_setprop(blob, "/chosen", "u-boot,bootconf",
  22. + images->fit_uname_cfg,
  23. + strlen(images->fit_uname_cfg) + 1, 1);
  24. +
  25. /* Update ethernet nodes */
  26. fdt_fixup_ethernet(blob);
  27. #if IS_ENABLED(CONFIG_CMD_PSTORE)