From patchwork Wed Aug 28 14:47:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19581 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CEAA925E58 for ; Wed, 28 Aug 2013 14:48:34 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id ox1sf6976048veb.0 for ; Wed, 28 Aug 2013 07:48:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=fR7XTFr7l8dNMARaVNPvmeuL1b8idg1WD4rG8pfXYqA=; b=mFFU/9ieN9Qrscn/lcXVyhj1Wpvp8TTJHdiG9E0Y0YHJE8emnYooigYWYCAYGDwQfz Guj4nHDRBXxj+cHtW75M/fAd4YSHPzss+Wb/t9PpOWcz1wetXNOaxuGm8g3hCM8UFrIx BTzwdoInNVQXdqcUCdOaz2MfZhdMMOkf05eeohXRYI1bpeuqnwY9fQGq7+xguLBRLjfN NJn6waRHbBQ87JRqGnZzxaqGqLkGHi8y4/D5JnBry6hrChlrmd1mQ9oL0eolMxkMPPTi pxjDhGgoWuwZTuO+G+rwAA9wlTUM7UeV4cmsTYDBN++mo3FmTT4ZFVKj8nLDhXA8UeO2 21dg== X-Received: by 10.236.166.35 with SMTP id f23mr10224333yhl.22.1377701314591; Wed, 28 Aug 2013 07:48:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.83.7 with SMTP id m7ls412504qey.0.gmail; Wed, 28 Aug 2013 07:48:34 -0700 (PDT) X-Received: by 10.220.88.13 with SMTP id y13mr14283723vcl.20.1377701314460; Wed, 28 Aug 2013 07:48:34 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id u5si6638688vet.0.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id e13so4257221vbg.31 for ; Wed, 28 Aug 2013 07:48:34 -0700 (PDT) X-Gm-Message-State: ALoCoQks6vcicO2HH+s6HSr4Y+XZpYg3HlnSEVgDx9I2q4ZUbHeKVuIhaYRBoNXuCtDk/6J3gb7F X-Received: by 10.52.88.115 with SMTP id bf19mr1678818vdb.12.1377701314385; Wed, 28 Aug 2013 07:48:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp359963vcz; Wed, 28 Aug 2013 07:48:33 -0700 (PDT) X-Received: by 10.194.134.168 with SMTP id pl8mr2736980wjb.74.1377701313338; Wed, 28 Aug 2013 07:48:33 -0700 (PDT) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by mx.google.com with ESMTPS id lq5si1318374wic.50.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:33 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.48 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.48; Received: by mail-wg0-f48.google.com with SMTP id y10so1811416wgg.27 for ; Wed, 28 Aug 2013 07:48:32 -0700 (PDT) X-Received: by 10.194.248.130 with SMTP id ym2mr2964743wjc.61.1377701312689; Wed, 28 Aug 2013 07:48:32 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id a8sm5590498wie.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:31 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, andre.przywara@linaro.org, Julien Grall Subject: [PATCH V1 19/29] xen/arm: Create a fake PSCI node in dom0 device tree Date: Wed, 28 Aug 2013 15:47:33 +0100 Message-Id: <1377701263-3319-20-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1377701263-3319-1-git-send-email-julien.grall@linaro.org> References: <1377701263-3319-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Xen uses PSCI to bring up secondary cpus for the guest. Signed-off-by: Julien Grall --- Changes in v2: - Use fdt_property_cell --- xen/arch/arm/domain_build.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 11f247b..4c936c1 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -306,6 +307,38 @@ static int make_hypervisor_node(void *fdt, const struct dt_device_node *parent) return res; } +static int make_psci_node(void *fdt, const struct dt_device_node *parent) +{ + int res; + + DPRINT("Create PSCI node\n"); + + /* See linux Documentation/devicetree/bindings/arm/psci.txt */ + res = fdt_begin_node(fdt, "psci"); + if ( res ) + return res; + + res = fdt_property_string(fdt, "compatible", "arm,psci"); + if ( res ) + return res; + + res = fdt_property_string(fdt, "method", "hvc"); + if ( res ) + return res; + + res = fdt_property_cell(fdt, "cpu_off", __PSCI_cpu_off); + if ( res ) + return res; + + res = fdt_property_cell(fdt, "cpu_on", __PSCI_cpu_on); + if ( res ) + return res; + + res = fdt_end_node(fdt); + + return res; +} + /* Map the device in the domain */ static int map_device(struct domain *d, const struct dt_device_node *dev) { @@ -393,6 +426,7 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, { DT_MATCH_COMPATIBLE("xen,xen"), DT_MATCH_COMPATIBLE("xen,multiboot-module"), + DT_MATCH_COMPATIBLE("arm,psci"), { /* sentinel */ }, }; const struct dt_device_node *child; @@ -458,6 +492,10 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, res = make_hypervisor_node(kinfo->fdt, np); if ( res ) return res; + + res = make_psci_node(kinfo->fdt, np); + if ( res ) + return res; } res = fdt_end_node(kinfo->fdt);