git: 9146c6240d14 - main - ofw: support for a single 'port' DTS property.

Ruslan Bukin br at FreeBSD.org
Sat May 8 14:47:41 UTC 2021


The branch main has been updated by br:

URL: https://cgit.FreeBSD.org/src/commit/?id=9146c6240d14df78e2cb3397b3ba33eb587e7972

commit 9146c6240d14df78e2cb3397b3ba33eb587e7972
Author:     Ruslan Bukin <br at FreeBSD.org>
AuthorDate: 2021-05-08 14:41:57 +0000
Commit:     Ruslan Bukin <br at FreeBSD.org>
CommitDate: 2021-05-08 14:41:57 +0000

    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
---
 sys/dev/ofw/ofw_graph.c | 8 ++++++++
 1 file changed, 8 insertions(+)

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)


More information about the dev-commits-src-main mailing list