![]() |
![]()
| ![]() |
![]()
NAME
SYNOPSIS
phandle_t
phandle_t
DESCRIPTIONSome OpenFirmware implementations (FDT, IBM) have a concept of
effective phandle or xrefs. They are used to cross-reference device tree
nodes. For instance, a framebuffer controller may refer to a GPIO controller
and pin that controls the backlight. In this example, the GPIO node would
have a cell (32-bit integer) property with a reserved name like
"phandle" or "linux,phandle" whose value uniquely
identifies the node. The actual name depends on the implementation. The
framebuffer node would have a property with the name described by device
bindings (device-specific set of properties). It can be a cell property or a
combined property with one part of it being a cell. The value of the
framebuffer node's property would be the same as the value of the GPIO
"phandle" property so it can be said that the framebuffer node
refers to the GPIO node. The kernel uses internal logic to assign unique
identifiers to the device tree nodes, and these values do not match the
values of "phandle" properties.
EXAMPLESphandle_t panelnode, panelxref; char *model; if (OF_getencprop(node, "lcd-panel", &panelxref) <= 0) return; panelnode = OF_node_from_xref(panelxref); if (OF_getprop_alloc(hdminode, "model", (void **)&model) <= 0) return; SEE ALSOAUTHORSThis manual page was written by Oleksandr Tymoshenko <gonzo@FreeBSD.org>.
|