From patchwork Fri Jul 18 13:08:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 33843 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3CAB121309 for ; Fri, 18 Jul 2014 13:10:45 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf14376536oag.0 for ; Fri, 18 Jul 2014 06:10:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=p/KttSCY8hC3O4sTLnKyKAwya/3+M8VlkG9hdhMs2aI=; b=jI2IbElG5uSUfuQn6p8FAFOhZleZfjzIr42UpWG7vtu8vzm89poZ+FU7Egotsgl37D kratzgZXBnFYPceRULnY46mZuTIu39YM61roESEEKRivMHQiAD0NE6IHV+qBVtTKX7wE X6yl2L2bbHYx8QVxdKRTKPlFT07CGGStQciq6XRYU+yr8hJ8UIkgvHflrIC7svHNgJ58 Ld0S8htmVijtGs7X+bQqGMn4iHR6OSrmr30ncZNvTamPjs/e+9iOWnLqEPSe82kCeDmU OvB4BEK2qCEliK0GMRzB50QCfC2t4mGpQJ8MPZp495e9eC1wwUaos0sdnr5AQbJbZzVx Qwpw== X-Gm-Message-State: ALoCoQkjAwZa+bSL2pVBTPL7tDRZlMGL/dWRt9bPHx0w6OIIQ/Gm9y9TX1O3X1wzj4yzWv9LMqHR X-Received: by 10.42.208.72 with SMTP id gb8mr2600025icb.24.1405689043494; Fri, 18 Jul 2014 06:10:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.132 with SMTP id o4ls973957qga.40.gmail; Fri, 18 Jul 2014 06:10:43 -0700 (PDT) X-Received: by 10.52.63.226 with SMTP id j2mr4681472vds.43.1405689043387; Fri, 18 Jul 2014 06:10:43 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id u3si5586510vey.74.2014.07.18.06.10.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jul 2014 06:10:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hy4so7497195vcb.27 for ; Fri, 18 Jul 2014 06:10:41 -0700 (PDT) X-Received: by 10.220.15.8 with SMTP id i8mr5506759vca.45.1405689040144; Fri, 18 Jul 2014 06:10:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp9805vcb; Fri, 18 Jul 2014 06:10:39 -0700 (PDT) X-Received: by 10.43.16.133 with SMTP id py5mr7597885icb.46.1405689038566; Fri, 18 Jul 2014 06:10:38 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id k3si4866218igx.63.2014.07.18.06.10.38 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 18 Jul 2014 06:10:38 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X87to-0005Ww-Ml; Fri, 18 Jul 2014 13:08:32 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X87tm-0005Ua-Ta for xen-devel@lists.xen.org; Fri, 18 Jul 2014 13:08:31 +0000 Received: from [85.158.139.211:37491] by server-7.bemta-5.messagelabs.com id 5D/CF-30824-E4C19C35; Fri, 18 Jul 2014 13:08:30 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-16.tower-206.messagelabs.com!1405688906!13360668!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20367 invoked from network); 18 Jul 2014 13:08:28 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 18 Jul 2014 13:08:28 -0000 X-IronPort-AV: E=Sophos;i="5.01,685,1400025600"; d="scan'208";a="153665167" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 18 Jul 2014 13:08:27 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Fri, 18 Jul 2014 09:08:27 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=localhost.localdomain) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1X87ti-0001RL-7d; Fri, 18 Jul 2014 14:08:27 +0100 Received: by localhost.localdomain (sSMTP sendmail emulation); Fri, 18 Jul 2014 14:08:26 +0100 From: Ian Campbell To: Date: Fri, 18 Jul 2014 14:08:16 +0100 Message-ID: <1405688900-11769-6-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1405688876.491.10.camel@kazak.uk.xensource.com> References: <1405688876.491.10.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH v3 06/10] xen: arm: move device_tree_bootargs to bootfdt.c, renaming to boot_fdt_cmdline X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Signed-off-by: Ian Campbell Acked-by: Stefano Stabellini Acked-by: Julien Grall --- 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 bcf4882..23aff5a 100644 --- a/xen/arch/arm/bootfdt.c +++ b/xen/arch/arm/bootfdt.c @@ -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 diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 05336d6..eefb610 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -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); diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 689970d..f72b2e9 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 7e6ab6b..08db8bc 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -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 *