arm: use bootargs for the command line
authorDavid Vrabel <david.vrabel@citrix.com>
Mon, 2 Apr 2012 15:50:42 +0000 (16:50 +0100)
committerDavid Vrabel <david.vrabel@citrix.com>
Mon, 2 Apr 2012 15:50:42 +0000 (16:50 +0100)
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@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/setup.c
xen/common/device_tree.c
xen/include/xen/device_tree.h

index 4e077cda5e2608d1ee3428c94874ecf3de04e433..2c25623f746b4697d45a63dee8e672f6d40cd94e 100644 (file)
@@ -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
index 715fbf665729329b17690480a7fd0975803971dc..8fb6d463c3ecce668364806b4d112ffce00c17c2 100644 (file)
@@ -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)
 {
index 510b5b48bacd0bd1d2b2fea77cb89d51edbead41..8e1626cf8b6b90fa582b8a8320e14fb8ba3200b2 100644 (file)
@@ -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