Lines Matching refs:node

29 typedef void (*check_fn)(struct check *c, struct dt_info *dti, struct node *node);
62 struct node *node, in check_msg() argument
76 else if (node && node->srcpos) in check_msg()
77 pos = node->srcpos; in check_msg()
92 if (node) { in check_msg()
94 xasprintf_append(&str, "%s:%s: ", node->fullpath, prop->name); in check_msg()
96 xasprintf_append(&str, "%s: ", node->fullpath); in check_msg()
106 pos = node->srcpos; in check_msg()
119 #define FAIL(c, dti, node, ...) \ argument
123 check_msg((c), dti, node, NULL, __VA_ARGS__); \
126 #define FAIL_PROP(c, dti, node, prop, ...) \ argument
130 check_msg((c), dti, node, prop, __VA_ARGS__); \
134 static void check_nodes_props(struct check *c, struct dt_info *dti, struct node *node) in check_nodes_props() argument
136 struct node *child; in check_nodes_props()
138 TRACE(c, "%s", node->fullpath); in check_nodes_props()
140 c->fn(c, dti, node); in check_nodes_props()
142 for_each_child(node, child) in check_nodes_props()
156 struct node *dt = dti->dt; in run_check()
200 struct node *node) in check_always_fail() argument
202 FAIL(c, dti, node, "always_fail check"); in check_always_fail()
207 struct node *node) in check_is_string() argument
212 prop = get_property(node, propname); in check_is_string()
217 FAIL_PROP(c, dti, node, prop, "property is not a string"); in check_is_string()
225 struct node *node) in check_is_string_list() argument
232 prop = get_property(node, propname); in check_is_string_list()
241 FAIL_PROP(c, dti, node, prop, "property is not a string list"); in check_is_string_list()
254 struct node *node) in check_is_cell() argument
259 prop = get_property(node, propname); in check_is_cell()
264 FAIL_PROP(c, dti, node, prop, "property is not a single cell"); in check_is_cell()
276 struct node *node) in check_duplicate_node_names() argument
278 struct node *child, *child2; in check_duplicate_node_names()
280 for_each_child(node, child) in check_duplicate_node_names()
290 struct node *node) in check_duplicate_property_names() argument
294 for_each_property(node, prop) { in check_duplicate_property_names()
299 FAIL_PROP(c, dti, node, prop, "Duplicate property name"); in check_duplicate_property_names()
313 struct node *node) in check_node_name_chars() argument
315 size_t n = strspn(node->name, c->data); in check_node_name_chars()
317 if (n < strlen(node->name)) in check_node_name_chars()
318 FAIL(c, dti, node, "Bad character '%c' in node name", in check_node_name_chars()
319 node->name[n]); in check_node_name_chars()
324 struct node *node) in check_node_name_chars_strict() argument
326 int n = strspn(node->name, c->data); in check_node_name_chars_strict()
328 if (n < node->basenamelen) in check_node_name_chars_strict()
329 FAIL(c, dti, node, "Character '%c' not recommended in node name", in check_node_name_chars_strict()
330 node->name[n]); in check_node_name_chars_strict()
335 struct node *node) in check_node_name_format() argument
337 if (strchr(get_unitname(node), '@')) in check_node_name_format()
338 FAIL(c, dti, node, "multiple '@' characters in node name"); in check_node_name_format()
344 struct node *node) in check_node_name_vs_property_name() argument
346 if (!node->parent) in check_node_name_vs_property_name()
349 if (get_property(node->parent, node->name)) { in check_node_name_vs_property_name()
350 FAIL(c, dti, node, "node name and property name conflict"); in check_node_name_vs_property_name()
357 struct node *node) in check_unit_address_vs_reg() argument
359 const char *unitname = get_unitname(node); in check_unit_address_vs_reg()
360 struct property *prop = get_property(node, "reg"); in check_unit_address_vs_reg()
362 if (get_subnode(node, "__overlay__")) { in check_unit_address_vs_reg()
368 prop = get_property(node, "ranges"); in check_unit_address_vs_reg()
375 FAIL(c, dti, node, "node has a reg or ranges property, but no unit name"); in check_unit_address_vs_reg()
378 FAIL(c, dti, node, "node has a unit name, but no reg or ranges property"); in check_unit_address_vs_reg()
384 struct node *node) in check_property_name_chars() argument
388 for_each_property(node, prop) { in check_property_name_chars()
392 FAIL_PROP(c, dti, node, prop, "Bad character '%c' in property name", in check_property_name_chars()
400 struct node *node) in check_property_name_chars_strict() argument
404 for_each_property(node, prop) { in check_property_name_chars_strict()
424 FAIL_PROP(c, dti, node, prop, "Character '%c' not recommended in property name", in check_property_name_chars_strict()
431 #define DESCLABEL_ARGS(node,prop,mark) \ argument
435 ((prop) ? "' in " : ""), (node)->fullpath
438 const char *label, struct node *node, in check_duplicate_label() argument
441 struct node *dt = dti->dt; in check_duplicate_label()
442 struct node *othernode = NULL; in check_duplicate_label()
457 if ((othernode != node) || (otherprop != prop) || (othermark != mark)) in check_duplicate_label()
458 FAIL(c, dti, node, "Duplicate label '%s' on " DESCLABEL_FMT in check_duplicate_label()
460 label, DESCLABEL_ARGS(node, prop, mark), in check_duplicate_label()
465 struct node *node) in check_duplicate_label_node() argument
470 for_each_label(node->labels, l) in check_duplicate_label_node()
471 check_duplicate_label(c, dti, l->label, node, NULL, NULL); in check_duplicate_label_node()
473 for_each_property(node, prop) { in check_duplicate_label_node()
477 check_duplicate_label(c, dti, l->label, node, prop, NULL); in check_duplicate_label_node()
480 check_duplicate_label(c, dti, m->ref, node, prop, m); in check_duplicate_label_node()
486 struct node *node, const char *propname) in check_phandle_prop() argument
488 struct node *root = dti->dt; in check_phandle_prop()
493 prop = get_property(node, propname); in check_phandle_prop()
498 FAIL_PROP(c, dti, node, prop, "bad length (%d) %s property", in check_phandle_prop()
506 if (node != get_node_by_ref(root, m->ref)) in check_phandle_prop()
510 FAIL(c, dti, node, "%s is a reference to another node", in check_phandle_prop()
524 FAIL_PROP(c, dti, node, prop, "bad value (0x%x) in %s property", in check_phandle_prop()
533 struct node *node) in check_explicit_phandles() argument
535 struct node *root = dti->dt; in check_explicit_phandles()
536 struct node *other; in check_explicit_phandles()
540 assert(!node->phandle); in check_explicit_phandles()
542 phandle = check_phandle_prop(c, dti, node, "phandle"); in check_explicit_phandles()
544 linux_phandle = check_phandle_prop(c, dti, node, "linux,phandle"); in check_explicit_phandles()
551 FAIL(c, dti, node, "mismatching 'phandle' and 'linux,phandle'" in check_explicit_phandles()
558 if (other && (other != node)) { in check_explicit_phandles()
559 FAIL(c, dti, node, "duplicated phandle 0x%x (seen before at %s)", in check_explicit_phandles()
564 node->phandle = phandle; in check_explicit_phandles()
569 struct node *node) in check_name_properties() argument
573 for (pp = &node->proplist; *pp; pp = &((*pp)->next)) in check_name_properties()
582 if ((prop->val.len != node->basenamelen + 1U) in check_name_properties()
583 || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { in check_name_properties()
584 FAIL(c, dti, node, "\"name\" property is incorrect (\"%s\" instead" in check_name_properties()
603 struct node *node) in fixup_phandle_references() argument
605 struct node *dt = dti->dt; in fixup_phandle_references()
608 for_each_property(node, prop) { in fixup_phandle_references()
610 struct node *refnode; in fixup_phandle_references()
619 FAIL(c, dti, node, "Reference to non-existent node or " in fixup_phandle_references()
638 struct node *node) in fixup_path_references() argument
640 struct node *dt = dti->dt; in fixup_path_references()
643 for_each_property(node, prop) { in fixup_path_references()
645 struct node *refnode; in fixup_path_references()
653 FAIL(c, dti, node, "Reference to non-existent node or label \"%s\"\n", in fixup_path_references()
669 struct node *node) in fixup_omit_unused_nodes() argument
671 if (generate_symbols && node->labels) in fixup_omit_unused_nodes()
673 if (node->omit_if_unused && !node->is_referenced) in fixup_omit_unused_nodes()
674 delete_node(node); in fixup_omit_unused_nodes()
692 struct node *node) in check_names_is_string_list() argument
696 for_each_property(node, prop) { in check_names_is_string_list()
701 check_is_string_list(c, dti, node); in check_names_is_string_list()
707 struct node *node) in check_alias_paths() argument
711 if (!streq(node->name, "aliases")) in check_alias_paths()
714 for_each_property(node, prop) { in check_alias_paths()
721 FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)", in check_alias_paths()
726 FAIL(c, dti, node, "aliases property name must include only lowercase and '-'"); in check_alias_paths()
732 struct node *node) in fixup_addr_size_cells() argument
736 node->addr_cells = -1; in fixup_addr_size_cells()
737 node->size_cells = -1; in fixup_addr_size_cells()
739 prop = get_property(node, "#address-cells"); in fixup_addr_size_cells()
741 node->addr_cells = propval_cell(prop); in fixup_addr_size_cells()
743 prop = get_property(node, "#size-cells"); in fixup_addr_size_cells()
745 node->size_cells = propval_cell(prop); in fixup_addr_size_cells()
756 struct node *node) in check_reg_format() argument
761 prop = get_property(node, "reg"); in check_reg_format()
765 if (!node->parent) { in check_reg_format()
766 FAIL(c, dti, node, "Root node has a \"reg\" property"); in check_reg_format()
771 FAIL_PROP(c, dti, node, prop, "property is empty"); in check_reg_format()
773 addr_cells = node_addr_cells(node->parent); in check_reg_format()
774 size_cells = node_size_cells(node->parent); in check_reg_format()
778 FAIL_PROP(c, dti, node, prop, "property has invalid length (%d bytes) " in check_reg_format()
785 struct node *node) in check_ranges_format() argument
791 prop = get_property(node, ranges); in check_ranges_format()
795 if (!node->parent) { in check_ranges_format()
796 FAIL_PROP(c, dti, node, prop, "Root node has a \"%s\" property", in check_ranges_format()
801 p_addr_cells = node_addr_cells(node->parent); in check_ranges_format()
802 p_size_cells = node_size_cells(node->parent); in check_ranges_format()
803 c_addr_cells = node_addr_cells(node); in check_ranges_format()
804 c_size_cells = node_size_cells(node); in check_ranges_format()
809 FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its " in check_ranges_format()
811 ranges, c_addr_cells, node->parent->fullpath, in check_ranges_format()
814 FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its " in check_ranges_format()
816 ranges, c_size_cells, node->parent->fullpath, in check_ranges_format()
819 FAIL_PROP(c, dti, node, prop, "\"%s\" property has invalid length (%d bytes) " in check_ranges_format()
832 static void check_pci_bridge(struct check *c, struct dt_info *dti, struct node *node) in check_pci_bridge() argument
837 prop = get_property(node, "device_type"); in check_pci_bridge()
841 node->bus = &pci_bus; in check_pci_bridge()
843 if (!strprefixeq(node->name, node->basenamelen, "pci") && in check_pci_bridge()
844 !strprefixeq(node->name, node->basenamelen, "pcie")) in check_pci_bridge()
845 FAIL(c, dti, node, "node name is not \"pci\" or \"pcie\""); in check_pci_bridge()
847 prop = get_property(node, "ranges"); in check_pci_bridge()
849 FAIL(c, dti, node, "missing ranges for PCI bridge (or not a bridge)"); in check_pci_bridge()
851 if (node_addr_cells(node) != 3) in check_pci_bridge()
852 FAIL(c, dti, node, "incorrect #address-cells for PCI bridge"); in check_pci_bridge()
853 if (node_size_cells(node) != 2) in check_pci_bridge()
854 FAIL(c, dti, node, "incorrect #size-cells for PCI bridge"); in check_pci_bridge()
856 prop = get_property(node, "bus-range"); in check_pci_bridge()
861 FAIL_PROP(c, dti, node, prop, "value must be 2 cells"); in check_pci_bridge()
866 FAIL_PROP(c, dti, node, prop, "1st cell must be less than or equal to 2nd cell"); in check_pci_bridge()
868 FAIL_PROP(c, dti, node, prop, "maximum bus number must be less than 256"); in check_pci_bridge()
873 static void check_pci_device_bus_num(struct check *c, struct dt_info *dti, struct node *node) in check_pci_device_bus_num() argument
879 if (!node->parent || (node->parent->bus != &pci_bus)) in check_pci_device_bus_num()
882 prop = get_property(node, "reg"); in check_pci_device_bus_num()
889 prop = get_property(node->parent, "bus-range"); in check_pci_device_bus_num()
898 FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)", in check_pci_device_bus_num()
903 static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct node *node) in check_pci_device_reg() argument
906 const char *unitname = get_unitname(node); in check_pci_device_reg()
911 if (!node->parent || (node->parent->bus != &pci_bus)) in check_pci_device_reg()
914 prop = get_property(node, "reg"); in check_pci_device_reg()
920 FAIL_PROP(c, dti, node, prop, "PCI reg config space address cells 2 and 3 must be 0"); in check_pci_device_reg()
927 FAIL_PROP(c, dti, node, prop, "PCI reg address is not configuration space"); in check_pci_device_reg()
929 FAIL_PROP(c, dti, node, prop, "PCI reg config space address register number must be 0"); in check_pci_device_reg()
941 FAIL(c, dti, node, "PCI unit address format error, expected \"%s\"", in check_pci_device_reg()
950 static bool node_is_compatible(struct node *node, const char *compat) in node_is_compatible() argument
955 prop = get_property(node, "compatible"); in node_is_compatible()
967 static void check_simple_bus_bridge(struct check *c, struct dt_info *dti, struct node *node) in check_simple_bus_bridge() argument
969 if (node_is_compatible(node, "simple-bus")) in check_simple_bus_bridge()
970 node->bus = &simple_bus; in check_simple_bus_bridge()
975 static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct node *node) in check_simple_bus_reg() argument
978 const char *unitname = get_unitname(node); in check_simple_bus_reg()
984 if (!node->parent || (node->parent->bus != &simple_bus)) in check_simple_bus_reg()
987 prop = get_property(node, "reg"); in check_simple_bus_reg()
991 prop = get_property(node, "ranges"); in check_simple_bus_reg()
994 cells = ((cell_t *)prop->val.val) + node_addr_cells(node); in check_simple_bus_reg()
998 if (node->parent->parent && !(node->bus == &simple_bus)) in check_simple_bus_reg()
999 FAIL(c, dti, node, "missing or empty reg/ranges property"); in check_simple_bus_reg()
1003 size = node_addr_cells(node->parent); in check_simple_bus_reg()
1009 FAIL(c, dti, node, "simple-bus unit address format error, expected \"%s\"", in check_simple_bus_reg()
1018 static void check_i2c_bus_bridge(struct check *c, struct dt_info *dti, struct node *node) in check_i2c_bus_bridge() argument
1020 if (strprefixeq(node->name, node->basenamelen, "i2c-bus") || in check_i2c_bus_bridge()
1021 strprefixeq(node->name, node->basenamelen, "i2c-arb")) { in check_i2c_bus_bridge()
1022 node->bus = &i2c_bus; in check_i2c_bus_bridge()
1023 } else if (strprefixeq(node->name, node->basenamelen, "i2c")) { in check_i2c_bus_bridge()
1024 struct node *child; in check_i2c_bus_bridge()
1025 for_each_child(node, child) { in check_i2c_bus_bridge()
1026 if (strprefixeq(child->name, node->basenamelen, "i2c-bus")) in check_i2c_bus_bridge()
1029 node->bus = &i2c_bus; in check_i2c_bus_bridge()
1033 if (!node->children) in check_i2c_bus_bridge()
1036 if (node_addr_cells(node) != 1) in check_i2c_bus_bridge()
1037 FAIL(c, dti, node, "incorrect #address-cells for I2C bus"); in check_i2c_bus_bridge()
1038 if (node_size_cells(node) != 0) in check_i2c_bus_bridge()
1039 FAIL(c, dti, node, "incorrect #size-cells for I2C bus"); in check_i2c_bus_bridge()
1047 static void check_i2c_bus_reg(struct check *c, struct dt_info *dti, struct node *node) in check_i2c_bus_reg() argument
1050 const char *unitname = get_unitname(node); in check_i2c_bus_reg()
1056 if (!node->parent || (node->parent->bus != &i2c_bus)) in check_i2c_bus_reg()
1059 prop = get_property(node, "reg"); in check_i2c_bus_reg()
1064 FAIL(c, dti, node, "missing or empty reg property"); in check_i2c_bus_reg()
1073 FAIL(c, dti, node, "I2C bus unit address format error, expected \"%s\"", in check_i2c_bus_reg()
1082 FAIL_PROP(c, dti, node, prop, "I2C address must be less than 10-bits, got \"0x%x\"", in check_i2c_bus_reg()
1085 …FAIL_PROP(c, dti, node, prop, "I2C address must be less than 7-bits, got \"0x%x\". Set I2C_TEN_BIT… in check_i2c_bus_reg()
1095 static void check_spi_bus_bridge(struct check *c, struct dt_info *dti, struct node *node) in check_spi_bus_bridge() argument
1099 if (strprefixeq(node->name, node->basenamelen, "spi")) { in check_spi_bus_bridge()
1100 node->bus = &spi_bus; in check_spi_bus_bridge()
1103 struct node *child; in check_spi_bus_bridge()
1105 if (node_addr_cells(node) != 1 || node_size_cells(node) != 0) in check_spi_bus_bridge()
1108 for_each_child(node, child) { in check_spi_bus_bridge()
1112 node->bus = &spi_bus; in check_spi_bus_bridge()
1116 if (node->bus == &spi_bus) in check_spi_bus_bridge()
1120 if (node->bus == &spi_bus && get_property(node, "reg")) in check_spi_bus_bridge()
1121 FAIL(c, dti, node, "node name for SPI buses should be 'spi'"); in check_spi_bus_bridge()
1123 if (node->bus != &spi_bus || !node->children) in check_spi_bus_bridge()
1126 if (get_property(node, "spi-slave")) in check_spi_bus_bridge()
1128 if (node_addr_cells(node) != spi_addr_cells) in check_spi_bus_bridge()
1129 FAIL(c, dti, node, "incorrect #address-cells for SPI bus"); in check_spi_bus_bridge()
1130 if (node_size_cells(node) != 0) in check_spi_bus_bridge()
1131 FAIL(c, dti, node, "incorrect #size-cells for SPI bus"); in check_spi_bus_bridge()
1136 static void check_spi_bus_reg(struct check *c, struct dt_info *dti, struct node *node) in check_spi_bus_reg() argument
1139 const char *unitname = get_unitname(node); in check_spi_bus_reg()
1144 if (!node->parent || (node->parent->bus != &spi_bus)) in check_spi_bus_reg()
1147 if (get_property(node->parent, "spi-slave")) in check_spi_bus_reg()
1150 prop = get_property(node, "reg"); in check_spi_bus_reg()
1155 FAIL(c, dti, node, "missing or empty reg property"); in check_spi_bus_reg()
1162 FAIL(c, dti, node, "SPI bus unit address format error, expected \"%s\"", in check_spi_bus_reg()
1168 struct node *node) in check_unit_address_format() argument
1170 const char *unitname = get_unitname(node); in check_unit_address_format()
1172 if (node->parent && node->parent->bus) in check_unit_address_format()
1179 FAIL(c, dti, node, "unit name should not have leading \"0x\""); in check_unit_address_format()
1184 FAIL(c, dti, node, "unit name should not have leading 0s"); in check_unit_address_format()
1193 struct node *node) in check_avoid_default_addr_size() argument
1197 if (!node->parent) in check_avoid_default_addr_size()
1200 reg = get_property(node, "reg"); in check_avoid_default_addr_size()
1201 ranges = get_property(node, "ranges"); in check_avoid_default_addr_size()
1206 if (node->parent->addr_cells == -1) in check_avoid_default_addr_size()
1207 FAIL(c, dti, node, "Relying on default #address-cells value"); in check_avoid_default_addr_size()
1209 if (node->parent->size_cells == -1) in check_avoid_default_addr_size()
1210 FAIL(c, dti, node, "Relying on default #size-cells value"); in check_avoid_default_addr_size()
1216 struct node *node) in check_avoid_unnecessary_addr_size() argument
1219 struct node *child; in check_avoid_unnecessary_addr_size()
1222 if (!node->parent || node->addr_cells < 0 || node->size_cells < 0) in check_avoid_unnecessary_addr_size()
1225 if (get_property(node, "ranges") || !node->children) in check_avoid_unnecessary_addr_size()
1228 for_each_child(node, child) { in check_avoid_unnecessary_addr_size()
1235 …FAIL(c, dti, node, "unnecessary #address-cells/#size-cells without \"ranges\" or child \"reg\" pro… in check_avoid_unnecessary_addr_size()
1239 static bool node_is_disabled(struct node *node) in node_is_disabled() argument
1243 prop = get_property(node, "status"); in node_is_disabled()
1255 struct node *node, in check_unique_unit_address_common() argument
1258 struct node *childa; in check_unique_unit_address_common()
1260 if (node->addr_cells < 0 || node->size_cells < 0) in check_unique_unit_address_common()
1263 if (!node->children) in check_unique_unit_address_common()
1266 for_each_child(node, childa) { in check_unique_unit_address_common()
1267 struct node *childb; in check_unique_unit_address_common()
1276 for_each_child(node, childb) { in check_unique_unit_address_common()
1291 struct node *node) in check_unique_unit_address() argument
1293 check_unique_unit_address_common(c, dti, node, false); in check_unique_unit_address()
1298 struct node *node) in check_unique_unit_address_if_enabled() argument
1300 check_unique_unit_address_common(c, dti, node, true); in check_unique_unit_address_if_enabled()
1307 struct node *node) in check_obsolete_chosen_interrupt_controller() argument
1309 struct node *dt = dti->dt; in check_obsolete_chosen_interrupt_controller()
1310 struct node *chosen; in check_obsolete_chosen_interrupt_controller()
1313 if (node != dt) in check_obsolete_chosen_interrupt_controller()
1323 FAIL_PROP(c, dti, node, prop, in check_obsolete_chosen_interrupt_controller()
1330 struct node *node) in check_chosen_node_is_root() argument
1332 if (!streq(node->name, "chosen")) in check_chosen_node_is_root()
1335 if (node->parent != dti->dt) in check_chosen_node_is_root()
1336 FAIL(c, dti, node, "chosen node must be at root node"); in check_chosen_node_is_root()
1341 struct node *node) in check_chosen_node_bootargs() argument
1345 if (!streq(node->name, "chosen")) in check_chosen_node_bootargs()
1348 prop = get_property(node, "bootargs"); in check_chosen_node_bootargs()
1353 check_is_string(c, dti, node); in check_chosen_node_bootargs()
1358 struct node *node) in check_chosen_node_stdout_path() argument
1362 if (!streq(node->name, "chosen")) in check_chosen_node_stdout_path()
1365 prop = get_property(node, "stdout-path"); in check_chosen_node_stdout_path()
1367 prop = get_property(node, "linux,stdout-path"); in check_chosen_node_stdout_path()
1370 FAIL_PROP(c, dti, node, prop, "Use 'stdout-path' instead"); in check_chosen_node_stdout_path()
1374 check_is_string(c, dti, node); in check_chosen_node_stdout_path()
1386 struct node *node, in check_property_phandle_args() argument
1390 struct node *root = dti->dt; in check_property_phandle_args()
1394 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1401 struct node *provider_node; in check_property_phandle_args()
1427 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1434 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1446 FAIL(c, dti, node, "Missing property '%s' in node %s or bad phandle (referred from %s[%d])", in check_property_phandle_args()
1454 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1463 struct node *node) in check_provider_cells_property() argument
1468 prop = get_property(node, provider->prop_name); in check_provider_cells_property()
1472 check_property_phandle_args(c, dti, node, prop, provider); in check_provider_cells_property()
1513 struct node *node) in check_gpios_property() argument
1518 if (get_property(node, "gpio-hog")) in check_gpios_property()
1521 for_each_property(node, prop) { in check_gpios_property()
1530 check_property_phandle_args(c, dti, node, prop, &provider); in check_gpios_property()
1538 struct node *node) in check_deprecated_gpio_property() argument
1542 for_each_property(node, prop) { in check_deprecated_gpio_property()
1549 FAIL_PROP(c, dti, node, prop, in check_deprecated_gpio_property()
1556 static bool node_is_interrupt_provider(struct node *node) in node_is_interrupt_provider() argument
1560 prop = get_property(node, "interrupt-controller"); in node_is_interrupt_provider()
1564 prop = get_property(node, "interrupt-map"); in node_is_interrupt_provider()
1573 struct node *node) in check_interrupt_provider() argument
1576 bool irq_provider = node_is_interrupt_provider(node); in check_interrupt_provider()
1578 prop = get_property(node, "#interrupt-cells"); in check_interrupt_provider()
1580 FAIL(c, dti, node, in check_interrupt_provider()
1586 FAIL(c, dti, node, in check_interrupt_provider()
1595 struct node *node) in check_interrupt_map() argument
1597 struct node *root = dti->dt; in check_interrupt_map()
1601 irq_map_prop = get_property(node, "interrupt-map"); in check_interrupt_map()
1605 if (node->addr_cells < 0) { in check_interrupt_map()
1606 FAIL(c, dti, node, in check_interrupt_map()
1610 cellsize = node_addr_cells(node); in check_interrupt_map()
1611 cellsize += propval_cell(get_property(node, "#interrupt-cells")); in check_interrupt_map()
1613 prop = get_property(node, "interrupt-map-mask"); in check_interrupt_map()
1615 FAIL_PROP(c, dti, node, prop, in check_interrupt_map()
1620 FAIL_PROP(c, dti, node, irq_map_prop, in check_interrupt_map()
1628 struct node *provider_node; in check_interrupt_map()
1634 FAIL_PROP(c, dti, node, irq_map_prop, in check_interrupt_map()
1645 FAIL_PROP(c, dti, node, irq_map_prop, in check_interrupt_map()
1653 FAIL_PROP(c, dti, node, irq_map_prop, in check_interrupt_map()
1663 …FAIL(c, dti, node, "Missing property '#interrupt-cells' in node %s or bad phandle (referred from i… in check_interrupt_map()
1679 struct node *node) in check_interrupts_property() argument
1681 struct node *root = dti->dt; in check_interrupts_property()
1682 struct node *irq_node = NULL, *parent = node; in check_interrupts_property()
1686 irq_prop = get_property(node, "interrupts"); in check_interrupts_property()
1691 FAIL_PROP(c, dti, node, irq_prop, "size (%d) is invalid, expected multiple of %zu", in check_interrupts_property()
1695 if (parent != node && node_is_interrupt_provider(parent)) { in check_interrupts_property()
1728 FAIL(c, dti, node, "Missing interrupt-parent"); in check_interrupts_property()
1740 FAIL_PROP(c, dti, node, prop, in check_interrupts_property()
1756 struct node *node) in check_graph_nodes() argument
1758 struct node *child; in check_graph_nodes()
1760 for_each_child(node, child) { in check_graph_nodes()
1765 node->bus = &graph_port_bus; in check_graph_nodes()
1768 if (!node->parent->bus && in check_graph_nodes()
1769 (streq(node->parent->name, "ports") || get_property(node, "reg"))) in check_graph_nodes()
1770 node->parent->bus = &graph_ports_bus; in check_graph_nodes()
1779 struct node *node) in check_graph_child_address() argument
1782 struct node *child; in check_graph_child_address()
1784 if (node->bus != &graph_ports_bus && node->bus != &graph_port_bus) in check_graph_child_address()
1787 for_each_child(node, child) { in check_graph_child_address()
1797 if (cnt == 1 && node->addr_cells != -1) in check_graph_child_address()
1798 …FAIL(c, dti, node, "graph node has single child node '%s', #address-cells/#size-cells are not nece… in check_graph_child_address()
1799 node->children->name); in check_graph_child_address()
1804 struct node *node) in check_graph_reg() argument
1807 const char *unitname = get_unitname(node); in check_graph_reg()
1810 prop = get_property(node, "reg"); in check_graph_reg()
1815 FAIL(c, dti, node, "graph node malformed 'reg' property"); in check_graph_reg()
1821 FAIL(c, dti, node, "graph node unit address error, expected \"%s\"", in check_graph_reg()
1824 if (node->parent->addr_cells != 1) in check_graph_reg()
1825 FAIL_PROP(c, dti, node, get_property(node, "#address-cells"), in check_graph_reg()
1827 node->parent->addr_cells); in check_graph_reg()
1828 if (node->parent->size_cells != 0) in check_graph_reg()
1829 FAIL_PROP(c, dti, node, get_property(node, "#size-cells"), in check_graph_reg()
1831 node->parent->size_cells); in check_graph_reg()
1835 struct node *node) in check_graph_port() argument
1837 if (node->bus != &graph_port_bus) in check_graph_port()
1840 if (!strprefixeq(node->name, node->basenamelen, "port")) in check_graph_port()
1841 FAIL(c, dti, node, "graph port node name should be 'port'"); in check_graph_port()
1843 check_graph_reg(c, dti, node); in check_graph_port()
1847 static struct node *get_remote_endpoint(struct check *c, struct dt_info *dti, in get_remote_endpoint()
1848 struct node *endpoint) in get_remote_endpoint()
1851 struct node *node; in get_remote_endpoint() local
1863 node = get_node_by_phandle(dti->dt, phandle); in get_remote_endpoint()
1864 if (!node) in get_remote_endpoint()
1867 return node; in get_remote_endpoint()
1871 struct node *node) in check_graph_endpoint() argument
1873 struct node *remote_node; in check_graph_endpoint()
1875 if (!node->parent || node->parent->bus != &graph_port_bus) in check_graph_endpoint()
1878 if (!strprefixeq(node->name, node->basenamelen, "endpoint")) in check_graph_endpoint()
1879 FAIL(c, dti, node, "graph endpoint node name should be 'endpoint'"); in check_graph_endpoint()
1881 check_graph_reg(c, dti, node); in check_graph_endpoint()
1883 remote_node = get_remote_endpoint(c, dti, node); in check_graph_endpoint()
1887 if (get_remote_endpoint(c, dti, remote_node) != node) in check_graph_endpoint()
1888 FAIL(c, dti, node, "graph connection to node '%s' is not bidirectional", in check_graph_endpoint()