summaryrefslogtreecommitdiff
path: root/lib/fdtdec.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2019-03-21 19:10:01 +0100
committerSimon Glass <sjg@chromium.org>2019-04-11 20:10:50 -0600
commit8153d53b9340e652f78efbf99979d951ba853458 (patch)
treed6b40768826194ba248e97cd35e0ab905e7021bb /lib/fdtdec.c
parent4f253ad064689bc55eaba1c3e7d42f0f358a72c3 (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.c7
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)