Received: by 10.192.165.156 with SMTP id m28csp1830614imm; Thu, 12 Apr 2018 04:22:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/vD5APII2vcF/8MJJBQeGFWlCjTn07/WuJeTOx5uz6LUP1Xa3wMGlgdmKpS+50sxQRRjmh X-Received: by 2002:a17:902:8a93:: with SMTP id p19-v6mr604145plo.256.1523532177738; Thu, 12 Apr 2018 04:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523532177; cv=none; d=google.com; s=arc-20160816; b=Ruj5zX56OFmpOHnNXBha2bnS774/MnZ2R26gR91xdFBGq3cMxo6ZFxJf0eOlknzu5V LUUeie7Q6Pfz0/j4BSHP4eMl1agNTECPCv8eqk1aej93WXNHiNKADTjRo7EyFKJjzrWs Hr2BAQtxcsiAItcB8dJKMZM7rYX8fpOHOxClkGi9de7wZLAoYpwv95Ln3WAJsFKH7ImJ /bEMhpIBy+Fe2nc2VaCaiZYU6YE8lnG79EghZLUZNFumIrACh073Jr9IwmLsaof8xU9t sVoCDVhO2T/+K2iG+n2oJD1c7nd4DT6mlETwaX8agzft3/GGi1aJA56s3ILrAtVCP9gd /YXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=9Rk0XsmJ8ZMwWIgsjyCup4TjKqspAVxuol9gCIzu2NQ=; b=VKGBcb7i6eFCFkxjVpcDlwvFEWBPovxntdJlbRd6UpDk6caCC3KjMeG/ZcU7UHuLSi 7VpOHG3tKKwfn0pmpTDtfpI4hid0xcFiCv3zWJW8j9g9e+w8bRSeOua7cdH1UAzau3ny xD3ePLsfM5q33Lpr1FrvWSSu9OT36gtdWOi3RBf2Xv9K+uWkizGqI1LFsPe8NmgAMfHO wlOiAASGUL970ztyHj8guyAXF/zrc5QT75nEfrQ1s4FCRg012ZDIVOeSd17EQg+Dpv9H HdwDeGS/oUdHU0kM0i8DaKVCeTU25AaI6g6hPD5jdZ96xZ8JCW/e1WwqcT4+f5/85MHV 1s1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JRbxE9yF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1-v6si3036053plt.265.2018.04.12.04.22.21; Thu, 12 Apr 2018 04:22:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JRbxE9yF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753161AbeDLLPE (ORCPT + 99 others); Thu, 12 Apr 2018 07:15:04 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:40536 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753114AbeDLLO5 (ORCPT ); Thu, 12 Apr 2018 07:14:57 -0400 Received: by mail-lf0-f67.google.com with SMTP id e5-v6so7125749lfb.7 for ; Thu, 12 Apr 2018 04:14:56 -0700 (PDT) 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=JRbxE9yFGrussWZVzas77uzKIy3uK/7X73UhBafaLhxHxj5+sg9V2Ln0d1aHyajUcQ 41CtxwQ5InTewVjIZNhKBXOZt704N8kHK55icz9jYBcSuxOYptW9EbKzbc7VFPxR38RY 1wkfjTcTiqJv1dSSvY5oF71NOMF+1Y5hHrLds= 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=rzzJo0Swxof4a3Wmi0ObbjvszuQ3ei5cWQ/VUF4en0Wi9GHCdDYlSMzmeSL4Me8127 MhVhHdsSDIoi99SkM6OAixNUOnE1QqpSEk4NePx9k43kd3BF64LWocYhq6oNaGGjYvSw OTBCk8B138x5QjZY4raEGvXmulCnrew7aGZCAu1WiK5bGluq/B5IilvM+IYmKX81DdXH +pG75QIRK8YFiGdqftjYXHYzLwAO5TJ3OsaqpiReZUtnn0ZbRRdeWx9RdMfOyHmCJ1XG Em5Iw9angAhe8YbXWoujK+AZHPBD4UxZen5Y6qrnPoVjwQ3emXvDKdy0607ebthtYdCv E+MQ== X-Gm-Message-State: ALQs6tCvCJItM/JeTGjMTrCor4j4LX2VBksoKmruxrCZggT0T8W7/lL7 Ov4r1kQ5iWgD6Wly2xamQrw39w== X-Received: by 2002:a19:e917:: with SMTP id g23-v6mr5081151lfh.71.1523531696075; Thu, 12 Apr 2018 04:14:56 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id r29sm543187lje.72.2018.04.12.04.14.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Apr 2018 04:14:55 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , 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 v7 10/26] dt: psci: Update DT bindings to support hierarchical PSCI states Date: Thu, 12 Apr 2018 13:14:15 +0200 Message-Id: <1523531671-27491-11-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523531671-27491-1-git-send-email-ulf.hansson@linaro.org> References: <1523531671-27491-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(+) 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 -- 2.7.4