Lines Matching refs:dti
43 typedef void (*check_fn)(struct check *c, struct dt_info *dti, struct node *node);
75 static inline void PRINTF(5, 6) check_msg(struct check *c, struct dt_info *dti, in check_msg() argument
86 strcmp(dti->outname, "-") ? dti->outname : "<stdout>", in check_msg()
100 #define FAIL(c, dti, node, ...) \ argument
104 check_msg((c), dti, node, NULL, __VA_ARGS__); \
107 #define FAIL_PROP(c, dti, node, prop, ...) \ argument
111 check_msg((c), dti, node, prop, __VA_ARGS__); \
115 static void check_nodes_props(struct check *c, struct dt_info *dti, struct node *node) in check_nodes_props() argument
121 c->fn(c, dti, node); in check_nodes_props()
124 check_nodes_props(c, dti, child); in check_nodes_props()
127 static bool run_check(struct check *c, struct dt_info *dti) in run_check() argument
129 struct node *dt = dti->dt; in run_check()
142 error = error || run_check(prq, dti); in run_check()
145 check_msg(c, dti, NULL, NULL, "Failed prerequisite '%s'", in run_check()
153 check_nodes_props(c, dti, dt); in run_check()
172 static inline void check_always_fail(struct check *c, struct dt_info *dti, in check_always_fail() argument
175 FAIL(c, dti, node, "always_fail check"); in check_always_fail()
179 static void check_is_string(struct check *c, struct dt_info *dti, in check_is_string() argument
190 FAIL_PROP(c, dti, node, prop, "property is not a string"); in check_is_string()
197 static void check_is_string_list(struct check *c, struct dt_info *dti, in check_is_string_list() argument
214 FAIL_PROP(c, dti, node, prop, "property is not a string list"); in check_is_string_list()
226 static void check_is_cell(struct check *c, struct dt_info *dti, in check_is_cell() argument
237 FAIL_PROP(c, dti, node, prop, "property is not a single cell"); in check_is_cell()
248 static void check_duplicate_node_names(struct check *c, struct dt_info *dti, in check_duplicate_node_names() argument
258 FAIL(c, dti, node, "Duplicate node name"); in check_duplicate_node_names()
262 static void check_duplicate_property_names(struct check *c, struct dt_info *dti, in check_duplicate_property_names() argument
272 FAIL_PROP(c, dti, node, prop, "Duplicate property name"); in check_duplicate_property_names()
284 static void check_node_name_chars(struct check *c, struct dt_info *dti, in check_node_name_chars() argument
290 FAIL(c, dti, node, "Bad character '%c' in node name", in check_node_name_chars()
295 static void check_node_name_chars_strict(struct check *c, struct dt_info *dti, in check_node_name_chars_strict() argument
301 FAIL(c, dti, node, "Character '%c' not recommended in node name", in check_node_name_chars_strict()
306 static void check_node_name_format(struct check *c, struct dt_info *dti, in check_node_name_format() argument
310 FAIL(c, dti, node, "multiple '@' characters in node name"); in check_node_name_format()
314 static void check_unit_address_vs_reg(struct check *c, struct dt_info *dti, in check_unit_address_vs_reg() argument
328 FAIL(c, dti, node, "node has a reg or ranges property, but no unit name"); in check_unit_address_vs_reg()
331 FAIL(c, dti, node, "node has a unit name, but no reg property"); in check_unit_address_vs_reg()
336 static void check_property_name_chars(struct check *c, struct dt_info *dti, in check_property_name_chars() argument
345 FAIL_PROP(c, dti, node, prop, "Bad character '%c' in property name", in check_property_name_chars()
352 struct dt_info *dti, in check_property_name_chars_strict() argument
377 FAIL_PROP(c, dti, node, prop, "Character '%c' not recommended in property name", in check_property_name_chars_strict()
390 static void check_duplicate_label(struct check *c, struct dt_info *dti, in check_duplicate_label() argument
394 struct node *dt = dti->dt; in check_duplicate_label()
411 FAIL(c, dti, node, "Duplicate label '%s' on " DESCLABEL_FMT in check_duplicate_label()
417 static void check_duplicate_label_node(struct check *c, struct dt_info *dti, in check_duplicate_label_node() argument
424 check_duplicate_label(c, dti, l->label, node, NULL, NULL); in check_duplicate_label_node()
430 check_duplicate_label(c, dti, l->label, node, prop, NULL); in check_duplicate_label_node()
433 check_duplicate_label(c, dti, m->ref, node, prop, m); in check_duplicate_label_node()
438 static cell_t check_phandle_prop(struct check *c, struct dt_info *dti, in check_phandle_prop() argument
441 struct node *root = dti->dt; in check_phandle_prop()
451 FAIL_PROP(c, dti, node, prop, "bad length (%d) %s property", in check_phandle_prop()
463 FAIL(c, dti, node, "%s is a reference to another node", in check_phandle_prop()
477 FAIL_PROP(c, dti, node, prop, "bad value (0x%x) in %s property", in check_phandle_prop()
485 static void check_explicit_phandles(struct check *c, struct dt_info *dti, in check_explicit_phandles() argument
488 struct node *root = dti->dt; in check_explicit_phandles()
495 phandle = check_phandle_prop(c, dti, node, "phandle"); in check_explicit_phandles()
497 linux_phandle = check_phandle_prop(c, dti, node, "linux,phandle"); in check_explicit_phandles()
504 FAIL(c, dti, node, "mismatching 'phandle' and 'linux,phandle'" in check_explicit_phandles()
512 FAIL(c, dti, node, "duplicated phandle 0x%x (seen before at %s)", in check_explicit_phandles()
521 static void check_name_properties(struct check *c, struct dt_info *dti, in check_name_properties() argument
537 FAIL(c, dti, node, "\"name\" property is incorrect (\"%s\" instead" in check_name_properties()
555 static void fixup_phandle_references(struct check *c, struct dt_info *dti, in fixup_phandle_references() argument
558 struct node *dt = dti->dt; in fixup_phandle_references()
571 if (!(dti->dtsflags & DTSF_PLUGIN)) in fixup_phandle_references()
572 FAIL(c, dti, node, "Reference to non-existent node or " in fixup_phandle_references()
588 static void fixup_path_references(struct check *c, struct dt_info *dti, in fixup_path_references() argument
591 struct node *dt = dti->dt; in fixup_path_references()
604 FAIL(c, dti, node, "Reference to non-existent node or label \"%s\"\n", in fixup_path_references()
631 static void check_names_is_string_list(struct check *c, struct dt_info *dti, in check_names_is_string_list() argument
642 check_is_string_list(c, dti, node); in check_names_is_string_list()
647 static void check_alias_paths(struct check *c, struct dt_info *dti, in check_alias_paths() argument
656 if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) { in check_alias_paths()
657 FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)", in check_alias_paths()
662 FAIL(c, dti, node, "aliases property name must include only lowercase and '-'"); in check_alias_paths()
667 static void fixup_addr_size_cells(struct check *c, struct dt_info *dti, in fixup_addr_size_cells() argument
691 static void check_reg_format(struct check *c, struct dt_info *dti, in check_reg_format() argument
702 FAIL(c, dti, node, "Root node has a \"reg\" property"); in check_reg_format()
707 FAIL_PROP(c, dti, node, prop, "property is empty"); in check_reg_format()
714 FAIL_PROP(c, dti, node, prop, "property has invalid length (%d bytes) " in check_reg_format()
720 static void check_ranges_format(struct check *c, struct dt_info *dti, in check_ranges_format() argument
731 FAIL_PROP(c, dti, node, prop, "Root node has a \"ranges\" property"); in check_ranges_format()
743 FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its " in check_ranges_format()
748 FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its " in check_ranges_format()
753 FAIL_PROP(c, dti, node, prop, "\"ranges\" property has invalid length (%d bytes) " in check_ranges_format()
765 static void check_pci_bridge(struct check *c, struct dt_info *dti, struct node *node) in check_pci_bridge() argument
778 FAIL(c, dti, node, "node name is not \"pci\" or \"pcie\""); in check_pci_bridge()
782 FAIL(c, dti, node, "missing ranges for PCI bridge (or not a bridge)"); in check_pci_bridge()
785 FAIL(c, dti, node, "incorrect #address-cells for PCI bridge"); in check_pci_bridge()
787 FAIL(c, dti, node, "incorrect #size-cells for PCI bridge"); in check_pci_bridge()
791 FAIL(c, dti, node, "missing bus-range for PCI bridge"); in check_pci_bridge()
795 FAIL_PROP(c, dti, node, prop, "value must be 2 cells"); in check_pci_bridge()
800 FAIL_PROP(c, dti, node, prop, "1st cell must be less than or equal to 2nd cell"); in check_pci_bridge()
802 FAIL_PROP(c, dti, node, prop, "maximum bus number must be less than 256"); in check_pci_bridge()
807 static void check_pci_device_bus_num(struct check *c, struct dt_info *dti, struct node *node) in check_pci_device_bus_num() argument
832 FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)", in check_pci_device_bus_num()
837 static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct node *node) in check_pci_device_reg() argument
850 FAIL(c, dti, node, "missing PCI reg property"); in check_pci_device_reg()
856 FAIL_PROP(c, dti, node, prop, "PCI reg config space address cells 2 and 3 must be 0"); in check_pci_device_reg()
863 FAIL_PROP(c, dti, node, prop, "PCI reg address is not configuration space"); in check_pci_device_reg()
865 FAIL_PROP(c, dti, node, prop, "PCI reg config space address register number must be 0"); in check_pci_device_reg()
877 FAIL(c, dti, node, "PCI unit address format error, expected \"%s\"", in check_pci_device_reg()
903 static void check_simple_bus_bridge(struct check *c, struct dt_info *dti, struct node *node) in check_simple_bus_bridge() argument
910 static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct node *node) in check_simple_bus_reg() argument
934 FAIL(c, dti, node, "missing or empty reg/ranges property"); in check_simple_bus_reg()
944 FAIL(c, dti, node, "simple-bus unit address format error, expected \"%s\"", in check_simple_bus_reg()
949 static void check_unit_address_format(struct check *c, struct dt_info *dti, in check_unit_address_format() argument
961 FAIL(c, dti, node, "unit name should not have leading \"0x\""); in check_unit_address_format()
966 FAIL(c, dti, node, "unit name should not have leading 0s"); in check_unit_address_format()
974 static void check_avoid_default_addr_size(struct check *c, struct dt_info *dti, in check_avoid_default_addr_size() argument
989 FAIL(c, dti, node, "Relying on default #address-cells value"); in check_avoid_default_addr_size()
992 FAIL(c, dti, node, "Relying on default #size-cells value"); in check_avoid_default_addr_size()
997 static void check_avoid_unnecessary_addr_size(struct check *c, struct dt_info *dti, in check_avoid_unnecessary_addr_size() argument
1017 …FAIL(c, dti, node, "unnecessary #address-cells/#size-cells without \"ranges\" or child \"reg\" pro… in check_avoid_unnecessary_addr_size()
1022 struct dt_info *dti, in check_obsolete_chosen_interrupt_controller() argument
1025 struct node *dt = dti->dt; in check_obsolete_chosen_interrupt_controller()
1039 FAIL_PROP(c, dti, node, prop, in check_obsolete_chosen_interrupt_controller()
1045 static void check_chosen_node_is_root(struct check *c, struct dt_info *dti, in check_chosen_node_is_root() argument
1051 if (node->parent != dti->dt) in check_chosen_node_is_root()
1052 FAIL(c, dti, node, "chosen node must be at root node"); in check_chosen_node_is_root()
1056 static void check_chosen_node_bootargs(struct check *c, struct dt_info *dti, in check_chosen_node_bootargs() argument
1069 check_is_string(c, dti, node); in check_chosen_node_bootargs()
1073 static void check_chosen_node_stdout_path(struct check *c, struct dt_info *dti, in check_chosen_node_stdout_path() argument
1086 FAIL_PROP(c, dti, node, prop, "Use 'stdout-path' instead"); in check_chosen_node_stdout_path()
1090 check_is_string(c, dti, node); in check_chosen_node_stdout_path()
1101 struct dt_info *dti, in check_property_phandle_args() argument
1106 struct node *root = dti->dt; in check_property_phandle_args()
1110 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1128 if (dti->dtsflags & DTSF_PLUGIN) in check_property_phandle_args()
1143 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1150 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1162 FAIL(c, dti, node, "Missing property '%s' in node %s or bad phandle (referred from %s[%d])", in check_property_phandle_args()
1170 FAIL_PROP(c, dti, node, prop, in check_property_phandle_args()
1178 struct dt_info *dti, in check_provider_cells_property() argument
1188 check_property_phandle_args(c, dti, node, prop, provider); in check_provider_cells_property()
1234 struct dt_info *dti, in check_gpios_property() argument
1252 check_property_phandle_args(c, dti, node, prop, &provider); in check_gpios_property()
1259 struct dt_info *dti, in check_deprecated_gpio_property() argument
1274 FAIL_PROP(c, dti, node, prop, in check_deprecated_gpio_property()
1296 struct dt_info *dti, in check_interrupts_property() argument
1299 struct node *root = dti->dt; in check_interrupts_property()
1309 FAIL_PROP(c, dti, node, irq_prop, "size (%d) is invalid, expected multiple of %zu", in check_interrupts_property()
1323 (dti->dtsflags & DTSF_PLUGIN)) in check_interrupts_property()
1328 FAIL_PROP(c, dti, parent, prop, "Bad phandle"); in check_interrupts_property()
1332 FAIL(c, dti, irq_node, in check_interrupts_property()
1342 FAIL(c, dti, node, "Missing interrupt-parent"); in check_interrupts_property()
1348 FAIL(c, dti, irq_node, "Missing #interrupt-cells in interrupt-parent"); in check_interrupts_property()
1354 FAIL_PROP(c, dti, node, prop, in check_interrupts_property()
1484 void process_checks(bool force, struct dt_info *dti) in process_checks() argument
1493 error = error || run_check(c, dti); in process_checks()