From owner-dev-commits-src-all@freebsd.org Sat May 8 14:47:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD1B2636DF8; Sat, 8 May 2021 14:47:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fcqt55Ry0z3CHd; Sat, 8 May 2021 14:47:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE307207B5; Sat, 8 May 2021 14:47:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 148ElfLg087473; Sat, 8 May 2021 14:47:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 148ElfvN087472; Sat, 8 May 2021 14:47:41 GMT (envelope-from git) Date: Sat, 8 May 2021 14:47:41 GMT Message-Id: <202105081447.148ElfvN087472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ruslan Bukin Subject: git: 9146c6240d14 - main - ofw: support for a single 'port' DTS property. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9146c6240d14df78e2cb3397b3ba33eb587e7972 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2021 14:47:41 -0000 The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=9146c6240d14df78e2cb3397b3ba33eb587e7972 commit 9146c6240d14df78e2cb3397b3ba33eb587e7972 Author: Ruslan Bukin AuthorDate: 2021-05-08 14:41:57 +0000 Commit: Ruslan Bukin 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)