All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: julien.grall@linaro.org, tim@xen.org,
	Ian Campbell <ian.campbell@citrix.com>,
	stefano.stabellini@eu.citrix.com
Subject: [PATCH v2 6/9] xen: arm: move device_tree_bootargs to bootfdt.c, renaming to boot_fdt_cmdline
Date: Thu, 26 Jun 2014 17:45:48 +0100	[thread overview]
Message-ID: <1403801151-11007-6-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1403801130.31742.1.camel@kazak.uk.xensource.com>

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        |   27 +++++++++++++++++++++++++++
 xen/arch/arm/setup.c          |    2 +-
 xen/common/device_tree.c      |   31 -------------------------------
 xen/include/asm-arm/setup.h   |    1 +
 xen/include/xen/device_tree.h |    2 --
 5 files changed, 29 insertions(+), 34 deletions(-)

diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
index 11182cd..e48a64b 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/arch/arm/bootfdt.c
@@ -333,6 +333,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
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 4a84a32..f1ae408 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -680,7 +680,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);
 
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 89de269..b9deb62 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -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)
 {
diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
index 21dbcd4..85aa866 100644
--- a/xen/include/asm-arm/setup.h
+++ b/xen/include/asm-arm/setup.h
@@ -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
 /*
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 0edec85..b486fc6 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -157,8 +157,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
  *
-- 
1.7.10.4

  parent reply	other threads:[~2014-06-26 16:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 16:45 [PATCH v2 0/9] xen: arm: Refactor/improve early DT parsing and multiboot module support Ian Campbell
2014-06-26 16:45 ` [PATCH v2 1/9] xen: arm: implement generic multiboot compatibility strings Ian Campbell
2014-06-26 16:45 ` [PATCH v2 2/9] xen: arm: /chosen/module@N/bootargs bootprotcol node is not deprecated Ian Campbell
2014-06-26 16:45 ` [PATCH v2 3/9] xen: arm: prefer typesafe max()/min() over MAX()/MIN() Ian Campbell
2014-06-26 16:45 ` [PATCH v2 4/9] xen: arm: rename early_info structs Ian Campbell
2014-06-26 16:45 ` [PATCH v2 5/9] xen: arm: move boot time fdt parsing into separate file Ian Campbell
2014-06-26 16:45 ` Ian Campbell [this message]
2014-06-26 16:45 ` [PATCH v2 7/9] xen: arm: store per-boot module type instead of relying on index Ian Campbell
2014-06-27 10:43   ` Julien Grall
2014-06-27 12:27     ` Ian Campbell
2014-06-26 16:45 ` [PATCH v2 8/9] xen: arm: support bootmodule type detection by ordering Ian Campbell
2014-06-26 16:45 ` [PATCH v2 9/9] xen: arm: update multiboot device tree bindings Ian Campbell
2014-06-26 16:46 ` [PATCH v2 0/9] xen: arm: Refactor/improve early DT parsing and multiboot module support Ian Campbell
2014-06-27 11:58   ` Fu Wei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403801151-11007-6-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.