core: ofnode: add of_graph parsing helpers
v2 cover core: ofnode: add of_graph parsing helpers
Add a mostly complete list of ofnode analogs of of_graph parsing helpers.
---
Changes in v2:
- added tests
---
Svyatoslav Ryhel (2):
core: ofnode: add of_graph parsing helpers
test: dm: add ofnode_graph tests
arch/sandbox/dts/test.dts | 53 +++++++++ drivers/core/Makefile | 2 +- drivers/core/ofnode_graph.c | 217 ++++++++++++++++++++++++++++++++++++ include/dm/ofnode_graph.h | 90 +++++++++++++++ test/dm/ofnode.c | 54 +++++++++ 5 files changed, 415 insertions(+), 1 deletion(-) create mode 100644 drivers/core/ofnode_graph.c create mode 100644 include/dm/ofnode_graph.h
Signature · 1 line
2.43.0
PATCH v2 1/2 core: ofnode: add of_graph parsing helpers
Add a mostly complete list of ofnode analogs of of_graph parsing helpers.
Signed-off-by Svyatoslav Ryhel <[email protected]>
--- drivers/core/Makefile | 2 +- drivers/core/ofnode_graph.c | 217 ++++++++++++++++++++++++++++++++++++ include/dm/ofnode_graph.h | 90 +++++++++++++++ 3 files changed, 308 insertions(+), 1 deletion(-) create mode 100644 drivers/core/ofnode_graph.c create mode 100644 include/dm/ofnode_graph.h
drivers/core/Makefile +1 -1
@@ -16,6 +16,6 @@ ifndef CONFIG_DM_DEV_READ_INLINE obj-$(CONFIG_OF_CONTROL) += read.o endif obj-$(CONFIG_$(XPL_)OF_PLATDATA) += read.o -obj-$(CONFIG_OF_CONTROL) += of_extra.o ofnode.o read_extra.o +obj-$(CONFIG_OF_CONTROL) += of_extra.o ofnode.o read_extra.o ofnode_graph.o ccflags-$(CONFIG_DM_DEBUG) += -DDEBUG
drivers/core/ofnode_graph.c new file +217 -0
217 lines not on this page · raw message
include/dm/ofnode_graph.h new file +90 -0
90 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v2 2/2 test: dm: add ofnode_graph tests
In reply to Svyatoslav RyhelTest suit for of_graph parsing helpers.
Signed-off-by Svyatoslav Ryhel <[email protected]>
--- arch/sandbox/dts/test.dts | 53 ++++++++++++++++++++++++++++++++++++++ test/dm/ofnode.c | 54 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+)
arch/sandbox/dts/test.dts +53 -0
@@ -2048,6 +2048,59 @@ sandbox,err-step-size = <512>; }; }; + + graph1 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + #address-cells = <1>; + #size-cells = <0>; + + reg = <0>; + + endpoint@0 { + reg = <0>; + }; + + endpoint@1 { + reg = <1>; + }; + }; + + port@1 { + endpoint { + test-property-0; + }; + }; + + port@2 { + #address-cells = <1>; + #size-cells = <0>; + + reg = <2>; + + graph2_link: endpoint@0 { + reg = <0>; + test-property-1; + remote-endpoint = <&graph1_link>; + }; + + endpoint@1 { + reg = <1>; + }; + }; + }; + }; + + graph2 { + port { + graph1_link: endpoint { + remote-endpoint = <&graph2_link>; + }; + }; + }; }; #include "sandbox_pmic.dtsi"
test/dm/ofnode.c +54 -0
63 lines not on this page · raw message
Signature · 1 line
2.43.0