Message ID | 20230531-rpm-rproc-v1-5-e0a3b6de1f14@gerhold.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2507544vqr; Mon, 5 Jun 2023 00:28:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Z/BCJFp+IH4+TnhLmciokii9a2U2dM5PHbNCbJClHd7ihXsoZFWhYYVEFAw4V8VhyeLji X-Received: by 2002:a05:6a20:7f9d:b0:10e:d134:d686 with SMTP id d29-20020a056a207f9d00b0010ed134d686mr7924595pzj.6.1685950115840; Mon, 05 Jun 2023 00:28:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685950115; cv=pass; d=google.com; s=arc-20160816; b=i+k6Fhh/Vdd8UdWgvEf1CYn2p8WZeWEcYR1afq1HjPKv7/ewAIJpTb9By3uGG4f0j3 ImS40OP5+f6Bro2yamPH+Ssm2EmUn/Mt24TVj9syEb47ldTt0HUlBw5CwXXBIQc+hudY KpqPg1xfI9p/vNQ51B7RL6Y9p3zbwG1vydg87Qeb6JT5ub/Uje8yyvXyQiZ5o5OEWmlg Mvsu7VjTlBIK/n4fdQ1ABI//Jttj7uqIyqmKyCLue1a0dFmfZFMrd5BomEdTcVug2cUo wYerFfDHKgEvJQsiB7Crp592beZjjNeAJP9XawANUy4DABJskvWrAaWMrxQe3Q3gjlKA Ar2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature:dkim-signature; bh=efJmgyRhH8s5qmo/MF16ZslMvCpOw40LUinz7JEKENI=; b=hIXtjHoSDGhm19s6XKleaqpv0Z0gI75CnV6jacb6k3qUhXKd07DszMAe+UGjV8NGLk FBEYsyAtTLKW4Z3ReZKi8jeBL0ECves96TBtGJV3QbrpESrq+hHBf2H3A7kRYgBrGwf6 /io5GWPZE9nO7PA4J4I9wT10+9TwSeqdIWXcWmicB5mpqfdkEazBUJrBH5eU4pfkgTdH /v0lDs1pPadGLnZ8Jx13NRPGB100M8CM6Xww+p5/3yVO4UjWOx9HCr+9e/qT8ArZDSqb +tzw1lPfdoaEgg1bJBuUTPu2QQdpn40CdalR6VznFVtNmps8caYgWCzA5wVXVivT6ovo 0Z1w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=qDk5En0b; dkim=neutral (no key) header.i=@gerhold.net header.s=strato-dkim-0003 header.b=qbh2q6h4; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a170902ea0300b001ab18eacb8csi4252785plg.526.2023.06.05.00.28.21; Mon, 05 Jun 2023 00:28:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=qDk5En0b; dkim=neutral (no key) header.i=@gerhold.net header.s=strato-dkim-0003 header.b=qbh2q6h4; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230515AbjFEHLl (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Mon, 5 Jun 2023 03:11:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbjFEHK1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 5 Jun 2023 03:10:27 -0400 Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FD7AE67; Mon, 5 Jun 2023 00:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685948954; cv=none; d=strato.com; s=strato-dkim-0002; b=FjMVR6gZ9b47dSMg9tIUo84I3OlzzCdNLkN+mVBodgGJCiuhtpYdkCLWls8SVfA8/N Qu2/G9vlua7mb/N8p/7HuUpWc2PccTd9HwNSaiMEcPhKpkqex9rluKuIx+iN2MIrt13J uYv870+bJJ5yL3itn+Ox1iUUgc8YgXGto2nkPtgCmuSb2mFH2IMTdSIHj/gDdUGb6CRK Rq/lKeUPjSRmWObaZdlZylKV7cfKRB8Ou6SypGfAj5v4LNSFqiY2bNVPW2hF0eHrqB95 A03J4Vnk15fNjOTzAFLL1J/P2S17QA/efrvA7RX3obEhrYdckYwjRaIKaa2sVpJceg/6 uV3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1685948954; s=strato-dkim-0002; d=strato.com; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=efJmgyRhH8s5qmo/MF16ZslMvCpOw40LUinz7JEKENI=; b=b3ocpnzbg6hmu7M5b7v3htD36KuE1LBKD7KT5+bPO5BvgCjz0Q/f3EF5qi4rLtDE5/ oJ94HTY3jHBYsvUgD56I1PhGwXpT6vIFI+98YtCQ1QJB7Y8YKbQdMNRxHaijLnr5oERz bTP1PcgcKDzek5MPy3sn0PXF3PutWAWMEnuF/dPjNkM+GcCSCk69DRQtwgFrUbPskBHX H2YsBOpiMR10MUYbfNjD+zk/bvhRKlnWh59hL45VLHhOV0/vBSBIxpTgyKTB30h7ey/H Pm9F0YxBj44OG5XzonVr1lCX4gjd69FJNIAtXxZhEpEdwpWFlZQAlItrQUiEpOYn5p2d /XLw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1685948954; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=efJmgyRhH8s5qmo/MF16ZslMvCpOw40LUinz7JEKENI=; b=qDk5En0bq1LKiZlfWsRuW79x5LCE85oq3qFZphBSwZ9N1zyxz9FMa8bhegmwftqYmQ iRxX8nTWySdB9Xl6OCi7jWsAfsQ3Kb/pBEijoerFBRnLOvBxpKpvZlJ6WWXyn1gq+DEm QDOkJa3aWDHaDMbBCnbzrJZk5tn+9iyH7QrmBWaSg2jB35nbTgdDCFUfatfjZiQROUOn oJPPYeOE0LoOaz6GwTtPguKXBi6y2MBy8/eiTOAKteksIj4RekqKvfyOHlaBxmIN4h8m HrWazsbCFu6/ZSLTBQT2Y/RFU0kOEvY+c/u8B6mUzNVpDpiC9MaPP0/DK3/T0c8MjRx3 aP+w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1685948954; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=efJmgyRhH8s5qmo/MF16ZslMvCpOw40LUinz7JEKENI=; b=qbh2q6h4lt7A7Gfmh8wBuwFebG1lurZPlYCoDtWZxW5E1z8WsBFqLHPFQZD2mH6lys +E464QDdS8hglku8KwCA== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn9VOL5nz0=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.5.3 DYNA|AUTH) with ESMTPSA id Z82ec2z5579D8a4 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 5 Jun 2023 09:09:13 +0200 (CEST) From: Stephan Gerhold <stephan@gerhold.net> Date: Mon, 05 Jun 2023 09:08:21 +0200 Subject: [PATCH 05/14] dt-bindings: remoteproc: Add Qualcomm RPM processor/subsystem MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230531-rpm-rproc-v1-5-e0a3b6de1f14@gerhold.net> References: <20230531-rpm-rproc-v1-0-e0a3b6de1f14@gerhold.net> In-Reply-To: <20230531-rpm-rproc-v1-0-e0a3b6de1f14@gerhold.net> To: Bjorn Andersson <andersson@kernel.org> Cc: Andy Gross <agross@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, Stephan Gerhold <stephan@gerhold.net> X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767846828589984745?= X-GMAIL-MSGID: =?utf-8?q?1767846828589984745?= |
Series |
Add dedicated device tree node for RPM processor/subsystem
|
|
Commit Message
Stephan Gerhold
June 5, 2023, 7:08 a.m. UTC
On Qualcomm platforms, most subsystems (e.g. audio/modem DSP) are
described as remote processors in the device tree, with a dedicated
node where properties and services related to them can be described.
The Resource Power Manager (RPM) is also such a subsystem, with a
remote processor that is running a special firmware. Unfortunately,
the RPM never got a dedicated node representing it properly in the
device tree. Most of the RPM services are described below a top-level
/smd or /rpm-glink node.
However, SMD/GLINK is just one of the communication channels to the RPM
firmware. For example, the MPM interrupt functionality provided by the
RPM does not use SMD/GLINK but writes directly to a special memory
region allocated by the RPM firmware in combination with a mailbox.
Currently there is no good place in the device tree to describe this
functionality. It doesn't belong below SMD/GLINK but it's not an
independent top-level device either.
Introduce a new "qcom,rpm-proc" compatible that allows describing the
RPM as a remote processor/subsystem like all others. The SMD/GLINK node
is moved to a "smd-edge"/"glink-edge" subnode consistent with other
existing bindings. Additional subnodes (e.g. interrupt-controller for
MPM, rpm-master-stats) can be also added there.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
.../bindings/remoteproc/qcom,rpm-proc.yaml | 125 +++++++++++++++++++++
1 file changed, 125 insertions(+)
Comments
On Mon, 05 Jun 2023 09:08:21 +0200, Stephan Gerhold wrote: > On Qualcomm platforms, most subsystems (e.g. audio/modem DSP) are > described as remote processors in the device tree, with a dedicated > node where properties and services related to them can be described. > > The Resource Power Manager (RPM) is also such a subsystem, with a > remote processor that is running a special firmware. Unfortunately, > the RPM never got a dedicated node representing it properly in the > device tree. Most of the RPM services are described below a top-level > /smd or /rpm-glink node. > > However, SMD/GLINK is just one of the communication channels to the RPM > firmware. For example, the MPM interrupt functionality provided by the > RPM does not use SMD/GLINK but writes directly to a special memory > region allocated by the RPM firmware in combination with a mailbox. > Currently there is no good place in the device tree to describe this > functionality. It doesn't belong below SMD/GLINK but it's not an > independent top-level device either. > > Introduce a new "qcom,rpm-proc" compatible that allows describing the > RPM as a remote processor/subsystem like all others. The SMD/GLINK node > is moved to a "smd-edge"/"glink-edge" subnode consistent with other > existing bindings. Additional subnodes (e.g. interrupt-controller for > MPM, rpm-master-stats) can be also added there. > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net> > --- > .../bindings/remoteproc/qcom,rpm-proc.yaml | 125 +++++++++++++++++++++ > 1 file changed, 125 insertions(+) > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: ./Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/soc/qcom/qcom,rpm-master-stats.yaml doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230531-rpm-rproc-v1-5-e0a3b6de1f14@gerhold.net The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On Mon, Jun 05, 2023 at 02:33:58AM -0600, Rob Herring wrote: > On Mon, 05 Jun 2023 09:08:21 +0200, Stephan Gerhold wrote: > > On Qualcomm platforms, most subsystems (e.g. audio/modem DSP) are > > described as remote processors in the device tree, with a dedicated > > node where properties and services related to them can be described. > > > > The Resource Power Manager (RPM) is also such a subsystem, with a > > remote processor that is running a special firmware. Unfortunately, > > the RPM never got a dedicated node representing it properly in the > > device tree. Most of the RPM services are described below a top-level > > /smd or /rpm-glink node. > > > > However, SMD/GLINK is just one of the communication channels to the RPM > > firmware. For example, the MPM interrupt functionality provided by the > > RPM does not use SMD/GLINK but writes directly to a special memory > > region allocated by the RPM firmware in combination with a mailbox. > > Currently there is no good place in the device tree to describe this > > functionality. It doesn't belong below SMD/GLINK but it's not an > > independent top-level device either. > > > > Introduce a new "qcom,rpm-proc" compatible that allows describing the > > RPM as a remote processor/subsystem like all others. The SMD/GLINK node > > is moved to a "smd-edge"/"glink-edge" subnode consistent with other > > existing bindings. Additional subnodes (e.g. interrupt-controller for > > MPM, rpm-master-stats) can be also added there. > > > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net> > > --- > > .../bindings/remoteproc/qcom,rpm-proc.yaml | 125 +++++++++++++++++++++ > > 1 file changed, 125 insertions(+) > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > yamllint warnings/errors: > > dtschema/dtc warnings/errors: > ./Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/soc/qcom/qcom,rpm-master-stats.yaml > I think we can ignore this error: The qcom,rpm-master-stats.yaml schema exists only in the qcom for-next branch at the moment, which is what this series targets. The base-commit in the cover letter also points there (although I guess it might be tricky to resolve it reliably for automated testing). Before sending this series I verified that there are no dt_binding_check and dtbs_check warnings or errors when applied to the correct branch. Thanks, Stephan
On 05/06/2023 09:08, Stephan Gerhold wrote: > On Qualcomm platforms, most subsystems (e.g. audio/modem DSP) are > described as remote processors in the device tree, with a dedicated > node where properties and services related to them can be described. > > The Resource Power Manager (RPM) is also such a subsystem, with a > remote processor that is running a special firmware. Unfortunately, > the RPM never got a dedicated node representing it properly in the > device tree. Most of the RPM services are described below a top-level > /smd or /rpm-glink node. Then what is rpm-requests? This is the true RPM. It looks like you now duplicate half of it in a node above. Unless you want here to describe ways to communicate with the RPM, not the RPM itself. > However, SMD/GLINK is just one of the communication channels to the RPM > firmware. For example, the MPM interrupt functionality provided by the > RPM does not use SMD/GLINK but writes directly to a special memory > region allocated by the RPM firmware in combination with a mailbox. > Currently there is no good place in the device tree to describe this > functionality. It doesn't belong below SMD/GLINK but it's not an > independent top-level device either. > > Introduce a new "qcom,rpm-proc" compatible that allows describing the > RPM as a remote processor/subsystem like all others. The SMD/GLINK node > is moved to a "smd-edge"/"glink-edge" subnode consistent with other > existing bindings. Additional subnodes (e.g. interrupt-controller for > MPM, rpm-master-stats) can be also added there. If this was about to stay, you should also update the qcom,smd.yaml, so there will be no duplication. > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net> > --- > .../bindings/remoteproc/qcom,rpm-proc.yaml | 125 +++++++++++++++++++++ > 1 file changed, 125 insertions(+) > > diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml > new file mode 100644 > index 000000000000..c06dd4f66503 > --- /dev/null > +++ b/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml > @@ -0,0 +1,125 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/remoteproc/qcom,rpm-proc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Qualcomm Resource Power Manager (RPM) Processor/Subsystem > + > +maintainers: > + - Bjorn Andersson <andersson@kernel.org> > + - Konrad Dybcio <konrad.dybcio@linaro.org> > + > +description: > + Resource Power Manager (RPM) subsystem found in various Qualcomm platforms. > + The RPM allows each component in the system to vote for state of the system > + resources, such as clocks, regulators and bus frequencies. rpm-proc is the > + top-level device tree node that groups all the RPM functionality together. > + > +properties: > + compatible: > + items: > + - enum: > + - qcom,apq8084-rpm-proc > + - qcom,ipq6018-rpm-proc > + - qcom,ipq9574-rpm-proc > + - qcom,mdm9607-rpm-proc > + - qcom,msm8226-rpm-proc > + - qcom,msm8610-rpm-proc > + - qcom,msm8909-rpm-proc > + - qcom,msm8916-rpm-proc > + - qcom,msm8917-rpm-proc > + - qcom,msm8936-rpm-proc > + - qcom,msm8937-rpm-proc > + - qcom,msm8952-rpm-proc > + - qcom,msm8953-rpm-proc > + - qcom,msm8974-rpm-proc > + - qcom,msm8976-rpm-proc > + - qcom,msm8994-rpm-proc > + - qcom,msm8996-rpm-proc > + - qcom,msm8998-rpm-proc > + - qcom,qcm2290-rpm-proc > + - qcom,qcs404-rpm-proc > + - qcom,sdm660-rpm-proc > + - qcom,sm6115-rpm-proc > + - qcom,sm6125-rpm-proc > + - qcom,sm6375-rpm-proc > + - const: qcom,rpm-proc > + > + smd-edge: > + $ref: /schemas/remoteproc/qcom,smd-edge.yaml# > + description: > + Qualcomm Shared Memory subnode which represents communication edge, > + channels and devices related to the RPM subsystem. > + > + glink-rpm: > + $ref: /schemas/remoteproc/qcom,glink-rpm-edge.yaml# > + description: > + Qualcomm G-Link subnode which represents communication edge, > + channels and devices related to the RPM subsystem. > + > + interrupt-controller: > + type: object > + $ref: /schemas/interrupt-controller/qcom,mpm.yaml# > + description: > + MSM Power Manager (MPM) interrupt controller that monitors interrupts > + when the system is asleep. Isn't this a service of RPM? > + > + master-stats: > + $ref: /schemas/soc/qcom/qcom,rpm-master-stats.yaml# > + description: > + Subsystem-level low-power mode statistics provided by RPM. The same question. > + > +required: > + - compatible > + > +oneOf: > + - required: > + - smd-edge > + - required: > + - glink-rpm > + > +additionalProperties: false > + > +examples: > + # SMD > + - | > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + #include <dt-bindings/interrupt-controller/irq.h> > + > + remoteproc-rpm { remoteproc > + compatible = "qcom,msm8916-rpm-proc", "qcom,rpm-proc"; > + > + smd-edge { > + interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>; > + qcom,ipc = <&apcs 8 0>; > + qcom,smd-edge = <15>; > + > + rpm-requests { > + compatible = "qcom,rpm-msm8916"; > + qcom,smd-channels = "rpm_requests"; > + /* ... */ > + }; > + }; > + }; > + # GLINK > + - | > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + #include <dt-bindings/interrupt-controller/irq.h> > + > + remoteproc-rpm { remoteproc > + compatible = "qcom,qcm2290-rpm-proc", "qcom,rpm-proc"; > + > + glink-rpm { > + compatible = "qcom,glink-rpm"; > + interrupts = <GIC_SPI 194 IRQ_TYPE_EDGE_RISING>; > + qcom,rpm-msg-ram = <&rpm_msg_ram>; > + mboxes = <&apcs_glb 0>; > + > + rpm-requests { > + compatible = "qcom,rpm-qcm2290"; > + qcom,glink-channels = "rpm_requests"; > + /* ... */ > + }; > + }; > + }; > Best regards, Krzysztof
<On Tue, Jun 06, 2023 at 08:36:10AM +0200, Krzysztof Kozlowski wrote: > On 05/06/2023 09:08, Stephan Gerhold wrote: > > On Qualcomm platforms, most subsystems (e.g. audio/modem DSP) are > > described as remote processors in the device tree, with a dedicated > > node where properties and services related to them can be described. > > > > The Resource Power Manager (RPM) is also such a subsystem, with a > > remote processor that is running a special firmware. Unfortunately, > > the RPM never got a dedicated node representing it properly in the > > device tree. Most of the RPM services are described below a top-level > > /smd or /rpm-glink node. > > Then what is rpm-requests? This is the true RPM. It looks like you now > duplicate half of it in a node above. Unless you want here to describe > ways to communicate with the RPM, not the RPM itself. > I think you're confusing hardware and firmware here. The rpm-proc node represents the RPM hardware block (or perhaps the RPM firmware overall), while rpm-requests is just *one* communication interface provided by the RPM firmware. Here is a rough picture of the RPM "subsystem" I'm trying to describe: +--------------------------------------------+ | RPM subsystem (qcom,rpm-proc) | | | reset | +---------------+ +-----+ +-----+ | --------->| | | MPM | | CPR | ... | IPC interrupts | | ARM Cortex-M3 | +-----+ +-----+ | ----------------->| |--- | | | | +---------------+ |---------------------- | | +---------------+ | | | | Code RAM |--| +------------------+ | | +---------------+ | | | | | +---------------+ | | Message RAM | | | | Data RAM |--|--| | | | +---------------+ | +------------------+ | +--------------------|-----------------------+ v NoC (Somewhat adapted from Figure 8-1 RPM overview in the APQ8016E Technical Reference Manual, but I added some extra stuff.) As you can see neither "SMD" nor "rpm-requests" exist in hardware. Again, it's just one communication protocol implemented by the RPM firmware running on the Cortex-M3 processor, much like a webserver running on a PC. When the SoC is started only the hardware block exists. Usually a component in the boot chain loads firmware into the code/data RAM and then de-asserts the reset line to start the Cortex-M3 processor. This is not guaranteed to happen. For example, I have a special firmware version where the firmware is only loaded but not brought out of reset. In this case Linux is responsible to de-assert the reset line. In follow-up patches I add that to the outer qcom,rpm-proc node: remoteproc { compatible = "qcom,msm8916-rpm-proc", "qcom,rpm-proc"; resets = <&gcc GCC_RPM_RESET>; iommus = <&apps_smmu 0x0040>; smd-edge { /* ... */ rpm-requests { qcom,smd-channels = "rpm_requests"; }; }; }; This reset line cannot be described on the rpm-requests node. Until the firmware is started there is no such thing as "SMD" or "rpm-requests". When the RPM firmware is started it sets up some data structures in the message RAM and then begins serving requests, perhaps like this: +----------------------------------+ | ARM Cortex-M3 | | +------------------------------+ | +--------------------------------+ | | RPM Firmware | | | Message RAM | IPC Interrupt | | +----------------------+ | | | +----------------------------+ | ------------------>| SMD Server | | | | | SMD Data Structures & FIFO | | | | | +--------------+ | | | | | +--------------+ | | | | | | rpm_requests | ... | | | | | | rpm_requests | ... | | | | | +--------------+ | ... | | | | +--------------+ | | | | +----------------------+ | | | +----------------------------+ | | +------------------------------+ | | ... | +----------------------------------+ +--------------------------------+ The "smd-edge" node represents the SMD part and "rpm_requests" is one of the communication channels that can be used to talk to the RPM firmware. Everything below rpm-requests: clocks, regulators, power domains are pure firmware constructions. They do not exist in the RPM hardware block, the firmware just acts as a proxy to collect votes from different clients and then configures the actual hardware. > > > However, SMD/GLINK is just one of the communication channels to the RPM > > firmware. For example, the MPM interrupt functionality provided by the > > RPM does not use SMD/GLINK but writes directly to a special memory > > region allocated by the RPM firmware in combination with a mailbox. > > Currently there is no good place in the device tree to describe this > > functionality. It doesn't belong below SMD/GLINK but it's not an > > independent top-level device either. > > > > Introduce a new "qcom,rpm-proc" compatible that allows describing the > > RPM as a remote processor/subsystem like all others. The SMD/GLINK node > > is moved to a "smd-edge"/"glink-edge" subnode consistent with other > > existing bindings. Additional subnodes (e.g. interrupt-controller for > > MPM, rpm-master-stats) can be also added there. > > If this was about to stay, you should also update the qcom,smd.yaml, so > there will be no duplication. > qcom,smd.yaml is deprecated in the next patch (PATCH 07/14). > > > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net> > > --- > > .../bindings/remoteproc/qcom,rpm-proc.yaml | 125 +++++++++++++++++++++ > > 1 file changed, 125 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml > > new file mode 100644 > > index 000000000000..c06dd4f66503 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml > > @@ -0,0 +1,125 @@ > > [...] > > + interrupt-controller: > > + type: object > > + $ref: /schemas/interrupt-controller/qcom,mpm.yaml# > > + description: > > + MSM Power Manager (MPM) interrupt controller that monitors interrupts > > + when the system is asleep. > > Isn't this a service of RPM? > > > + > > + master-stats: > > + $ref: /schemas/soc/qcom/qcom,rpm-master-stats.yaml# > > + description: > > + Subsystem-level low-power mode statistics provided by RPM. > > The same question. > Yes, they are services of the RPM firmware. But they have no relation to the SMD/GLINK channel. To clarify this I extend my picture from above with MPM: +----------------------------------+ | ARM Cortex-M3 | | +------------------------------+ | +--------------------------------+ | | RPM Firmware | | | Message RAM | IPC Interrupt 0 | | +----------------------+ | | | +----------------------------+ | ------------------->| SMD Server | | | | | SMD Data Structures & FIFO | | | | | +--------------+ | | | | | +--------------+ | | | | | | rpm_requests | ... | | | | | | rpm_requests | ... | | | | | +--------------+ | ... | | | | +--------------+ | | | | +----------------------+ | | | +----------------------------+ | IPC Interrupt 1 | | +----------------------+ | | | +----------------------------+ | ------------------->| MPM virtualization |<-----------| MPM register copy (vMPM) | | | | +----------------------+ | | | +----------------------------+ | | +-----------|------------------+ | | ... | +-------------v--------------------+ +--------------------------------+ +--------------+ | MPM Hardware | +--------------+ As you can see, SMD and MPM are siblings. The MPM functionality implemented by the RPM firmware is not a child of the SMD server. It's a bit like a webserver and emailserver running on the same PC. Two separate services accessible via different ports and protocols. Thanks, Stephan NOTE: All of this is just my interpretation based on the public hints that exist. I have no access to internal documentation or source code that would prove that all of this is correct.
On 06/06/2023 10:55, Stephan Gerhold wrote: > <On Tue, Jun 06, 2023 at 08:36:10AM +0200, Krzysztof Kozlowski wrote: >> On 05/06/2023 09:08, Stephan Gerhold wrote: >>> On Qualcomm platforms, most subsystems (e.g. audio/modem DSP) are >>> described as remote processors in the device tree, with a dedicated >>> node where properties and services related to them can be described. >>> >>> The Resource Power Manager (RPM) is also such a subsystem, with a >>> remote processor that is running a special firmware. Unfortunately, >>> the RPM never got a dedicated node representing it properly in the >>> device tree. Most of the RPM services are described below a top-level >>> /smd or /rpm-glink node. >> >> Then what is rpm-requests? This is the true RPM. It looks like you now >> duplicate half of it in a node above. Unless you want here to describe >> ways to communicate with the RPM, not the RPM itself. >> > > I think you're confusing hardware and firmware here. The rpm-proc node > represents the RPM hardware block (or perhaps the RPM firmware overall), > while rpm-requests is just *one* communication interface provided by the > RPM firmware. Here is a rough picture of the RPM "subsystem" I'm trying > to describe: > > +--------------------------------------------+ > | RPM subsystem (qcom,rpm-proc) | > | | > reset | +---------------+ +-----+ +-----+ | > --------->| | | MPM | | CPR | ... | > IPC interrupts | | ARM Cortex-M3 | +-----+ +-----+ | > ----------------->| |--- | | | > | +---------------+ |---------------------- | > | +---------------+ | | > | | Code RAM |--| +------------------+ | > | +---------------+ | | | | > | +---------------+ | | Message RAM | | > | | Data RAM |--|--| | | > | +---------------+ | +------------------+ | > +--------------------|-----------------------+ > v > NoC > > (Somewhat adapted from Figure 8-1 RPM overview in the APQ8016E Technical > Reference Manual, but I added some extra stuff.) > > As you can see neither "SMD" nor "rpm-requests" exist in hardware. > Again, it's just one communication protocol implemented by the RPM > firmware running on the Cortex-M3 processor, much like a webserver > running on a PC. > > When the SoC is started only the hardware block exists. Usually a > component in the boot chain loads firmware into the code/data RAM and > then de-asserts the reset line to start the Cortex-M3 processor. > > This is not guaranteed to happen. For example, I have a special firmware > version where the firmware is only loaded but not brought out of reset. > In this case Linux is responsible to de-assert the reset line. > In follow-up patches I add that to the outer qcom,rpm-proc node: > > remoteproc { > compatible = "qcom,msm8916-rpm-proc", "qcom,rpm-proc"; > resets = <&gcc GCC_RPM_RESET>; > iommus = <&apps_smmu 0x0040>; > > smd-edge { > /* ... */ > rpm-requests { > qcom,smd-channels = "rpm_requests"; > }; > }; > }; > > This reset line cannot be described on the rpm-requests node. Until the > firmware is started there is no such thing as "SMD" or "rpm-requests". OK, that makes sense, thank you for clarifying. It would be nice to include it in the binding description (especially that you already wrote it for me in the email :) ). > > When the RPM firmware is started it sets up some data structures in the > message RAM and then begins serving requests, perhaps like this: > > +----------------------------------+ > | ARM Cortex-M3 | > | +------------------------------+ | +--------------------------------+ > | | RPM Firmware | | | Message RAM | > IPC Interrupt | | +----------------------+ | | | +----------------------------+ | > ------------------>| SMD Server | | | | | SMD Data Structures & FIFO | | > | | | +--------------+ | | | | | +--------------+ | | > | | | | rpm_requests | ... | | | | | | rpm_requests | ... | | > | | | +--------------+ | ... | | | | +--------------+ | | > | | +----------------------+ | | | +----------------------------+ | > | +------------------------------+ | | ... | > +----------------------------------+ +--------------------------------+ > > The "smd-edge" node represents the SMD part and "rpm_requests" is one > of the communication channels that can be used to talk to the RPM firmware. > > Everything below rpm-requests: clocks, regulators, power domains are > pure firmware constructions. They do not exist in the RPM hardware block, > the firmware just acts as a proxy to collect votes from different > clients and then configures the actual hardware. OK > >> >>> However, SMD/GLINK is just one of the communication channels to the RPM >>> firmware. For example, the MPM interrupt functionality provided by the >>> RPM does not use SMD/GLINK but writes directly to a special memory >>> region allocated by the RPM firmware in combination with a mailbox. >>> Currently there is no good place in the device tree to describe this >>> functionality. It doesn't belong below SMD/GLINK but it's not an >>> independent top-level device either. >>> >>> Introduce a new "qcom,rpm-proc" compatible that allows describing the >>> RPM as a remote processor/subsystem like all others. The SMD/GLINK node >>> is moved to a "smd-edge"/"glink-edge" subnode consistent with other >>> existing bindings. Additional subnodes (e.g. interrupt-controller for >>> MPM, rpm-master-stats) can be also added there. >> >> If this was about to stay, you should also update the qcom,smd.yaml, so >> there will be no duplication. >> > > qcom,smd.yaml is deprecated in the next patch (PATCH 07/14). Please squash it, because it is logically one change - you rework one solution and deprecate other. > >>> >>> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> >>> --- >>> .../bindings/remoteproc/qcom,rpm-proc.yaml | 125 +++++++++++++++++++++ >>> 1 file changed, 125 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml >>> new file mode 100644 >>> index 000000000000..c06dd4f66503 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml >>> @@ -0,0 +1,125 @@ >>> [...] >>> + interrupt-controller: >>> + type: object >>> + $ref: /schemas/interrupt-controller/qcom,mpm.yaml# >>> + description: >>> + MSM Power Manager (MPM) interrupt controller that monitors interrupts >>> + when the system is asleep. >> >> Isn't this a service of RPM? >> >>> + >>> + master-stats: >>> + $ref: /schemas/soc/qcom/qcom,rpm-master-stats.yaml# >>> + description: >>> + Subsystem-level low-power mode statistics provided by RPM. >> >> The same question. >> > > Yes, they are services of the RPM firmware. But they have no relation to > the SMD/GLINK channel. > > To clarify this I extend my picture from above with MPM: > > +----------------------------------+ > | ARM Cortex-M3 | > | +------------------------------+ | +--------------------------------+ > | | RPM Firmware | | | Message RAM | > IPC Interrupt 0 | | +----------------------+ | | | +----------------------------+ | > ------------------->| SMD Server | | | | | SMD Data Structures & FIFO | | > | | | +--------------+ | | | | | +--------------+ | | > | | | | rpm_requests | ... | | | | | | rpm_requests | ... | | > | | | +--------------+ | ... | | | | +--------------+ | | > | | +----------------------+ | | | +----------------------------+ | > IPC Interrupt 1 | | +----------------------+ | | | +----------------------------+ | > ------------------->| MPM virtualization |<-----------| MPM register copy (vMPM) | | > | | +----------------------+ | | | +----------------------------+ | > | +-----------|------------------+ | | ... | > +-------------v--------------------+ +--------------------------------+ > +--------------+ > | MPM Hardware | > +--------------+ > > As you can see, SMD and MPM are siblings. The MPM functionality > implemented by the RPM firmware is not a child of the SMD server. OK, also please include it in the description. > > It's a bit like a webserver and emailserver running on the same PC. > Two separate services accessible via different ports and protocols. > > Thanks, > Stephan > > NOTE: All of this is just my interpretation based on the public hints > that exist. I have no access to internal documentation or source code > that would prove that all of this is correct. Sounds good enough for me :). Thank you. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml new file mode 100644 index 000000000000..c06dd4f66503 --- /dev/null +++ b/Documentation/devicetree/bindings/remoteproc/qcom,rpm-proc.yaml @@ -0,0 +1,125 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/remoteproc/qcom,rpm-proc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Resource Power Manager (RPM) Processor/Subsystem + +maintainers: + - Bjorn Andersson <andersson@kernel.org> + - Konrad Dybcio <konrad.dybcio@linaro.org> + +description: + Resource Power Manager (RPM) subsystem found in various Qualcomm platforms. + The RPM allows each component in the system to vote for state of the system + resources, such as clocks, regulators and bus frequencies. rpm-proc is the + top-level device tree node that groups all the RPM functionality together. + +properties: + compatible: + items: + - enum: + - qcom,apq8084-rpm-proc + - qcom,ipq6018-rpm-proc + - qcom,ipq9574-rpm-proc + - qcom,mdm9607-rpm-proc + - qcom,msm8226-rpm-proc + - qcom,msm8610-rpm-proc + - qcom,msm8909-rpm-proc + - qcom,msm8916-rpm-proc + - qcom,msm8917-rpm-proc + - qcom,msm8936-rpm-proc + - qcom,msm8937-rpm-proc + - qcom,msm8952-rpm-proc + - qcom,msm8953-rpm-proc + - qcom,msm8974-rpm-proc + - qcom,msm8976-rpm-proc + - qcom,msm8994-rpm-proc + - qcom,msm8996-rpm-proc + - qcom,msm8998-rpm-proc + - qcom,qcm2290-rpm-proc + - qcom,qcs404-rpm-proc + - qcom,sdm660-rpm-proc + - qcom,sm6115-rpm-proc + - qcom,sm6125-rpm-proc + - qcom,sm6375-rpm-proc + - const: qcom,rpm-proc + + smd-edge: + $ref: /schemas/remoteproc/qcom,smd-edge.yaml# + description: + Qualcomm Shared Memory subnode which represents communication edge, + channels and devices related to the RPM subsystem. + + glink-rpm: + $ref: /schemas/remoteproc/qcom,glink-rpm-edge.yaml# + description: + Qualcomm G-Link subnode which represents communication edge, + channels and devices related to the RPM subsystem. + + interrupt-controller: + type: object + $ref: /schemas/interrupt-controller/qcom,mpm.yaml# + description: + MSM Power Manager (MPM) interrupt controller that monitors interrupts + when the system is asleep. + + master-stats: + $ref: /schemas/soc/qcom/qcom,rpm-master-stats.yaml# + description: + Subsystem-level low-power mode statistics provided by RPM. + +required: + - compatible + +oneOf: + - required: + - smd-edge + - required: + - glink-rpm + +additionalProperties: false + +examples: + # SMD + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + + remoteproc-rpm { + compatible = "qcom,msm8916-rpm-proc", "qcom,rpm-proc"; + + smd-edge { + interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>; + qcom,ipc = <&apcs 8 0>; + qcom,smd-edge = <15>; + + rpm-requests { + compatible = "qcom,rpm-msm8916"; + qcom,smd-channels = "rpm_requests"; + /* ... */ + }; + }; + }; + # GLINK + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + + remoteproc-rpm { + compatible = "qcom,qcm2290-rpm-proc", "qcom,rpm-proc"; + + glink-rpm { + compatible = "qcom,glink-rpm"; + interrupts = <GIC_SPI 194 IRQ_TYPE_EDGE_RISING>; + qcom,rpm-msg-ram = <&rpm_msg_ram>; + mboxes = <&apcs_glb 0>; + + rpm-requests { + compatible = "qcom,rpm-qcm2290"; + qcom,glink-channels = "rpm_requests"; + /* ... */ + }; + }; + };