/** * unflatten_device_tree - create tree of device_nodes from flat blob * * unflattens the device-tree passed by the firmware, creating the * tree of struct device_node. It also fills the "name" and "type" * pointers of the nodes so the normal device-tree walking functions * can be used. */ void __init unflatten_device_tree(void) { __unflatten_device_tree(initial_boot_params, &of_allnodes, early_init_dt_alloc_memory_arch); /* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */ of_alias_scan(early_init_dt_alloc_memory_arch); }
void __init of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops) { BUG_ON(!ops); of_pdt_prom_ops = ops; of_root = of_pdt_create_node(root_node, NULL); #if defined(CONFIG_SPARC) of_root->path_component_name = ""; #endif of_root->full_name = "/"; of_root->child = of_pdt_build_tree(of_root, of_pdt_prom_ops->getchild(of_root->phandle)); /* Get pointer to "/chosen" and "/aliases" nodes for use everywhere */ of_alias_scan(kernel_tree_alloc); }