From patchwork Wed Mar 14 16:58:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 131679 Delivered-To: patches@linaro.org Received: by 10.80.210.197 with SMTP id q5csp410475edg; Wed, 14 Mar 2018 09:59:20 -0700 (PDT) X-Received: by 10.46.83.27 with SMTP id h27mr3779894ljb.88.1521046760802; Wed, 14 Mar 2018 09:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521046760; cv=none; d=google.com; s=arc-20160816; b=m3ZHHOG4L9/zD4MoE9Iu2Rm/OLyEmoqY236zgYpuTWrBcuU4Mjy9ljPkQ7Sk1H0I7v FRa/dwq2Bug06RWjVk0UyH4LWZX8Na87jsUD/RjUk0Xmq+4wrAbdRvgC9j0pKMvWbHzn PzTeZJvmkHGymKR6AAH44Z+0bGe2tplYOJnc/IyxPJqM+u39+kHpfGfTcPk152KqhTbt DzclAaECMrCBNSqJZ7o801lvQoqGga7ikw2k9Q7h+onzAz1WlyKdzfJIqFn1LStUJwJg nJ09CdhKLgcPMV93GtyXetQhI3ZZPuIRqiyFBRt+aizbpHaAyeejZ2vh199iDPbeo+Gl anew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=9Rk0XsmJ8ZMwWIgsjyCup4TjKqspAVxuol9gCIzu2NQ=; b=HTmBQFYsIn07jEcxfZi2dr/+UxPSlBDZyLyljyEp1zf/OkePmuYzhjt3PJBwidKG92 DLLFs3+Xpy5idq6yW7amPQiK97eheYjta16gsuWmAQcgEl0xXyzWohUw0xkfk2rEapCu SkxsQ6Ta0/g/h2EoDvr4Fww54Qsj4G29RS/UWshIPuMYRip6yt0fdawfrhKYqipd7/hB OzLYHkXy5ATx39zUajhBBsPzBUuM9QvCdnP5x628l9itvogqF7S60yp9zmk3h4bRX7Wh vWtLpuF1Cf8By7h9XWRhOVmIx8nuYKZG3cgF1qc5ScWlkg+r+4MXphREIGwUQ3AhwuOj lklQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhSMCe1W; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id y6-v6sor888748lfj.60.2018.03.14.09.59.20 for (Google Transport Security); Wed, 14 Mar 2018 09:59:20 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhSMCe1W; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9Rk0XsmJ8ZMwWIgsjyCup4TjKqspAVxuol9gCIzu2NQ=; b=jhSMCe1WbIOPUQ7T2LR0PUAl+QYZ9Q1MklDq8bJnC0c0krvWfzpJye3QU1N4dwuvB6 E7EM+Dh/wGRva+fyYIw7A1HXV1Cmwrtdb+rxAzu9zK7obWewmBqf+4A7c9cL4KCtXuq3 m520bs94pMw2RoJ7V9n1BUaodrVmM+VN8sRuM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9Rk0XsmJ8ZMwWIgsjyCup4TjKqspAVxuol9gCIzu2NQ=; b=tzTGpMMg/olR+SoPqB6C7000U1fpJYEsHQdKCbMtmv44GH06EWgCPU+5XfOfkrkBEw 5hwM040+afq0yaA2Zd6pSjESDguJGFsRzIIyjwg0p6UOuUCHxqGw1jM8LareP2iseEtC Fct0dH9AcRXa7ZucfOsQ/M93j8ySxrBJn7WioB86GxMJQ69klknptKqY/GhsvwtxdCU2 mkO1rcmwTqIGLL3tPp/5cfNdxXOhRatpK6C1Dzk5rzBkL9w/ML57nmDSGgJnu+uP1n7U qdb9acUdDxohaKwh+Wt1icgzD8mcQQ03mGXWmN+fMMikhPSLpg+5X1ymW4WdXWGMI+q9 F7WA== X-Gm-Message-State: AElRT7E/z9vs8zrIb3G0RNlgmQg5NvFkmgsIR4/K6EMvSkBmnqRCEpvi k0w/ro/xGj11EjkOqP0JSolJkDC0 X-Google-Smtp-Source: AG47ELvGA/2X5mSaZA6j4H5UjXFIntfNALASRbl88bwgrKbBmH9gE4bw4Pcg4X0r9STViA6CoedCJw== X-Received: by 2002:a19:1081:: with SMTP id 1-v6mr4136954lfq.86.1521046760222; Wed, 14 Mar 2018 09:59:20 -0700 (PDT) Return-Path: Received: from uffe-XPS-13-9360.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id t24-v6sm724849lfi.30.2018.03.14.09.59.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Mar 2018 09:59:19 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , linux-pm@vger.kernel.org Cc: Kevin Hilman , Lina Iyer , Lina Iyer , Ulf Hansson , Rob Herring , Daniel Lezcano , Thomas Gleixner , Vincent Guittot , Stephen Boyd , Juri Lelli , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 10/25] dt: psci: Update DT bindings to support hierarchical PSCI states Date: Wed, 14 Mar 2018 17:58:20 +0100 Message-Id: <1521046715-30683-11-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521046715-30683-1-git-send-email-ulf.hansson@linaro.org> References: <1521046715-30683-1-git-send-email-ulf.hansson@linaro.org> From: Lina Iyer Update DT bindings to represent hierarchical CPU and CPU PM domain idle states for PSCI. Also update the PSCI examples to clearly show how flattened and hierarchical idle states can be represented in DT. Cc: Lina Iyer Signed-off-by: Lina Iyer Co-developed-by: Ulf Hansson Signed-off-by: Ulf Hansson Reviewed-by: Rob Herring Reviewed-by: Sudeep Holla --- Documentation/devicetree/bindings/arm/psci.txt | 156 +++++++++++++++++++++++++ 1 file changed, 156 insertions(+) -- 2.7.4 diff --git a/Documentation/devicetree/bindings/arm/psci.txt b/Documentation/devicetree/bindings/arm/psci.txt index a2c4f1d..17aa3d3 100644 --- a/Documentation/devicetree/bindings/arm/psci.txt +++ b/Documentation/devicetree/bindings/arm/psci.txt @@ -105,7 +105,163 @@ Case 3: PSCI v0.2 and PSCI v0.1. ... }; +ARM systems can have multiple cores sometimes in hierarchical arrangement. +This often, but not always, maps directly to the processor power topology of +the system. Individual nodes in a topology have their own specific power states +and can be better represented in DT hierarchically. + +For these cases, the definitions of the idle states for the CPUs and the CPU +topology, must conform to the domain idle state specification [3]. The domain +idle states themselves, must be compatible with the defined 'domain-idle-state' +binding [1], and also need to specify the arm,psci-suspend-param property for +each idle state. + +DT allows representing CPUs and CPU idle states in two different ways - + +The flattened model as given in Example 1, lists CPU's idle states followed by +the domain idle state that the CPUs may choose. Note that the idle states are +all compatible with "arm,idle-state". + +Example 2 represents the hierarchical model of CPUs and domain idle states. +CPUs define their domain provider in their psci DT node. The domain controls +the power to the CPU and possibly other h/w blocks that would enter an idle +state along with the CPU. The CPU's idle states may therefore be considered as +the domain's idle states and have the compatible "arm,idle-state". Such domains +may also be embedded within another domain that may represent common h/w blocks +between these CPUs. The idle states of the CPU topology shall be represented as +the domain's idle states. + +In PSCI firmware v1.0, the OS-Initiated mode is introduced. In order to use it, +the hierarchical representation must be used. + +Example 1: Flattened representation of CPU and domain idle states + cpus { + #address-cells = <1>; + #size-cells = <0>; + + CPU0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0x0>; + enable-method = "psci"; + cpu-idle-states = <&CPU_PWRDN>, <&CLUSTER_RET>, + <&CLUSTER_PWRDN>; + }; + + CPU1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a57", "arm,armv8"; + reg = <0x100>; + enable-method = "psci"; + cpu-idle-states = <&CPU_PWRDN>, <&CLUSTER_RET>, + <&CLUSTER_PWRDN>; + }; + + idle-states { + CPU_PWRDN: cpu-power-down { + compatible = "arm,idle-state"; + arm,psci-suspend-param = <0x000001>; + entry-latency-us = <10>; + exit-latency-us = <10>; + min-residency-us = <100>; + }; + + CLUSTER_RET: cluster-retention { + compatible = "arm,idle-state"; + arm,psci-suspend-param = <0x1000010>; + entry-latency-us = <500>; + exit-latency-us = <500>; + min-residency-us = <2000>; + }; + + CLUSTER_PWRDN: cluster-power-down { + compatible = "arm,idle-state"; + arm,psci-suspend-param = <0x1000030>; + entry-latency-us = <2000>; + exit-latency-us = <2000>; + min-residency-us = <6000>; + }; + }; + + psci { + compatible = "arm,psci-0.2"; + method = "smc"; + }; + +Example 2: Hierarchical representation of CPU and domain idle states + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + CPU0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0x0>; + enable-method = "psci"; + power-domains = <&CPU_PD0>; + }; + + CPU1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a57", "arm,armv8"; + reg = <0x100>; + enable-method = "psci"; + power-domains = <&CPU_PD1>; + }; + + idle-states { + CPU_PWRDN: cpu-power-down { + compatible = "arm,idle-state"; + arm,psci-suspend-param = <0x000001>; + entry-latency-us = <10>; + exit-latency-us = <10>; + min-residency-us = <100>; + }; + + CLUSTER_RET: cluster-retention { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x1000010>; + entry-latency-us = <500>; + exit-latency-us = <500>; + min-residency-us = <2000>; + }; + + CLUSTER_PWRDN: cluster-power-down { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x1000030>; + entry-latency-us = <2000>; + exit-latency-us = <2000>; + min-residency-us = <6000>; + }; + }; + }; + + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + + CPU_PD0: cpu-pd0 { + #power-domain-cells = <0>; + domain-idle-states = <&CPU_PWRDN>; + power-domains = <&CLUSTER_PD>; + }; + + CPU_PD1: cpu-pd1 { + #power-domain-cells = <0>; + domain-idle-states = <&CPU_PWRDN>; + power-domains = <&CLUSTER_PD>; + }; + + CLUSTER_PD: cluster-pd { + #power-domain-cells = <0>; + domain-idle-states = <&CLUSTER_RET>, <&CLUSTER_PWRDN>; + }; + }; + [1] Kernel documentation - ARM idle states bindings Documentation/devicetree/bindings/arm/idle-states.txt [2] Power State Coordination Interface (PSCI) specification http://infocenter.arm.com/help/topic/com.arm.doc.den0022c/DEN0022C_Power_State_Coordination_Interface.pdf +[3]. PM Domains description + Documentation/devicetree/bindings/power/power_domain.txt