mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 06:24:17 +00:00
fdt: Add U-Boot version to chosen node
Add a new device tree property "u-boot,version" in the chosen node to pass the U-Boot version to the operating system. This can be useful to implement a firmware upgrade procedure from the operating system. Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
b85d130ea0
commit
622ecee93a
1 changed files with 10 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
|||
#include <fdt_support.h>
|
||||
#include <exports.h>
|
||||
#include <fdtdec.h>
|
||||
#include <version.h>
|
||||
|
||||
/**
|
||||
* fdt_getprop_u32_default_node - Return a node's property or a default
|
||||
|
@ -305,6 +306,15 @@ int fdt_chosen(void *fdt)
|
|||
}
|
||||
}
|
||||
|
||||
/* add u-boot version */
|
||||
err = fdt_setprop(fdt, nodeoffset, "u-boot,version", PLAIN_VERSION,
|
||||
strlen(PLAIN_VERSION) + 1);
|
||||
if (err < 0) {
|
||||
printf("WARNING: could not set u-boot,version %s.\n",
|
||||
fdt_strerror(err));
|
||||
return err;
|
||||
}
|
||||
|
||||
return fdt_fixup_stdout(fdt, nodeoffset);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue