Received: by 2002:a05:6520:1682:b0:147:d1a0:b502 with SMTP id ck2csp5614969lkb; Mon, 11 Oct 2021 10:01:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRreWE11AWAG1/Fw9EyMugs7f9ycX9YBZetjbTBDpQO6hl7R4IakQ5/1nWptFgGGAwZYI5 X-Received: by 2002:a50:e00b:: with SMTP id e11mr43106444edl.359.1633971661368; Mon, 11 Oct 2021 10:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633971661; cv=none; d=google.com; s=arc-20160816; b=cFq1aRqPjufg868VjiQqOgA/M7UWchns5XLpfSK8ShYt31wjcL0Ab1c4K8lpWBZ5Qh CHV/Fker+LlptVdSkHbEOCwHFt+PoRAm70DtvLlLEbdwCAdtwaYokqXgaaCoKKccsNvg +r4JonFf89tedJVZcKvHB+jxaA3gLYsjLdDMRmn6oXfoBtdAgFM6ncnM7tSHtidVqg05 M8skYfsXhP3jl0PD4bIt7EyIrpDWW7BTfNhm3PfW/JKkJ/Nw45O4+fUGifTMoaCyKGJ/ wS+nq+YiOIluVniUN7Kn7VLgcm8Qt5YgvrpG283RGgIRhSbApSZRqCiKtk80k01UgjRf uxSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=metlxmBb8Ei98nOUJDEhNDJTy1yzIm5T92cttbGxAJQ=; b=H8ug/2PSUO7x1TpLsPE+yxpvbtelUT2SsvQ4GbMw6J21Z6KvPKCYr0X07tXPCwrwyp dej+DDeux/up1TbFi9VTkj+u5aozTNDpdvkr4SG+y0PZCKVjP3OhhZMI00h8WSZ9NUup 76mWM1ADm+GMMzg+jfOYlLCfspF/n4yd8eYJ5hOZmMz9Wt5leR7xlTSfBPBrg+Fq6HKz 6kR5YU4Yg6PxfKbjphNkSKzJEXZ+QaHDx3x8FTVFduxU7xLvF1kxNBx8hQHyIdjxBIi+ EAneJqK7AytKAxDcF4xLLiz8xxro0zgSNPTz7/5msQzGNPzXnNJ0Epg16yQ+ax11RQHm OGBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si12603557edm.184.2021.10.11.10.00.36; Mon, 11 Oct 2021 10:01:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232880AbhJKQ7w (ORCPT + 99 others); Mon, 11 Oct 2021 12:59:52 -0400 Received: from marcansoft.com ([212.63.210.85]:56578 "EHLO mail.marcansoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232884AbhJKQ7t (ORCPT ); Mon, 11 Oct 2021 12:59:49 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hector@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id F3A2042462; Mon, 11 Oct 2021 16:57:40 +0000 (UTC) From: Hector Martin To: linux-arm-kernel@lists.infradead.org Cc: Hector Martin , Alyssa Rosenzweig , Sven Peter , Marc Zyngier , Mark Kettenis , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Viresh Kumar , Nishanth Menon , Catalin Marinas , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 3/9] dt-bindings: clock: Add apple,cluster-clk binding Date: Tue, 12 Oct 2021 01:57:01 +0900 Message-Id: <20211011165707.138157-4-marcan@marcan.st> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011165707.138157-1-marcan@marcan.st> References: <20211011165707.138157-1-marcan@marcan.st> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This device represents the CPU performance state switching mechanism as a clock controller, to be used with the standard cpufreq-dt infrastructure. Signed-off-by: Hector Martin --- .../bindings/clock/apple,cluster-clk.yaml | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/apple,cluster-clk.yaml diff --git a/Documentation/devicetree/bindings/clock/apple,cluster-clk.yaml b/Documentation/devicetree/bindings/clock/apple,cluster-clk.yaml new file mode 100644 index 000000000000..9a8b863dadc0 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/apple,cluster-clk.yaml @@ -0,0 +1,115 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/apple,cluster-clk.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: CPU cluster frequency scaling for Apple SoCs + +maintainers: + - Hector Martin + +description: | + Apple SoCs control CPU cluster frequencies by using a performance state + index. This node represents the feature as a clock controller, and uses + a reference to the CPU OPP table to translate clock frequencies into + performance states. This allows the CPUs to use the standard cpufreq-dt + mechanism for frequency scaling. + +properties: + compatible: + items: + - enum: + - apple,t8103-cluster-clk + - const: apple,cluster-clk + + reg: + maxItems: 1 + + '#clock-cells': + const: 0 + + operating-points-v2: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + A reference to the OPP table used for the CPU cluster controlled by this + device instance. The table should contain an `opp-level` property for + every OPP, which represents the p-state index used by the hardware to + represent this performance level. + + OPPs may also have a `required-opps` property (see power-domains). + + power-domains: + maxItems: 1 + description: + An optional reference to a power domain provider that links its + performance state to the CPU cluster performance state. This is typically + a memory controller. If set, the `required-opps` property in the CPU + frequency OPP nodes will be used to change the performance state of this + provider state in tandem with CPU frequency changes. + +required: + - compatible + - reg + - '#clock-cells' + - operating-points-v2 + +additionalProperties: false + + +examples: + - | + pcluster_opp: opp-table-1 { + compatible = "operating-points-v2"; + opp-shared; + + opp01 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <781000>; + opp-level = <1>; + clock-latency-ns = <8000>; + required-opps = <&mcc_lowperf>; + }; + /* intermediate p-states omitted */ + opp15 { + opp-hz = /bits/ 64 <3204000000>; + opp-microvolt = <1081000>; + opp-level = <15>; + clock-latency-ns = <56000>; + required-opps = <&mcc_highperf>; + }; + }; + + mcc_opp: opp-table-2 { + compatible = "operating-points-v2"; + + mcc_lowperf: opp0 { + opp-level = <0>; + apple,memory-perf-config = <0x813057f 0x1800180>; + }; + mcc_highperf: opp1 { + opp-level = <1>; + apple,memory-perf-config = <0x133 0x55555340>; + }; + }; + + soc { + #address-cells = <2>; + #size-cells = <2>; + + mcc: memory-controller@200200000 { + compatible = "apple,t8103-mcc", "apple,mcc"; + #power-domain-cells = <0>; + reg = <0x2 0x200000 0x0 0x200000>; + operating-points-v2 = <&mcc_opp>; + apple,num-channels = <8>; + }; + + clk_pcluster: clock-controller@211e20000 { + compatible = "apple,t8103-cluster-clk", "apple,cluster-clk"; + #clock-cells = <0>; + reg = <0x2 0x11e20000 0x0 0x4000>; + operating-points-v2 = <&pcluster_opp>; + power-domains = <&mcc>; + }; + }; -- 2.33.0