xen: arm: fix usage of bootargs for Xen.
authorIan Campbell <ian.campbell@citrix.com>
Mon, 21 Oct 2013 09:21:23 +0000 (10:21 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 24 Oct 2013 13:17:47 +0000 (14:17 +0100)
The chosen node's bootargs property should be used for Xen if there is a dom0
kernel multiboot module with a command line, not just if xen,dom0-bootargs is
present.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.linaro.org>
docs/misc/arm/device-tree/booting.txt
xen/common/device_tree.c

index 08ed7751859dbe2d2c32d86d7df371057d7b45a4..8da1e0b8fcf9c98888ed63cd45bd11f1a880288b 100644 (file)
@@ -39,6 +39,8 @@ lines for Xen and Dom0. The logic is the following:
  - If xen,dom0-bootargs is present, it will be used for Dom0.
  - If xen,xen-bootargs is _not_ present, but xen,dom0-bootargs is,
    bootargs will be used for Xen.
+ - If a kernel boot module is present and has a bootargs property then
+   the top-level bootargs will used for Xen.
  - If no Xen specific properties are present, bootargs is for Dom0.
  - If xen,xen-bootargs is present, but xen,dom0-bootargs is missing,
    bootargs will be used for Dom0.
index af0fb0446a7dd03efe2413d61d2521c5105aee8a..f7d021584846ea69bc0319b405545182f1f99fbc 100644 (file)
@@ -240,7 +240,7 @@ static int __init device_tree_for_each_node(const void *fdt,
  */
 const char *device_tree_bootargs(const void *fdt)
 {
-    int node; 
+    int node;
     const struct fdt_property *prop;
 
     node = fdt_path_offset(fdt, "/chosen");
@@ -250,7 +250,13 @@ const char *device_tree_bootargs(const void *fdt)
     prop = fdt_get_property(fdt, node, "xen,xen-bootargs", NULL);
     if ( prop == NULL )
     {
-        if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL))
+        struct dt_mb_module *dom0_mod = NULL;
+
+        if ( early_info.modules.nr_mods >= MOD_KERNEL )
+            dom0_mod = &early_info.modules.module[MOD_KERNEL];
+
+        if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL) ||
+            ( dom0_mod && dom0_mod->cmdline[0] ) )
             prop = fdt_get_property(fdt, node, "bootargs", NULL);
     }
     if ( prop == NULL )