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
This commit is contained in:
Ruslan Bukin 2021-05-08 15:41:57 +01:00
parent 2018d48862
commit 9146c6240d

View file

@ -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)