From: David Vrabel Date: Mon, 2 Apr 2012 15:50:42 +0000 (+0100) Subject: arm: use bootargs for the command line X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=df8a4a8c5f33de9d2eb9f2a2c303c63ee8245a0a;p=xen.git arm: use bootargs for the command line 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 Acked-by: Ian Campbell Committed-by: Ian Campbell --- diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 4e077cda5e..2c25623f74 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 715fbf6657..8fb6d463c3 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 510b5b48ba..8e1626cf8b 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