diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 0d3b59e..0786e22 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -91,6 +91,10 @@ of_add_reserve_entry(initrd_start, initrd_end); data->oftree = of_get_fixed_tree(data->of_root_node); fdt_add_reserve_map(data->oftree); + if (bootm_verbose(data)) + of_print_cmdline(data->of_root_node); + if (bootm_verbose(data) > 1) + of_print_nodes(data->of_root_node, 0); } if (bootm_verbose(data)) { diff --git a/commands/bootm.c b/commands/bootm.c index 5dd1703..6ce2ca9 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -395,13 +395,9 @@ goto err_out; } else { data.of_root_node = of_get_root_node(); - if (bootm_verbose(&data) && data.of_root_node) + if (data.of_root_node) printf("using internal devicetree\n"); } - - - if (bootm_verbose(&data) > 1 && data.of_root_node) - of_print_nodes(data.of_root_node, 0); #endif if (data.os_address == UIMAGE_SOME_ADDRESS) data.os_address = UIMAGE_INVALID_ADDRESS; diff --git a/common/oftree.c b/common/oftree.c index 776d301..475d418 100644 --- a/common/oftree.c +++ b/common/oftree.c @@ -98,6 +98,21 @@ } } +void of_print_cmdline(struct device_node *root) +{ + struct device_node *node = of_find_node_by_path(root, "/chosen"); + const char *cmdline; + + if (!node) { + printf("commandline: no /chosen node\n"); + return; + } + + cmdline = of_get_property(node, "bootargs", NULL); + + printf("commandline: %s\n", cmdline); +} + static int of_fixup_bootargs(struct device_node *root) { struct device_node *node; @@ -161,12 +176,6 @@ } /* - * The size by which we increase the dtb to have space for additional - * fixups. Ideally this would be done by libfdt automatically - */ -#define OFTREE_SIZE_INCREASE 0x8000 - -/* * Get the fixed fdt. This function uses the fdt input pointer * if provided or the barebox internal devicetree if not. * It increases the size of the tree and applies the registered diff --git a/drivers/of/base.c b/drivers/of/base.c index b58a19b..e0d7fd0 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -145,6 +145,9 @@ INIT_LIST_HEAD(&aliases_lookup); + if (!root_node) + return; + of_aliases = of_find_node_by_path(root_node, "/aliases"); if (!of_aliases) return; @@ -691,9 +694,6 @@ if (!node) return; - if (of_node_disabled(node)) - return; - for (i = 0; i < indent; i++) printf("\t"); diff --git a/include/of.h b/include/of.h index 6c75cbd..f8a45a7 100644 --- a/include/of.h +++ b/include/of.h @@ -138,6 +138,7 @@ struct device_node *of_find_node_by_phandle(phandle phandle); void of_print_property(const void *data, int len); +void of_print_cmdline(struct device_node *root); int of_device_is_compatible(const struct device_node *device, const char *compat);