[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 3/5] arm: use bootargs for the command line
From: David Vrabel <david.vrabel@xxxxxxxxxx> Use the /chosen node's bootargs parameter for the Xen command line. Parse it early on before the serial console is setup. Signed-off-by: David Vrabel <david.vrabel@xxxxxxxxxx> --- xen/arch/arm/setup.c | 2 ++ xen/common/device_tree.c | 20 ++++++++++++++++++++ xen/include/xen/device_tree.h | 1 + 3 files changed, 23 insertions(+), 0 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 777f8fb..f89a1f7 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -152,6 +152,8 @@ void __init start_xen(unsigned long boot_phys_offset, + (atag_paddr & ((1 << SECOND_SHIFT) - 1)); fdt_size = device_tree_early_init(fdt); + cmdline_parse(device_tree_bootargs(fdt)); + setup_pagetables(boot_phys_offset); #ifdef EARLY_UART_ADDRESS diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 715fbf6..8fb6d46 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -118,6 +118,26 @@ int device_tree_for_each_node(const void *fdt, return 0; } +/** + * device_tree_bootargs - return the bootargs (the Xen command line) + * @fdt flat device tree. + */ +const char *device_tree_bootargs(const void *fdt) +{ + int node; + const struct fdt_property *prop; + + node = fdt_path_offset(fdt, "/chosen"); + if ( node < 0 ) + return NULL; + + prop = fdt_get_property(fdt, node, "bootargs", NULL); + if ( prop == NULL ) + return NULL; + + return prop->data; +} + static int dump_node(const void *fdt, int node, const char *name, int depth, u32 address_cells, u32 size_cells, void *data) { diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 510b5b4..8e1626c 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -49,6 +49,7 @@ u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name); bool_t device_tree_node_matches(const void *fdt, int node, const char *match); int device_tree_for_each_node(const void *fdt, device_tree_node_func func, void *data); +const char *device_tree_bootargs(const void *fdt); void device_tree_dump(const void *fdt); #endif -- 1.7.2.5 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |