From patchwork Tue Sep 10 14:49:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19917 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EA3DB246A4 for ; Tue, 10 Sep 2013 14:49:43 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf8784179yhz.3 for ; Tue, 10 Sep 2013 07:49:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=L7+8hcZAdxl4neq+A/YuX1ZBp3F84KfA2q8H4tVLX5k=; b=jCd6p+2irKTBtVq+wd/E8GTaGyxTS7oNRIX4svCj4mrrgtBlnLqIsLgp/S7tBx98q6 usBA9Q/CTnB4Ns/L68RGGrPbcZvAFGO2TqG1h+Q0qHSfnx7TyHSRtAEMLYvtIQ+422rg 6qnW+F+kc3nSIlR03IXckiFbZhP5dWXfYvTy7Yd7QGPpFrPNDmja/trr66KQy/WHVSAy PKqLsGCzQIK78K0JlQtqIMcUApUAeT+ND6lFp96VVhPX7cAX6q3Ieb8lYeNjTB26hy1O znXTSVYrAcy1/vpp56zaSH1IWjHpofVE3n8UbDvZTP8cnlS0/39xG44B9n0rqoZmwZQU JD9A== X-Received: by 10.236.45.102 with SMTP id o66mr3300128yhb.47.1378824583679; Tue, 10 Sep 2013 07:49:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.134.74 with SMTP id pi10ls2155464qeb.35.gmail; Tue, 10 Sep 2013 07:49:43 -0700 (PDT) X-Received: by 10.58.208.130 with SMTP id me2mr23468629vec.13.1378824583388; Tue, 10 Sep 2013 07:49:43 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id fa1si4539744ved.13.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id kw10so5309236vcb.1 for ; Tue, 10 Sep 2013 07:49:43 -0700 (PDT) X-Gm-Message-State: ALoCoQkQZZlM/C2eAaKdVUlMpdNT/tS0XsJN7MqqD29qemEFdjQ7NO0mbhLyMOsyItFkkclQSOBY X-Received: by 10.221.6.195 with SMTP id ol3mr312646vcb.34.1378824583270; Tue, 10 Sep 2013 07:49:43 -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 u4csp4665vcz; Tue, 10 Sep 2013 07:49:42 -0700 (PDT) X-Received: by 10.14.39.73 with SMTP id c49mr3712469eeb.61.1378824582267; Tue, 10 Sep 2013 07:49:42 -0700 (PDT) Received: from mail-ee0-f45.google.com (mail-ee0-f45.google.com [74.125.83.45]) by mx.google.com with ESMTPS id t9si3165001eeo.185.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:42 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.45 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.45; Received: by mail-ee0-f45.google.com with SMTP id c50so3930548eek.32 for ; Tue, 10 Sep 2013 07:49:41 -0700 (PDT) X-Received: by 10.14.207.4 with SMTP id m4mr2823657eeo.78.1378824581661; Tue, 10 Sep 2013 07:49:41 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id i1sm31911644eeg.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:41 -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 v3 15/27] xen/arm: Create a fake PSCI node in dom0 device tree Date: Tue, 10 Sep 2013 15:49:03 +0100 Message-Id: <1378824555-16564-16-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378824555-16564-1-git-send-email-julien.grall@linaro.org> References: <1378824555-16564-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.220.170 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 31422d0..e3229c7 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 @@ -298,6 +299,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) { @@ -385,6 +418,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; @@ -450,6 +484,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);