Received: by 2002:a05:6520:1682:b0:147:d1a0:b502 with SMTP id ck2csp5614092lkb; Mon, 11 Oct 2021 10:00:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXAfNK+oalkNen8fjsaOLEre/4HWbnUGpoIKq1udL8ihAvh6xzr1Nr4hFdBFdlB131b2bq X-Received: by 2002:a05:6402:141:: with SMTP id s1mr41912633edu.317.1633971608809; Mon, 11 Oct 2021 10:00:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633971608; cv=none; d=google.com; s=arc-20160816; b=UmTDjeUgtzHvPQPbd4juUEGCvJXwVlrxVumc2KipbD7xJLJmgTAWNElvaMWOwoYKwr jnLajpL05slitMKIgIoWwDg51dVYxtrc934vZgZeU8II3IotHi/YOFBlV1Ho2XBDunKV ddsW2XZxgv8NGFtdU1vB2NP7oDqITd+HR0qJKa9P1+IjtrhgnB5mpQ4Z2CR66tZsF0kR JZyKSdmi9vkM3EEV9UDEYOIU8byFTvavy//lO71mdc4i1TJnCYm38Nj2lgpwDvBOogs4 pMcGo1UuxO8GlNrDwelGmENPxHwePHYs2fNLkuJ2pDpQLayoX9rLSk4LBMYIFBj+EkR9 p1SQ== 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=6rtGXeE2jBf1sIsVlV7dm0tWN+uxLuZZAWGwQn+UpWI=; b=QRxoPoL9naPHPfcFoQLjbkcC1Dh2iSC+TGFXDb5RqkehCDY1SiOSyH3Jqmc+kwGeW8 CIUi6UX6Yt4+WG0PzjN1Zr1Gt8pp1nl0TDgKfW4omkVJdzqOQPIVDkf7wFxGHvDazyuV bQ18OUxKBC9jZyVvSN9aZIOEgX6lhitkIQRiNLJzvwgfyMgizk7MugIgyH2Ze39pAuem lJcMPrjAASmaAu8qb/diJZjBqvlV75+PrWYDs7v+HzXlFcilnJ+MV1asUn59r8xQP6uH H/5mATCHWHh53NsMIbb8iHMVmK6a7pe/XvNE+5bDXTT+O3AXA82CgzjJ5qeHEKawjJET wGhw== 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 eb8si1647249edb.325.2021.10.11.09.59.45; Mon, 11 Oct 2021 10:00:08 -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 S232864AbhJKQ7n (ORCPT + 98 others); Mon, 11 Oct 2021 12:59:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232802AbhJKQ7m (ORCPT ); Mon, 11 Oct 2021 12:59:42 -0400 Received: from mail.marcansoft.com (marcansoft.com [IPv6:2a01:298:fe:f::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6E8EC061570; Mon, 11 Oct 2021 09:57:41 -0700 (PDT) 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 510E642446; Mon, 11 Oct 2021 16:57:35 +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 2/9] dt-bindings: memory-controller: Add apple,mcc binding Date: Tue, 12 Oct 2021 01:57:00 +0900 Message-Id: <20211011165707.138157-3-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 memory controller in Apple SoCs, and is chiefly in charge of adjusting performance characteristics according to system demand. Signed-off-by: Hector Martin --- .../memory-controllers/apple,mcc.yaml | 80 +++++++++++++++++++ .../opp/apple,mcc-operating-points.yaml | 62 ++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 Documentation/devicetree/bindings/memory-controllers/apple,mcc.yaml create mode 100644 Documentation/devicetree/bindings/opp/apple,mcc-operating-points.yaml diff --git a/Documentation/devicetree/bindings/memory-controllers/apple,mcc.yaml b/Documentation/devicetree/bindings/memory-controllers/apple,mcc.yaml new file mode 100644 index 000000000000..0774f10e65ed --- /dev/null +++ b/Documentation/devicetree/bindings/memory-controllers/apple,mcc.yaml @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/memory-controllers/apple,mcc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple SoC MCC memory controller performance controls + +maintainers: + - Hector Martin + +description: | + Apple SoCs contain a multichannel memory controller that can have its + configuration changed to adjust to changing performance requirements from + the rest of the SoC. This node represents the controller and provides a + power domain provider that downstream devices can use to adjust the memory + controller performance level. + +properties: + compatible: + items: + - enum: + - apple,t8103-mcc + - const: apple,mcc + + reg: + maxItems: 1 + + "#power-domain-cells": + const: 0 + + operating-points-v2: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + A reference to the OPP table describing the memory controller performance + levels. Each OPP node should contain an `apple,memory-perf-config` + property that contains the configuration values for that performance + level. + + apple,num-channels: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + The number of memory channels in use. + +required: + - compatible + - reg + - "#power-domain-cells" + - operating-points-v2 + - apple,num-channels + +additionalProperties: false + +examples: + # See clock/apple,cluster-clock.yaml for an example of downstream usage. + - | + 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>; + }; + }; diff --git a/Documentation/devicetree/bindings/opp/apple,mcc-operating-points.yaml b/Documentation/devicetree/bindings/opp/apple,mcc-operating-points.yaml new file mode 100644 index 000000000000..babf27841bb7 --- /dev/null +++ b/Documentation/devicetree/bindings/opp/apple,mcc-operating-points.yaml @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/opp/apple,mcc-operating-points.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple SoC memory controller OPP bindings + +maintainers: + - Hector Martin + +description: | + Apple SoCs can have their memory controller performance adjusted depending on + system requirements. These performance states are represented by specific + memory controller register values. The apple-mcc driver uses these values + to change the MCC performance. + +allOf: + - $ref: opp-v2-base.yaml# + +properties: + compatible: + const: apple,mcc-operating-points + +required: + - compatible + +patternProperties: + "opp[0-9]+": + type: object + + properties: + opp-level: true + apple,memory-perf-config: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: | + A pair of register values used to configure this performance state. + minItems: 2 + maxItems: 2 + + required: + - opp-level + - apple,memory-perf-config + + unevaluatedProperties: false + +additionalProperties: false + +examples: + - | + 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>; + }; + }; -- 2.33.0