Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Lee Jones <lee@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Rob Herring <robh@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Konrad Dybcio <konrad.dybcio@linaro.org>
Subject: [PATCH RFC 01/15] dt-bindings: mfd: Split out Qcom RPM MSG RAM
Date: Sat, 11 Mar 2023 02:21:31 +0100	[thread overview]
Message-ID: <20230311-topic-msg_ram-v1-1-e9c2094daf09@linaro.org> (raw)
In-Reply-To: <20230311-topic-msg_ram-v1-0-e9c2094daf09@linaro.org>

The RPM Message RAM is a part of the RPM low-power core's RAM that's a
MMIO-mapped region from the main ARM CPUs' POV. It contains sleep stats
divided per "RPM master" (ARM cluster, *DSP, ...), an interrupt controller
(MPM) that's vital in the low-power mode entry/exit sequence, as it
signals the readiness to enter sleep, replays the interrupts after a total
power collapse recovery and is able to receive external interrupts from
other IPs (like the PMIC, TSENS and USB) on the SoC to initiate a wakeup
sequence.

On top of that, it contains some regions that are (ab)used by SMEM (by
design!), but we're not completely sure what ranges are r/w to/from.
This would probably need to be determined on a SoC-by-SoC - or even worse
- firmware-by-firmware basis, but since this region is quite "wild west"
by design (it may be accessed and altered in one form or another by all of
the subsystems at the same time) this shouldn't really worry us..

Split out the bindings and re-model it as a simple-mfd to allow for better
representation of the partitions within and allow child devices (MPM,
master sleep stats - coming soon).

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 .../devicetree/bindings/mfd/qcom,rpm-msg-ram.yaml  | 82 ++++++++++++++++++++++
 Documentation/devicetree/bindings/sram/sram.yaml   |  2 -
 2 files changed, 82 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/qcom,rpm-msg-ram.yaml b/Documentation/devicetree/bindings/mfd/qcom,rpm-msg-ram.yaml
new file mode 100644
index 000000000000..b1fee2b2d923
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/qcom,rpm-msg-ram.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/qcom,rpm-msg-ram.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm RPM Message RAM
+
+maintainers:
+  - Konrad Dybcio <konrad.dybcio@linaro.org>
+
+description:
+  Part of the remote Resource Power Manager (RPM) core's RAM is exposed to
+  the main ARM cores as a MMIO-mapped device and referred to as the RPM
+  Message RAM. It contains per-RPM-master sleep statistics, an interrupt
+  controller (MPM) that's capable of replaying interrupts after a total power
+  collapse of a given master and some memory for mailbox-like functionality.
+  An RPM master is any remote core on the SoC, including APSS (the main ARM
+  clusters), ADSP etc., depending on the platform capabilities.
+
+properties:
+  compatible:
+    items:
+      - const: qcom,rpm-msg-ram
+      - const: simple-mfd
+
+  reg:
+    maxItems: 1
+
+  # The RPM message RAM should be <=0x7000-long so 1 cell is all it needs.
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 1
+
+  ranges: true
+
+required:
+  - compatible
+  - reg
+
+patternProperties:
+  # The MPM comes at fixed offsets: 0x1b8 on MSM8996 and later, 0x1d0 before it
+  "^interrupt-controller@(1d0|1b8)":
+    type: object
+    oneOf:
+      - $ref: /schemas/interrupt-controller/qcom,mpm.yaml#
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/mailbox/qcom-ipcc.h>
+
+    sram@45f0000 {
+        compatible = "qcom,rpm-msg-ram", "simple-mfd";
+        reg = <0x045f0000 0x7000>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0 0x045f0000 0x7000>;
+
+        wakegic: interrupt-controller@1b8 {
+            compatible = "qcom,mpm";
+            reg = <0x1b8 0x48>;
+            interrupts = <GIC_SPI 197 IRQ_TYPE_EDGE_RISING>;
+            mboxes = <&ipcc IPCC_CLIENT_AOP IPCC_MPROC_SIGNAL_SMP2P>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+            #power-domain-cells = <0>;
+            interrupt-parent = <&intc>;
+            qcom,mpm-pin-count = <96>;
+            qcom,mpm-pin-map = <5 296>,  /* Soundwire wake_irq */
+                               <12 422>, /* DWC3 ss_phy_irq */
+                               <86 183>, /* MPM wake, SPMI */
+                               <89 314>, /* TSENS0 0C */
+                               <90 315>, /* TSENS1 0C */
+                               <93 164>, /* DWC3 dm_hs_phy_irq */
+                               <94 165>; /* DWC3 dp_hs_phy_irq */
+        };
+    };
diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml
index 993430be355b..2e9e57b2602f 100644
--- a/Documentation/devicetree/bindings/sram/sram.yaml
+++ b/Documentation/devicetree/bindings/sram/sram.yaml
@@ -34,7 +34,6 @@ properties:
         - nvidia,tegra186-sysram
         - nvidia,tegra194-sysram
         - nvidia,tegra234-sysram
-        - qcom,rpm-msg-ram
         - rockchip,rk3288-pmu-sram
 
   reg:
@@ -141,7 +140,6 @@ if:
       compatible:
         contains:
           enum:
-            - qcom,rpm-msg-ram
             - rockchip,rk3288-pmu-sram
 then:
   required:

-- 
2.39.2


  reply	other threads:[~2023-03-11  1:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-11  1:21 [PATCH RFC 00/15] Convert Qualcomm RPM message RAM to a simple-mfd Konrad Dybcio
2023-03-11  1:21 ` Konrad Dybcio [this message]
2023-03-11  3:01   ` [PATCH RFC 01/15] dt-bindings: mfd: Split out Qcom RPM MSG RAM Rob Herring
2023-03-11  1:21 ` [PATCH RFC 02/15] arm64: dts: qcom: msm8916: Add simple-mfd to rpm_msg_ram Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 03/15] arm64: dts: qcom: msm8953: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 04/15] arm64: dts: qcom: msm8976: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 05/15] arm64: dts: qcom: msm8994: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 06/15] arm64: dts: qcom: msm8996: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 07/15] arm64: dts: qcom: msm8998: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 08/15] arm64: dts: qcom: qcs404: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 09/15] arm64: dts: qcom: sdm630: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 10/15] arm64: dts: qcom: sm6115: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 11/15] arm64: dts: qcom: sm6125: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 12/15] arm64: dts: qcom: sm6375: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 13/15] ARM: dts: qcom-apq8084: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 14/15] ARM: dts: qcom-msm8226: " Konrad Dybcio
2023-03-11  1:21 ` [PATCH RFC 15/15] ARM: dts: qcom-msm8974: " Konrad Dybcio
2023-03-11 11:24 ` [PATCH RFC 00/15] Convert Qualcomm RPM message RAM to a simple-mfd Dmitry Baryshkov
2023-03-11 12:40   ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230311-topic-msg_ram-v1-1-e9c2094daf09@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox