Lines Matching defs:node
54 * This function check the presence of a node (generic use of fdt library).
57 bool fdt_check_node(int node)
62 cchar = fdt_get_name(fdt, node, &len);
68 * This function return global node status (generic use of fdt library).
70 uint8_t fdt_get_status(int node)
75 cchar = fdt_getprop(fdt, node, "status", NULL);
81 cchar = fdt_getprop(fdt, node, "secure-status", NULL);
92 * This function returns the address cells from the node parent.
99 static int fdt_get_node_parent_address_cells(int node)
103 parent = fdt_parent_offset(fdt, node);
119 int node;
121 node = fdt_get_stdout_node_offset(fdt);
122 if (node < 0) {
126 return dt_set_pinctrl_config(node);
130 * This function fills the generic information from a given node.
132 void dt_fill_device_info(struct dt_node_info *info, int node)
136 assert(fdt_get_node_parent_address_cells(node) == 1);
138 cuint = fdt_getprop(fdt, node, "reg", NULL);
145 cuint = fdt_getprop(fdt, node, "clocks", NULL);
153 cuint = fdt_getprop(fdt, node, "resets", NULL);
161 info->status = fdt_get_status(node);
166 * Returns node on success and a negative FDT error code on failure.
170 int node;
172 node = fdt_node_offset_by_compatible(fdt, offset, compat);
173 if (node < 0) {
177 dt_fill_device_info(info, node);
179 return node;
184 * Returns node on success and a negative FDT error code on failure.
188 int node;
190 node = fdt_get_stdout_node_offset(fdt);
191 if (node < 0) {
195 dt_fill_device_info(info, node);
197 return node;
201 * This function returns the node offset matching compatible string in the DT,
207 int node;
209 fdt_for_each_compatible_node(fdt, node, compatible) {
212 assert(fdt_get_node_parent_address_cells(node) == 1);
214 cuint = fdt_getprop(fdt, node, "reg", NULL);
220 return node;
234 int node;
240 node = fdt_node_offset_by_compatible(fdt, -1, DT_DDR_COMPAT);
241 if (node < 0) {
242 INFO("%s: Cannot read DDR node in DT\n", __func__);
246 size = (size_t)fdt_read_uint32_default(fdt, node, "st,mem-size", 0U);
273 * Returns an rdev taken from supply node, NULL otherwise.
277 int node = fdt_node_offset_by_compatible(fdt, -1, DT_PWR_COMPAT);
279 if (node < 0) {
283 return regulator_get_by_supply_name(fdt, node, "vdd");
288 * Returns an rdev taken from supply node, NULL otherwise.
292 int node = fdt_path_offset(fdt, "/cpus/cpu@0");
294 if (node < 0) {
298 return regulator_get_by_supply_name(fdt, node, "cpu");
303 * Returns string taken from model node, NULL otherwise
307 int node = fdt_path_offset(fdt, "/");
309 if (node < 0) {
313 return (const char *)fdt_getprop(fdt, node, "model", NULL);
318 * name: sub-node name to look up.
325 int node;
333 node = fdt_node_offset_by_compatible(fdt, -1, DT_BSEC_COMPAT);
334 if (node < 0) {
335 return node;
338 node = fdt_subnode_offset(fdt, node, name);
339 if (node < 0) {
340 ERROR("nvmem node %s not found\n", name);
341 return node;
344 cuint = fdt_getprop(fdt, node, "reg", &len);
346 ERROR("Malformed nvmem node %s: ignored\n", name);
369 * It also checks node consistency.
374 int node;
384 fdt_for_each_subnode(node, fdt, pinctrl_node) {
390 if (fdt_getprop(fdt, node, "gpio-controller", NULL) == NULL) {
394 cuint = fdt_getprop(fdt, node, "reg", NULL);
403 if (fdt_get_status(node) == DT_DISABLED) {
408 cuint = fdt_getprop(fdt, node, "gpio-ranges", &len);