From ccb5de587fc0bf119c3010cd25f9b85052d0663a Mon Sep 17 00:00:00 2001 From: Rene Straub Date: Tue, 4 Jun 2019 08:00:02 +0200 Subject: [PATCH] nmhw21: provide bootloader version in device tree --- board/nm/nmhw21/board.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/board/nm/nmhw21/board.c b/board/nm/nmhw21/board.c index 5a2f1e5694..f90b03f8ea 100644 --- a/board/nm/nmhw21/board.c +++ b/board/nm/nmhw21/board.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "../common/bdparser.h" #include "../common/board_descriptor.h" @@ -1200,6 +1201,17 @@ int board_fit_config_name_match(const char *name) #if defined(CONFIG_OF_BOARD_SETUP) && !defined(CONFIG_SPL_BUILD) +static void ft_bootloader_version(void *blob) +{ + int node_offset; + static const char version_string[] = U_BOOT_VERSION_STRING; + + node_offset = fdt_path_offset(blob, "/"); + if (node_offset != -1) { + fdt_setprop_string(blob, node_offset, "nm,bootloader,version", version_string); + } +} + static void ft_hw_info(void *blob) { int node_offset; @@ -1335,6 +1347,7 @@ static void ft_eth(void *blob) int ft_board_setup(void *blob, bd_t *bd) { + ft_bootloader_version(blob); ft_hw_info(blob); ft_user_interface(blob); ft_user_module(blob);