paddr_t start, size;
const char *cmdline;
int len;
+ /* sizeof("/chosen/") + DT_MAX_NAME + '/' + DT_MAX_NAME + '/0' => 92 */
+ char path[92];
+ int ret;
+
+ /* Check that the node is under "/chosen" (first 7 chars of path) */
+ ret = fdt_get_path(fdt, node, path, sizeof (path));
+ if ( ret != 0 || strncmp(path, "/chosen", 7) )
+ return;
prop = fdt_get_property(fdt, node, "reg", &len);
if ( !prop )
{
if ( device_tree_node_matches(fdt, node, "memory") )
process_memory_node(fdt, node, name, address_cells, size_cells);
- else if ( device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) ||
- device_tree_node_compatible(fdt, node, "multiboot,module" ))
+ else if ( depth <= 3 && (device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) ||
+ device_tree_node_compatible(fdt, node, "multiboot,module" )))
process_multiboot_node(fdt, node, name, address_cells, size_cells);
else if ( depth == 1 && device_tree_node_matches(fdt, node, "chosen") )
process_chosen_node(fdt, node, name, address_cells, size_cells);