summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristian Marangi <[email protected]>2024-11-10 12:50:24 +0100
committerTom Rini <[email protected]>2024-12-06 13:00:41 -0600
commitcab275c446d3a332890b2751e50636ecf38c1098 (patch)
tree8a6286e07d60ca7e86b8352f17eb557cabe75a56 /include
parent2c19bd15ea7a8e4c3b101fc34b6969719ae4a586 (diff)
dm: core: implement phandle ofnode_options helper
Implement ofnode_options phandle helper to get an ofnode from a phandle option in /options/u-boot. This helper can be useful since new DT yaml usually require to link a phandle of a node instead of referencing it by name or other indirect way. Signed-off-by: Christian Marangi <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/dm/ofnode.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index eea6b13217c..890f0e6cf40 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -1721,6 +1721,21 @@ int ofnode_options_read_int(const char *prop_name, int default_val);
const char *ofnode_options_read_str(const char *prop_name);
/**
+ * ofnode_options_get_by_phandle() - Get a ofnode from phandle from the U-Boot options
+ *
+ * This reads a property from the /options/u-boot/ node of the devicetree.
+ *
+ * This only works with the control FDT.
+ *
+ * See dtschema/schemas/options/u-boot.yaml in dt-schema project for bindings
+ *
+ * @prop_name: property name to look up
+ * @nodep: pointer to ofnode where node is stored
+ * Return: 0, if found, or negative error if not
+ */
+int ofnode_options_get_by_phandle(const char *prop_name, ofnode *nodep);
+
+/**
* ofnode_read_bootscript_address() - Read bootscr-address or bootscr-ram-offset
*
* @bootscr_address: pointer to 64bit address where bootscr-address property value