From patchwork Wed Feb 4 14:02:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 44357 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B2062029F for ; Wed, 4 Feb 2015 14:06:42 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf1503421lbj.0 for ; Wed, 04 Feb 2015 06:06:40 -0800 (PST) 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:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=tiplVeAbTylZI6B0ASzibkcqcWV5SETWYUZV0VOLCw8=; b=A+eQMXcSmCXVxyLWhm8OqZRfNjGmuEy9dy/lUXltcaRJoXTl+XrL28pa1USBERrIpU Ql5ARuZn1E2sIVaBs/5Em7CxhalVv/mULP2gAX2NAfge3j3NNLckJEs6WX08r/4/2t7s QJ/88X7pZPylgZR7LewNIR7pd7krP5MiZnG2kH8vot76ficSKoZIKaQDCpyjFZVcyiwn WDuisiabERQTTRDdu6srwFmdzmEYyGNaZxbP+F0nqDDpBboMrZCyEPKCOv269OLazj9u mKArgrlSOUQfdbqDJurzveRTT9CKPV9wm6z1Vra8bsMR/koExcXP9d+7a5uFEpADmSF8 jU1A== X-Gm-Message-State: ALoCoQk+VJ/n5dWFelHkbly+0W2WAzNWygC55Rh72NKNEW56SoaGvOAQFviaLfB+GuR68AcDo+KT X-Received: by 10.152.36.168 with SMTP id r8mr3906053laj.2.1423058800808; Wed, 04 Feb 2015 06:06:40 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.65 with SMTP id lm1ls38390lac.38.gmail; Wed, 04 Feb 2015 06:06:40 -0800 (PST) X-Received: by 10.152.204.40 with SMTP id kv8mr9984733lac.42.1423058800669; Wed, 04 Feb 2015 06:06:40 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id y4si1406696lag.90.2015.02.04.06.06.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 06:06:40 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id u10so1619332lbd.12 for ; Wed, 04 Feb 2015 06:06:40 -0800 (PST) X-Received: by 10.112.164.101 with SMTP id yp5mr30123441lbb.82.1423058800541; Wed, 04 Feb 2015 06:06:40 -0800 (PST) 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.112.35.133 with SMTP id h5csp507837lbj; Wed, 4 Feb 2015 06:06:39 -0800 (PST) X-Received: by 10.229.70.133 with SMTP id d5mr21499089qcj.2.1423058798719; Wed, 04 Feb 2015 06:06:38 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id 92si2058840qgm.95.2015.02.04.06.06.32 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Feb 2015 06:06:38 -0800 (PST) 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 1YJ0aA-00088k-DV; Wed, 04 Feb 2015 14:05:30 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YJ0a8-000866-BQ for xen-devel@lists.xen.org; Wed, 04 Feb 2015 14:05:28 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id B4/59-02991-72722D45; Wed, 04 Feb 2015 14:05:27 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-2.tower-31.messagelabs.com!1423058725!11988257!1 X-Originating-IP: [209.85.192.173] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18408 invoked from network); 4 Feb 2015 14:05:26 -0000 Received: from mail-pd0-f173.google.com (HELO mail-pd0-f173.google.com) (209.85.192.173) by server-2.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 4 Feb 2015 14:05:26 -0000 Received: by pdjg10 with SMTP id g10so884964pdj.0 for ; Wed, 04 Feb 2015 06:05:25 -0800 (PST) X-Received: by 10.68.94.69 with SMTP id da5mr45940361pbb.99.1423058724878; Wed, 04 Feb 2015 06:05:24 -0800 (PST) Received: from parthd-ubunutu.qualcomm.com ([202.46.23.62]) by mx.google.com with ESMTPSA id kg12sm2161881pbb.44.2015.02.04.06.05.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Feb 2015 06:05:23 -0800 (PST) From: parth.dixit@linaro.org To: xen-devel@lists.xen.org Date: Wed, 4 Feb 2015 19:32:06 +0530 Message-Id: <1423058539-26403-23-git-send-email-parth.dixit@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423058539-26403-1-git-send-email-parth.dixit@linaro.org> References: <1423058539-26403-1-git-send-email-parth.dixit@linaro.org> Cc: ian.campbell@citrix.com, Naresh Bhat , julien.grall@linaro.org, tim@xen.org, stefano.stabellini@citrix.com, jbeulich@suse.com, Parth Dixit , christoffer.dall@linaro.org Subject: [Xen-devel] [PATCH RFC 22/35] xen/arm: Create chosen node for DOM0 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: , MIME-Version: 1.0 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: parth.dixit@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 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: From: Naresh Bhat Create a chosen node for DOM0 with - bootargs - rsdp Signed-off-by: Naresh Bhat Signed-off-by: Parth Dixit --- xen/arch/arm/domain_build.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 30bebe5..d781c63 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -1199,6 +1200,41 @@ static int make_memory_node_acpi(const struct domain *d, return res; } +static int make_chosen_node(const struct domain *d, const struct kernel_info *kinfo) +{ + int res = 0; + const char *bootargs = NULL; + const struct bootmodule *mod = kinfo->kernel_bootmodule; + u64 a = acpi_os_get_root_pointer(); + void *fdt = kinfo->fdt; + __be32 val[2]; + __be32 *cellp; + + DPRINT("Create bootargs chosen node\n"); + + if ( mod && mod->cmdline[0] ) + bootargs = &mod->cmdline[0]; + + res = fdt_begin_node(fdt, "chosen"); + if ( res ) + return res; + + res = fdt_property(fdt, "bootargs", bootargs, (strlen(bootargs)+1)); + if ( res ) + return res; + + cellp = (__be32 *)val; + dt_set_cell(&cellp, ARRAY_SIZE(val), a); + + res = fdt_property(fdt, "rsdp", &val, sizeof(val)); + if ( res ) + return res; + + res = fdt_end_node(fdt); + + return res; +} + /* * Prepare a minimal DTB for DOM0 which contains * bootargs, memory information, @@ -1244,6 +1280,11 @@ static int prepare_dtb_acpi(struct domain *d, struct kernel_info *kinfo) if ( ret ) goto err; + /* Create a chosen node for DOM0 */ + ret = make_chosen_node(d, kinfo); + if ( ret ) + goto err; + ret = fdt_end_node(kinfo->fdt); if ( ret < 0 ) goto err;