[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 7/8] 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/common/kernel.c | 2 +- xen/include/xen/device_tree.h | 1 + xen/include/xen/lib.h | 2 +- 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 4c0244c..01ead73 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -164,6 +164,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 2422fba..512297f 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -117,6 +117,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/common/kernel.c b/xen/common/kernel.c index 88984d2..145b0b6 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -46,7 +46,7 @@ static void __init assign_integer_param( } } -void __init cmdline_parse(char *cmdline) +void __init cmdline_parse(const char *cmdline) { char opt[100], *optval, *optkey, *q; const char *p = cmdline; 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 diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h index d6f9182..36b4c7f 100644 --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -56,7 +56,7 @@ do { \ struct domain; -void cmdline_parse(char *cmdline); +void cmdline_parse(const char *cmdline); int parse_bool(const char *s); /*#define DEBUG_TRACE_DUMP*/ -- 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 |