From patchwork Fri Sep 13 12:49:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 20039 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6D9AF28E97 for ; Fri, 13 Sep 2013 12:49:59 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id oy12sf1201316veb.7 for ; Fri, 13 Sep 2013 05:49:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=b9vUWEtkx723ewMjuBgTOqvxJozOGvqU7uYJC985fbw=; b=WMcgD8Yv3YI+LqpHF4y85zHdZCzs0qWorY7KEfG2OuM3Ua619znwl83/+o5vXxrwSI 97KikZFOUTNlm9LPTuBtO6G0CPEiMW6bHErHba7mSMqZxvz4/EW2KamTeXkcAHGhxGbR onG5mit3mlHo2xqvFLGoFiZzD9LFMgIJZ3RHYQg4H1fTYv+byQu6A2FG5Mty3bBfJOVm dOqydsuBmgaMkUoEERY+yyk8GfffFKHwtUFdU6Tp7vGLbASAQLeMevGIOcKp+qnbJgzv B10BiZiCIRrfz98wNIZByP4a3KWU37DuXDMHL0If/MvDoOqQ1Si0l4ik30xTQI16Tcps mFpw== X-Gm-Message-State: ALoCoQmpXIXkdTULemRUuY+Q2l3pvMb9oEqSETmp2OZpmgoZZzvs+zii/sm2B7fKow4+9oO/YLKa X-Received: by 10.236.7.130 with SMTP id 2mr5087043yhp.4.1379076598962; Fri, 13 Sep 2013 05:49:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.18.199 with SMTP id y7ls1173682qed.78.gmail; Fri, 13 Sep 2013 05:49:58 -0700 (PDT) X-Received: by 10.58.100.144 with SMTP id ey16mr1563931veb.25.1379076598743; Fri, 13 Sep 2013 05:49:58 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id ci9si3088291vcb.31.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id gd11so874789vcb.33 for ; Fri, 13 Sep 2013 05:49:58 -0700 (PDT) X-Received: by 10.58.155.68 with SMTP id vu4mr7017574veb.21.1379076598659; Fri, 13 Sep 2013 05:49:58 -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 u4csp78782vcz; Fri, 13 Sep 2013 05:49:58 -0700 (PDT) X-Received: by 10.14.115.133 with SMTP id e5mr18227171eeh.27.1379076596854; Fri, 13 Sep 2013 05:49:56 -0700 (PDT) Received: from mail-ea0-f178.google.com (mail-ea0-f178.google.com [209.85.215.178]) by mx.google.com with ESMTPS id t9si3777371eeo.335.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.178 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.178; Received: by mail-ea0-f178.google.com with SMTP id a15so553374eae.23 for ; Fri, 13 Sep 2013 05:49:56 -0700 (PDT) X-Received: by 10.15.83.2 with SMTP id b2mr18263517eez.28.1379076596379; Fri, 13 Sep 2013 05:49:56 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id p5sm14678420eeg.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:56 -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 v4 15/27] xen/arm: Create a fake PSCI node in dom0 device tree Date: Fri, 13 Sep 2013 13:49:22 +0100 Message-Id: <1379076574-28316-16-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1379076574-28316-1-git-send-email-julien.grall@linaro.org> References: <1379076574-28316-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.174 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 70f48b6..e1333a4 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 @@ -319,6 +320,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) { @@ -406,6 +439,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; @@ -471,6 +505,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);