From patchwork Mon Jun 16 11:44:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 31957 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7C0BA2107C for ; Mon, 16 Jun 2014 11:47:17 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id id10sf19903169vcb.7 for ; Mon, 16 Jun 2014 04:47:17 -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=CohNGl5nNY/N1K9hDC5/ilTVL+qVHfB6AknE7bsljsY=; b=Cjy54TZrG7Kwcdee5OQmFHuzoApMsmMPPwshuXqS3alKp2cgfVLgqG95JeO7mfSF7B 5xZoBS2d4kVJWcb0aav8jVmKhpx3bHQXsymlNDTxaZF1/3jmFXYuIbiTZQ3rkvRM18FI 3zPswk06QDLOhkAz2BUvDK+qIIXHWWRnE72EspRcFcRzuciCSIhhlhe2QpuvizrP7ltw Q+rEVqH+hnMoIjh82p36NoRMCeeOVTgDm7zbsvfUmTFD13reFPK1e41KLG2OQJi2asZL wxEb8Cyd1T7IUk2PAS5iF0B1QjCCaYSoBTij5G2bhFnQhomzPjISRclxnH7luufmDQ2S YKew== X-Gm-Message-State: ALoCoQl2mEEbJrpn1bjc6yiQM4gwDC7qJ3rZw6XytrLhqF8d2vU/ReDt+xIQduRv0IlGzODDS5W5 X-Received: by 10.58.187.44 with SMTP id fp12mr1269953vec.24.1402919237317; Mon, 16 Jun 2014 04:47:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.42.111 with SMTP id b102ls4456340qga.31.gmail; Mon, 16 Jun 2014 04:47:17 -0700 (PDT) X-Received: by 10.52.165.37 with SMTP id yv5mr125034vdb.58.1402919237246; Mon, 16 Jun 2014 04:47:17 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id g6si3999912vdk.30.2014.06.16.04.47.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 04:47:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jw12so5718398veb.25 for ; Mon, 16 Jun 2014 04:47:17 -0700 (PDT) X-Received: by 10.52.5.129 with SMTP id s1mr3847109vds.31.1402919237145; Mon, 16 Jun 2014 04:47:17 -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.54.6 with SMTP id vs6csp128530vcb; Mon, 16 Jun 2014 04:47:16 -0700 (PDT) X-Received: by 10.224.161.138 with SMTP id r10mr26560867qax.2.1402919236720; Mon, 16 Jun 2014 04:47:16 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id n104si9876390qgd.74.2014.06.16.04.47.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Jun 2014 04:47:16 -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 1WwVLd-0003OO-4a; Mon, 16 Jun 2014 11:45:13 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwVLY-0003M1-Dq for xen-devel@lists.xen.org; Mon, 16 Jun 2014 11:45:10 +0000 Received: from [85.158.139.211:2753] by server-6.bemta-5.messagelabs.com id 0B/23-25531-3C8DE935; Mon, 16 Jun 2014 11:45:07 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1402919104!10179946!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4795 invoked from network); 16 Jun 2014 11:45:06 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 16 Jun 2014 11:45:06 -0000 X-IronPort-AV: E=Sophos;i="5.01,486,1400025600"; d="scan'208";a="143697243" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 16 Jun 2014 11:45:04 +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; Mon, 16 Jun 2014 07:45:04 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=marilith-n13.uk.xensource.com.) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WwVLU-000152-06; Mon, 16 Jun 2014 12:45:04 +0100 From: Ian Campbell To: Date: Mon, 16 Jun 2014 12:44:59 +0100 Message-ID: <1402919103-29642-6-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1402919079.14907.22.camel@kazak.uk.xensource.com> References: <1402919079.14907.22.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Campbell , stefano.stabellini@eu.citrix.com, Naresh Bhat , julien.grall@linaro.org, tim@xen.org, Roy Franz , Fu Wei Subject: [Xen-devel] [PATCH 06/10] xen: arm: 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.128.180 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: Julien Grall Acked-by: Stefano Stabellini --- 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 *