aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-09-09 14:27:32 +0200
committerJames Cameron <quozl@laptop.org>2019-10-29 13:51:07 +1100
commit8f77a9bb3ae228e11823f05719a3380173f28e39 (patch)
treecfa8fb50f8c50892fb95330fe164ccf000fad2fd
parentdc22b390f3d402f062a32d907ea85862df909837 (diff)
downloadopenfirmware-8f77a9bb3ae228e11823f05719a3380173f28e39.tar.gz
ofwcore: allow drawing device graphs
This adds convenience words for linking device tree nodes into graphs as described in Documentation/devicetree/bindings/graph.txt.
-rw-r--r--ofw/core/ofwcore.fth15
1 files changed, 15 insertions, 0 deletions
diff --git a/ofw/core/ofwcore.fth b/ofw/core/ofwcore.fth
index 378682cf..7266c135 100644
--- a/ofw/core/ofwcore.fth
+++ b/ofw/core/ofwcore.fth
@@ -4237,6 +4237,21 @@ d# 32 buffer: canon-prop
;
\
+\ Device graph helpers
+\
+
+: link-endpoint ( $endpoint1 $endpoint2 -- )
+ find-device ( $endpoint1)
+ encode-phandle " remote-endpoint" property ( )
+ device-end
+;
+
+: link-endpoints ( $endpoint1 $endpoint2 -- )
+ 2over 2over link-endpoint ( $endpoint1 $endpoint2 )
+ 2swap link-endpoint ( )
+;
+
+\
\ Generic Client Interface Services
\