From patchwork Thu Jun 26 16:45:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 32577 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A0A41201EF for ; Thu, 26 Jun 2014 16:47:20 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id tr6sf21199661ieb.7 for ; Thu, 26 Jun 2014 09:47:20 -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=5ybXCXp+JkUJkx9pT1Xa1bS/J+oP97U2jjH1noQ4tsg=; b=EdRAXA8wjR5/wLksvMtDg936m9J3cxr5cpILGGaks3nBpkAn/VqdcnvNIerEnbAi6o gAwualk8mukXEOwR9aVWO37rQHdrAhBtx37v/1p+nWpjEvZL+Uov9nK9jKaxEYAVR7EF iClIg0/ht7E+ehW9th2F+ivVc2H2MV7an+VkS0KrdmtkSpHtcNKlwXNd73KSLatxHBKv Rtmlgsn7RdikDVVz87xetB9zK5SsW6Q6BAhdU8P+5olhnmDnXeKytzttr1BcqX2LaKb9 wEmA7epz5tDBmgQ2ErtG5pzU4rGYf+Q2rvXniK7XUIyqDpmz2z5bPTkFLjQE9p90Z5TP hiiA== X-Gm-Message-State: ALoCoQmMAW+pnwP2sZgD/hegoMygscglK8oIrAckd6yoW3N5zdQ9ITm/f8Efakfuyp/O7CMhPGkH X-Received: by 10.42.40.148 with SMTP id l20mr7715784ice.12.1403801240213; Thu, 26 Jun 2014 09:47:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.39.85 with SMTP id u79ls264831qgu.61.gmail; Thu, 26 Jun 2014 09:47:20 -0700 (PDT) X-Received: by 10.52.92.100 with SMTP id cl4mr3118711vdb.48.1403801240080; Thu, 26 Jun 2014 09:47:20 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id s5si4905287vcu.2.2014.06.26.09.47.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Jun 2014 09:47:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.176 as permitted sender) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id db12so3928211veb.7 for ; Thu, 26 Jun 2014 09:47:20 -0700 (PDT) X-Received: by 10.58.209.7 with SMTP id mi7mr1486927vec.80.1403801239947; Thu, 26 Jun 2014 09:47:19 -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 tc5csp44086vcb; Thu, 26 Jun 2014 09:47:18 -0700 (PDT) X-Received: by 10.50.13.41 with SMTP id e9mr5772172igc.23.1403801237252; Thu, 26 Jun 2014 09:47:17 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id j9si3465184igm.47.2014.06.26.09.47.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Jun 2014 09:47:17 -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 1X0CoC-0004Lk-Su; Thu, 26 Jun 2014 16:46:00 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X0CoA-0004JE-DZ for xen-devel@lists.xen.org; Thu, 26 Jun 2014 16:45:58 +0000 Received: from [85.158.137.68:12767] by server-15.bemta-3.messagelabs.com id 5F/1A-26980-54E4CA35; Thu, 26 Jun 2014 16:45:57 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-16.tower-31.messagelabs.com!1403801155!12526370!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 22426 invoked from network); 26 Jun 2014 16:45:56 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-16.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 26 Jun 2014 16:45:56 -0000 X-IronPort-AV: E=Sophos;i="5.01,554,1400025600"; d="scan'208";a="147431688" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 26 Jun 2014 16:45:52 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Thu, 26 Jun 2014 12:45:52 -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 1X0Co3-0002AU-U4; Thu, 26 Jun 2014 17:45:51 +0100 From: Ian Campbell To: Date: Thu, 26 Jun 2014 17:45:48 +0100 Message-ID: <1403801151-11007-6-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1403801130.31742.1.camel@kazak.uk.xensource.com> References: <1403801130.31742.1.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH v2 6/9] 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.128.176 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 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 *