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

123456789101112131415161718192021222324252627282930313233343536
  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. diff --git a/boot/image-fdt.c b/boot/image-fdt.c
  15. index 692a9ad3e4..fdb69926a2 100644
  16. --- a/boot/image-fdt.c
  17. +++ b/boot/image-fdt.c
  18. @@ -601,6 +601,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
  19. goto err;
  20. }
  21. + /* Store name of configuration node as u-boot,bootconf in /chosen node */
  22. + if (images->fit_uname_cfg)
  23. + fdt_find_and_setprop(blob, "/chosen", "u-boot,bootconf",
  24. + images->fit_uname_cfg,
  25. + strlen(images->fit_uname_cfg) + 1, 1);
  26. +
  27. /* Update ethernet nodes */
  28. fdt_fixup_ethernet(blob);
  29. #if CONFIG_IS_ENABLED(CMD_PSTORE)
  30. --
  31. 2.35.3