xen: arm: move device_tree_bootargs to bootfdt.c, renaming to boot_fdt_cmdline
authorIan Campbell <ian.campbell@citrix.com>
Fri, 18 Jul 2014 13:08:16 +0000 (14:08 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 21 Jul 2014 11:16:59 +0000 (12:16 +0100)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/bootfdt.c
xen/arch/arm/setup.c
xen/common/device_tree.c
xen/include/asm-arm/setup.h
xen/include/xen/device_tree.h

index bcf488268b5139cd4e997deddd494533063e5fd8..23aff5a662437f06cc4afc5adfcaf20f0fc79ded 100644 (file)
@@ -335,6 +335,33 @@ size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
     return fdt_totalsize(fdt);
 }
 
+const char *boot_fdt_cmdline(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, "xen,xen-bootargs", NULL);
+    if ( prop == NULL )
+    {
+        struct bootmodule *dom0_mod = NULL;
+
+        if ( bootinfo.modules.nr_mods >= MOD_KERNEL )
+            dom0_mod = &bootinfo.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 )
+        return NULL;
+
+    return prop->data;
+}
+
 /*
  * Local variables:
  * mode: C
index 05336d63565526b36d7c2883075d9a183deec478..eefb6105606094feaa49b96b5491538a96239001 100644 (file)
@@ -686,7 +686,7 @@ void __init start_xen(unsigned long boot_phys_offset,
         + (fdt_paddr & ((1 << SECOND_SHIFT) - 1));
     fdt_size = boot_fdt_info(device_tree_flattened, fdt_paddr);
 
-    cmdline = device_tree_bootargs(device_tree_flattened);
+    cmdline = boot_fdt_cmdline(device_tree_flattened);
     printk("Command line: %s\n", cmdline);
     cmdline_parse(cmdline);
 
index 689970d291797746a6f5dd89ec82c3dc17a991ed..f72b2e9f0f9497d629616f5d82bf2b5b0f7385a7 100644 (file)
@@ -115,37 +115,6 @@ void dt_set_range(__be32 **cellp, const struct dt_device_node *np,
     dt_set_cell(cellp, dt_n_size_cells(np), size);
 }
 
-/**
- * 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, "xen,xen-bootargs", NULL);
-    if ( prop == NULL )
-    {
-        struct bootmodule *dom0_mod = NULL;
-
-        if ( bootinfo.modules.nr_mods >= MOD_KERNEL )
-            dom0_mod = &bootinfo.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 )
-        return NULL;
-
-    return prop->data;
-}
-
 static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
                                        unsigned long align)
 {
index 21dbcd4275b17f393ac385ec416262b8b161d9f3..85aa866430682c9b27999c244167c040af6a14c3 100644 (file)
@@ -54,6 +54,7 @@ int construct_dom0(struct domain *d);
 void discard_initial_modules(void);
 
 size_t __init boot_fdt_info(const void *fdt, paddr_t paddr);
+const char __init *boot_fdt_cmdline(const void *fdt);
 
 #endif
 /*
index 7e6ab6b71c3d4415a96b1b9c8c38d0e0f36a10d2..08db8bc22fb61de65473b090bf301d1865fecb77 100644 (file)
@@ -159,8 +159,6 @@ typedef int (*device_tree_node_func)(const void *fdt,
 
 extern const void *device_tree_flattened;
 
-const char __init *device_tree_bootargs(const void *fdt);
-
 /**
  * dt_unflatten_host_device_tree - Unflatten the host device tree
  *