diff options
author | Thierry Reding <treding@nvidia.com> | 2019-03-21 19:10:01 +0100 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-04-11 20:10:50 -0600 |
commit | 8153d53b9340e652f78efbf99979d951ba853458 (patch) | |
tree | d6b40768826194ba248e97cd35e0ab905e7021bb /lib/fdtdec.c | |
parent | 4f253ad064689bc55eaba1c3e7d42f0f358a72c3 (diff) |
fdtdec: Implement fdtdec_set_phandle()
This function can be used to set a phandle for a given node.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'lib/fdtdec.c')
-rw-r--r-- | lib/fdtdec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c index a51dc5e986..079a9b18aa 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1261,6 +1261,13 @@ __weak void *board_fdt_blob_setup(void) } #endif +int fdtdec_set_phandle(void *blob, int node, uint32_t phandle) +{ + fdt32_t value = cpu_to_fdt32(phandle); + + return fdt_setprop(blob, node, "phandle", &value, sizeof(value)); +} + int fdtdec_setup(void) { #if CONFIG_IS_ENABLED(OF_CONTROL) |