From patchwork Thu May 8 00:15:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 4132671 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A948FBFF02 for ; Thu, 8 May 2014 00:18:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F2B620251 for ; Thu, 8 May 2014 00:18:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F6BD200FE for ; Thu, 8 May 2014 00:18:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WiBzw-0001C5-T7; Thu, 08 May 2014 00:15:40 +0000 Received: from mail-ie0-f175.google.com ([209.85.223.175]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WiBzt-0001BF-6Q for linux-arm-kernel@lists.infradead.org; Thu, 08 May 2014 00:15:38 +0000 Received: by mail-ie0-f175.google.com with SMTP id rl12so1846584iec.34 for ; Wed, 07 May 2014 17:15:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=L679NILm+SGvWZzd7Wzkj0MSeNntKou4aKlkDnqY5F8=; b=LFQAYXaKUFwdCQimPp1TygwWzQK67iF2WV7G0xEOYYKdJy1rFHcG/p+M4moy2qhAXX Dg4oIMlyB1v4uy0mrstEUvurr2CLvME/oBvWXGqxxtfHZeg+IqPVYcarvXfrcYXMaVRc 0v5Nj9tF5QQ4wuZHwIBgsVx6xBJc7WNfpT1iTONWeSd0b5w1C/5bSL9aRQBzggVy1vZA 5WMWacONWgBgFZLXR6Cxbwz1q4RJHHj1f3zlO1Dt9+5nN4VVTNPPDjmMtb92HOoHVO6n Mk6vGd67kXNqxfs95Yr9u07bIGG+xv/N26kQq4d/jsmIYWkulrORWLBFwLKdiHE+byzG ua/w== X-Gm-Message-State: ALoCoQnw/fPSxxyQaFvtFwH2wAcnQwkPTFpZBZDW2amVtUIxczO28hHZKF5WGmTe8eY3xVtyYIbl X-Received: by 10.50.153.72 with SMTP id ve8mr49302018igb.16.1399508115331; Wed, 07 May 2014 17:15:15 -0700 (PDT) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id hi8sm1358002igb.8.2014.05.07.17.15.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 17:15:14 -0700 (PDT) Message-ID: <536ACC97.3090102@linaro.org> Date: Wed, 07 May 2014 19:15:19 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "linux-arm-kernel@lists.infradead.org" Subject: Fwd: [PATCH] devicetree: bindings: separate CPU enable method descriptions References: <1399505033-3368-1-git-send-email-elder@linaro.org> In-Reply-To: <1399505033-3368-1-git-send-email-elder@linaro.org> X-Enigmail-Version: 1.5.2 X-Forwarded-Message-Id: <1399505033-3368-1-git-send-email-elder@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140507_171537_376327_9012B613 X-CRM114-Status: GOOD ( 19.12 ) X-Spam-Score: -0.7 (/) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I neglected to copy linux-arm-kernel. -Alex -------- Original Message -------- Subject: [PATCH] devicetree: bindings: separate CPU enable method descriptions Date: Wed, 7 May 2014 18:23:53 -0500 From: Alex Elder To: devicetree@vger.kernel.org CC: mark.rutland@arm.com, sboyd@codeaurora.org, rvaswani@codeaurora.org, linux-kernel@vger.kernel.org The bindings for CPU enable methods are defined in ".../arm/cpus.txt". As additional 32-bit ARM CPUS are converted to use the "enable-method" CPU property to imply a particular set of SMP operations to use, the list of these methods is likely to become unwieldy. The current documentation already contains several property descriptions that are meaningful only for certain enable methods. This patch defines a new Documentation subdirectory whose purpose is to give each CPU enable method its own place to define how and when it's used, as well as what other properties (optional or required) are associated with the method. The existing enable method documentation is expanded and moved from ".../arm/cpus.txt" into new files accordingly. Signed-off-by: Alex Elder --- This series is available here: http://git.linaro.org/landing-teams/working/broadcom/kernel.git Branch review/enable-method-bindings .../bindings/arm/cpu-enable-method/README | 20 +++++ .../bindings/arm/cpu-enable-method/arm,psci.txt | 69 ++++++++++++++++ .../arm/cpu-enable-method/qcom,gcc-msm8660 | 30 +++++++ .../arm/cpu-enable-method/qcom,kpss-acc-v1 | 56 +++++++++++++ .../arm/cpu-enable-method/qcom,kpss-acc-v2 | 56 +++++++++++++ .../bindings/arm/cpu-enable-method/spin-table.txt | 96 ++++++++++++++++++++++ Documentation/devicetree/bindings/arm/cpus.txt | 29 +------ 7 files changed, 330 insertions(+), 26 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/cpu-enable-method/README create mode 100644 Documentation/devicetree/bindings/arm/cpu-enable-method/arm,psci.txt create mode 100644 Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,gcc-msm8660 create mode 100644 Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,kpss-acc-v1 create mode 100644 Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,kpss-acc-v2 create mode 100644 Documentation/devicetree/bindings/arm/cpu-enable-method/spin-table.txt @@ -403,5 +381,4 @@ cpus { }; -- -[1] arm/msm/qcom,saw2.txt -[2] arm/msm/qcom,kpss-acc.txt +[1] arm/cpu-enable-method/ diff --git a/Documentation/devicetree/bindings/arm/cpu-enable-method/README b/Documentation/devicetree/bindings/arm/cpu-enable-method/README new file mode 100644 index 0000000..cc9431e --- /dev/null +++ b/Documentation/devicetree/bindings/arm/cpu-enable-method/README @@ -0,0 +1,20 @@ +========================== +CPU enable-method bindings +========================== + +The device tree describes the layout of CPUs in a machine in a single "cpus" +node, which in turn contains a number of "cpu" sub-nodes defining properties +for each cpu. + +For multiprocessing configurations, CPU cores can be individually enabled +and disabled. The enabling capability is used for SMP startup as well as +CPU hotplug. A CPU enable method--normally specified in the device tree +using an "enable-method" property--defines how cores are enabled. If all +CPUs in a machine use the same enable method and related property values, +these properties should be defined in the "cpus" node, which associates the +property values with all CPUs. Alternatively, every "cpu" node can define +its "enable-method" separately. + +Documents in this directory define how each of the CPU enable methods are to +be used, as well the names and possible values of related properties that +are required by or affect each enable method. diff --git a/Documentation/devicetree/bindings/arm/cpu-enable-method/arm,psci.txt b/Documentation/devicetree/bindings/arm/cpu-enable-method/arm,psci.txt new file mode 100644 index 0000000..c80d68e --- /dev/null +++ b/Documentation/devicetree/bindings/arm/cpu-enable-method/arm,psci.txt @@ -0,0 +1,69 @@ +==================================== +CPU enable-method "arm,psci" binding +==================================== + +This document describes the "arm,psci" method for enabling secondary CPUs. +This is different from other CPU enable methods, in that CPU cores are +enabled and disabled using the ARM PSCI interface, which is defined in the +device tree independent of the CPUs. Instead, a separate node compatible +with "arm,psci" defines the PSCI functions supported; if a "cpu_on" function +is defined, that is used for enabling a CPU core. + +Enable method: Distinct node with compatible = "arm,psci" property +Compatible cpus: (???) (both 32- and 64-bit ARM have a hook) +Properties: + - method + Usage: required + Value type: + Definition: + A string defining the specific instruction + used to enable the core. The value must be + either "hvc" or "smc". + - cpu_suspend + Usage: optional + Value type: + Definition: + If present, this value defines the PSCI function id + used to suspend execution on a CPU core. + - cpu_off + Usage: optional + Value type: + Definition: + If present, this value defines the PSCI function id + used to power down a CPU core. + - cpu_on + Usage: optional + Value type: + Definition: + If present, this value defines the PSCI function id + used to power up a CPU core. + - migrate + Usage: optional + Value type: + Definition: + If present, this value defines the PSCI function id + used to migrate context to a different CPU core. + +Example (contrived 2-core ARM Cortex-A57 64-bit system): + + psci { + compatible = "arm,psci"; + method = "smc"; + cpu_on = 0x1; + }; + cpus { + #size-cells = <0>; + #address-cells = <2>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; /* ??? */ + reg = <0x0 0x0>; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x1>; + }; + }; diff --git a/Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,gcc-msm8660 b/Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,gcc-msm8660 new file mode 100644 index 0000000..1e002d9 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,gcc-msm8660 @@ -0,0 +1,30 @@ +====================================================== +Secondary CPU enable-method "qcom,gcc-msm8660" binding +====================================================== + +This document describes the "qcom,gcc-msm8660" method for enabling +secondary CPUs. A "qcom,gcc-msm8660" enable method should only be +used in the "cpus" node, to apply to all CPUs. + +Enable method name: "qcom,gcc-msm8660" +Compatible cpu: "qcom,scorpion" +Related properties: (none) + +Example: + + cpus { + #address-cells = <1>; + #size-cells = <0>; + compatible = "qcom,scorpion"; + enable-method = "qcom,gcc-msm8660"; + + cpu@0 { + device_type = "cpu"; + reg = <0>; + }; + + cpu@1 { + device_type = "cpu"; + reg = <1>; + }; + }; diff --git a/Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,kpss-acc-v1 b/Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,kpss-acc-v1 new file mode 100644 index 0000000..3f6ce56 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,kpss-acc-v1 @@ -0,0 +1,56 @@ +====================================================== +Secondary CPU enable-method "qcom,kpss-acc-v1" binding +====================================================== + +This document describes the "qcom,kpss-acc-v1" method for enabling CPUs. +This enable method can be used in either the "cpus" node or in individual +"cpu" nodes. Note that each "cpu" node must have both "qcom,saw" and +"qcom,acc" properties defined (even if the "enable-method" property was +defined only in the "cpus" node). + +Enable method name: "qcom,kpss-acc-v1" +Compatible machine: "qcom,msm8960" +Compatible cpu: "qcom,krait" +Related properties: + - qcom,saw + Usage: required (in each "cpu" node") + Value type: + Definition: + Specifies the SAW[1] node associated with this CPU. + + - qcom,acc + Usage: required (in each "cpu" node") + Value type: + Definition: + Specifies the ACC[2] node associated with this CPU. + +Example: + +/ { + compatible = "qcom,msm8960"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + compatible = "qcom,krait"; + enable-method = "qcom,kpss-acc-v1"; + + cpu@0 { + device_type = "cpu"; + reg = <0>; + qcom,acc = <&acc0>; + qcom,saw = <&saw0>; + }; + + cpu@1 { + device_type = "cpu"; + reg = <1>; + qcom,acc = <&acc1>; + qcom,saw = <&saw1>; + }; + }; +}; + +-- +[1] arm/msm/qcom,saw2.txt +[2] arm/msm/qcom,kpss-acc.txt diff --git a/Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,kpss-acc-v2 b/Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,kpss-acc-v2 new file mode 100644 index 0000000..4368d904 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/cpu-enable-method/qcom,kpss-acc-v2 @@ -0,0 +1,56 @@ +====================================================== +Secondary CPU enable-method "qcom,kpss-acc-v2" binding +====================================================== + +This document describes the "qcom,kpss-acc-v2" method for enabling CPUs. +This enable method can be used in either the "cpus" node or in individual +"cpu" nodes. Note that each "cpu" node must have both "qcom,saw" and +"qcom,acc" properties defined (even if the "enable-method" property was +defined only in the "cpus" node). + +Enable method name: "qcom,kpss-acc-v2" +Compatible machine: "qcom,msm8974" +Compatible cpu: "qcom,krait" +Related properties: + - qcom,saw + Usage: required (in each "cpu" node") + Value type: + Definition: + Specifies the SAW[1] node associated with this CPU. + + - qcom,acc + Usage: required (in each "cpu" node") + Value type: + Definition: + Specifies the ACC[2] node associated with this CPU. + +Example: + +/ { + compatible = "qcom,msm8974"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + compatible = "qcom,krait"; + enable-method = "qcom,kpss-acc-v2"; + + cpu@0 { + device_type = "cpu"; + reg = <0>; + qcom,acc = <&acc0>; + qcom,saw = <&saw0>; + }; + + cpu@1 { + device_type = "cpu"; + reg = <1>; + qcom,acc = <&acc1>; + qcom,saw = <&saw1>; + }; + }; +}; + +-- +[1] arm/msm/qcom,saw2.txt +[2] arm/msm/qcom,kpss-acc.txt diff --git a/Documentation/devicetree/bindings/arm/cpu-enable-method/spin-table.txt b/Documentation/devicetree/bindings/arm/cpu-enable-method/spin-table.txt new file mode 100644 index 0000000..f57955a --- /dev/null +++ b/Documentation/devicetree/bindings/arm/cpu-enable-method/spin-table.txt @@ -0,0 +1,96 @@ +================================================ +Secondary CPU enable-method "spin-table" binding +================================================ + +This document describes the "spin-table" method for enabling secondary CPUs. +See the "README" file in this directory for more information on CPU enable +methods. A "spin-table" enable method can be used in either the "cpus" node +or in individual "cpu" nodes. + +Enable method name: "spin-table" +Compatible cpus: "arm,cortex-a57" (?) +Related properties: + - cpu-release-addr + Usage: required + Value type: + Definition: + A two cell value identifying a 64-bit memory location + used by the boot CPU to inform a secondary CPU it + should begin its kernel bootstrap. Memory at this + location must initially be zeroed. + +Examples (contrived 4-core ARM Cortex-A57 64-bit systems): + +The first example uses the same enable method for all cores. + + cpus { + #size-cells = <0>; + #address-cells = <2>; + enable-method = "spin-table"; + cpu-release-addr = <0 0x20000000>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x0>; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x1>; + }; + + cpu@100 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x100>; + }; + + cpu@101 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x101>; + }; + }; + + +The second example uses specifies distinct enable method properties for each +CPU core. + + cpus { + #size-cells = <0>; + #address-cells = <2>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x0>; + enable-method = "spin-table"; + cpu-release-addr = <0 0x20000000>; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x1>; + enable-method = "spin-table"; + cpu-release-addr = <0 0x20000008>; + }; + + cpu@100 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x100>; + enable-method = "spin-table"; + cpu-release-addr = <0 0x20000010>; + }; + + cpu@101 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x101>; + enable-method = "spin-table"; + cpu-release-addr = <0 0x20000018>; + }; + }; diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt index 333f4ae..2bb2a3e 100644 --- a/Documentation/devicetree/bindings/arm/cpus.txt +++ b/Documentation/devicetree/bindings/arm/cpus.txt @@ -185,30 +185,8 @@ nodes to be present and contain the properties described below. "qcom,gcc-msm8660" "qcom,kpss-acc-v1" "qcom,kpss-acc-v2" - - - cpu-release-addr - Usage: required for systems that have an "enable-method" - property value of "spin-table". - Value type: - Definition: - # On ARM v8 64-bit systems must be a two cell - property identifying a 64-bit zero-initialised - memory location. - - - qcom,saw - Usage: required for systems that have an "enable-method" - property value of "qcom,kpss-acc-v1" or - "qcom,kpss-acc-v2" - Value type: - Definition: Specifies the SAW[1] node associated with this CPU. - - - qcom,acc - Usage: required for systems that have an "enable-method" - property value of "qcom,kpss-acc-v1" or - "qcom,kpss-acc-v2" - Value type: - Definition: Specifies the ACC[2] node associated with this CPU. - + Details about use of these CPU enable methods is documented + elsewhere[1]. Example 1 (dual-cluster big.LITTLE system 32-bit):