diff options
author | Ruslan Bukin <br@FreeBSD.org> | 2021-05-08 14:41:57 +0000 |
---|---|---|
committer | Ruslan Bukin <br@FreeBSD.org> | 2021-05-08 14:41:57 +0000 |
commit | 9146c6240d14df78e2cb3397b3ba33eb587e7972 (patch) | |
tree | 7eb40df8c9235f68ecacf66f201371a0b214b5f0 | |
parent | 2018d4886281275b4222c860545fa97ab97029e3 (diff) | |
download | src-9146c6240d14df78e2cb3397b3ba33eb587e7972.tar.gz src-9146c6240d14df78e2cb3397b3ba33eb587e7972.zip |
ofw: support for a single 'port' DTS property.
On rk3399 the VOP-little node has a single 'port' property (not a
collection of 'ports' or indexed ports).
Reviewed by: manu
Sponsored by: UKRI
Differential Revision: https://reviews.freebsd.org/D30165
-rw-r--r-- | sys/dev/ofw/ofw_graph.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/ofw/ofw_graph.c b/sys/dev/ofw/ofw_graph.c index 0ef53486804d..3f7ddb004eb0 100644 --- a/sys/dev/ofw/ofw_graph.c +++ b/sys/dev/ofw/ofw_graph.c @@ -60,6 +60,14 @@ ofw_graph_get_port_by_idx(phandle_t node, uint32_t idx) if (child != 0) return (child); + /* Now check for 'port' without explicit index. */ + if (idx == 0) { + snprintf(portnode, sizeof(portnode), "port"); + child = ofw_bus_find_child(node, portnode); + if (child != 0) + return (child); + } + /* Next try to look under ports */ ports = ofw_bus_find_child(node, "ports"); if (ports == 0) |