Skip to contentSkip to conversation

interconnect: qcom: Add the Molokai interconnect providers

PATCH New Venkat Yadlapati 1 participant 3 messages Nov 27

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover interconnect: qcom: Add the Molokai interconnect providers

Molokai (SM8845) is derived from Kaanapali, but its NoCs are not the
same: the aggregate NoC is split into aggre1 and aggre2, the MMSS NoC config and service ports are split into HF and SF halves, many QoS ports moved, and QUP4, SDCC4, SP, QPACE and a few config slaves are gone. This series adds the binding and a Molokai driver.

It replaces "interconnect: qcom: Don't read back BCMs without an RPMh address" [1], where Konrad asked to fix the driver instead. Molokai used the Kaanapali driver, which votes on the QPC0 BCM that the Molokai command DB does not have; the read back of that BCM hung RPMh. The Molokai driver has no QPC0, and it programs the Molokai QoS offsets instead of the Kaanapali ones.

The topology and QoS settings come from the Molokai driver in Motorola's downstream kernel. The upstream Kaanapali driver matches the downstream Kaanapali one node for node, so the driver is the Kaanapali one with the downstream Kaanapali to Molokai differences applied.

The binding header includes the Kaanapali one and only adds the new MMSS nodes: molokai.dtsi builds on kaanapali.dtsi and inherits its interconnect paths, and a header with its own numbering would redefine the same macros with other values. If a standalone header is preferred, molokai.dtsi would have to override every inherited interconnect path, or stop building on kaanapali.dtsi; I can rework it that way.

Tested on the Motorola Signature with molokai.dtsi switched to these providers (Molokai SoC series v5 [2]) and the generic read back fix reverted: all 14 providers probe, there are no RPMh timeouts, and the display, GPU, touchscreen and audio work with QoS programming enabled.

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/

I used an LLM (Claude) to help write these patches and their commit messages. I reviewed all of them and tested the result on the device.

---
Changes in v2:
- Route the crypto engine through the A2NOC slave instead of A1NOC: it sits on aggre2, the downstream A1NOC link was left over from Kaanapali (Sashiko). Tested: the SCM crypto path now goes through
qnm_aggre2_noc.
- Cover: point to v5 of the Molokai SoC series.
- Link to v1: https://patch.msgid.link/[email protected]

---
Venkat Yadlapati (2):
dt-bindings: interconnect: qcom: Add Molokai RPMh NoC
interconnect: qcom: Add Molokai interconnect provider driver

 .../bindings/interconnect/qcom,molokai-rpmh.yaml   |  144 ++
 drivers/interconnect/qcom/Kconfig                  |   11 +
 drivers/interconnect/qcom/Makefile                 |    2 +
 drivers/interconnect/qcom/molokai.c                | 1753 ++++++++++++++++++++
 .../dt-bindings/interconnect/qcom,molokai-rpmh.h   |   26 +
 5 files changed, 1936 insertions(+)

---
base-commit: e5aad2bdbbee783611d32599f89cea3f12f9593d
change-id: 20261127-molokai-icc-1314acd09958

Best regards,

Signature · 1 line
Venkat Yadlapati <[email protected]>
#1 lore raw

PATCH v2 1/2 dt-bindings: interconnect: qcom: Add Molokai RPMh NoC

Document the RPMh Network-On-Chip interconnect providers of the Qualcomm Molokai (SM8845) SoC.

Molokai is close to Kaanapali, but its NoCs differ: the aggregate NoC is split into aggre1 (0x16e0000) and aggre2 (0x1700000), the MMSS NoC config and service ports are split into HF and SF halves, and some masters and slaves are missing. aggre1 needs the UFS and USB3 AXI clocks for QoS programming, aggre2 the IPA clock.

The header keeps the Kaanapali IDs for every node the two SoCs share and adds only the new MMSS config nodes, so molokai.dtsi can keep the interconnect paths it inherits from kaanapali.dtsi.

---
 .../bindings/interconnect/qcom,molokai-rpmh.yaml   | 144 +++++++++++++++++++++
 .../dt-bindings/interconnect/qcom,molokai-rpmh.h   |  26 ++++
 2 files changed, 170 insertions(+)
Documentation/devicetree/bindings/interconnect/qcom,molokai-rpmh.yaml new file +144 -0
new file mode 100644
index 000000000000..fd94f6dae1a6
@@ -0,0 +1,144 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interconnect/qcom,molokai-rpmh.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm RPMh Network-On-Chip Interconnect on Molokai
+
+maintainers:
+  - Venkat Yadlapati <[email protected]>
+
+description: |
+  RPMh interconnect providers support system bandwidth requirements through
+  RPMh hardware accelerators known as Bus Clock Manager (BCM). The provider is
+  able to communicate with the BCM through the Resource State Coordinator (RSC)
+  associated with each execution environment. Provider nodes must point to at
+  least one RPMh device child node pertaining to their RSC and each provider
+  can map to multiple RPMh resources.
+
+  See also: include/dt-bindings/interconnect/qcom,molokai-rpmh.h
+
+properties:
+  compatible:
+    enum:
+      - qcom,molokai-aggre1-noc
+      - qcom,molokai-aggre2-noc
+      - qcom,molokai-clk-virt
+      - qcom,molokai-cnoc-cfg
+      - qcom,molokai-cnoc-main
+      - qcom,molokai-gem-noc
+      - qcom,molokai-lpass-ag-noc
+      - qcom,molokai-lpass-lpiaon-noc
+      - qcom,molokai-lpass-lpicx-noc
+      - qcom,molokai-mc-virt
+      - qcom,molokai-mmss-noc
+      - qcom,molokai-nsp-noc
+      - qcom,molokai-pcie-anoc
+      - qcom,molokai-system-noc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    maxItems: 2
+
+required:
+  - compatible
+
+allOf:
+  - $ref: qcom,rpmh-common.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,molokai-clk-virt
+              - qcom,molokai-mc-virt
+    then:
+      properties:
+        reg: false
+    else:
+      required:
+        - reg
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,molokai-pcie-anoc
+    then:
+      properties:
+        clocks:
+          items:
+            - description: aggre-NOC PCIe AXI clock
+            - description: cfg-NOC PCIe a-NOC AHB clock
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,molokai-aggre1-noc
+    then:
+      properties:
+        clocks:
+          items:
+            - description: aggre UFS PHY AXI clock
+            - description: aggre USB3 PRIM AXI clock
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,molokai-aggre2-noc
+    then:
+      properties:
+        clocks:
+          items:
+            - description: RPMH CC IPA clock
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,molokai-aggre1-noc
+              - qcom,molokai-aggre2-noc
+              - qcom,molokai-pcie-anoc
+    then:
+      required:
+        - clocks
+    else:
+      properties:
+        clocks: false
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    clk_virt: interconnect-0 {
+      compatible = "qcom,molokai-clk-virt";
+      #interconnect-cells = <2>;
+      qcom,bcm-voters = <&apps_bcm_voter>;
+    };
+
+    aggre1_noc: interconnect@16e0000 {
+      compatible = "qcom,molokai-aggre1-noc";
+      reg = <0x016e0000 0x16400>;
+      #interconnect-cells = <2>;
+      clocks = <&gcc_aggre_ufs_phy_axi_clk>,
+               <&gcc_aggre_usb3_prim_axi_clk>;
+      qcom,bcm-voters = <&apps_bcm_voter>;
+    };
+
+    aggre2_noc: interconnect@1700000 {
+      compatible = "qcom,molokai-aggre2-noc";
+      reg = <0x01700000 0x22400>;
+      #interconnect-cells = <2>;
+      clocks = <&rpmhcc_ipa_clk>;
+      qcom,bcm-voters = <&apps_bcm_voter>;
+    };
include/dt-bindings/interconnect/qcom,molokai-rpmh.h new file +26 -0
new file mode 100644
index 000000000000..88efa9f1d7a7
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Molokai interconnect IDs
+ *
+ * Molokai keeps the Kaanapali node IDs for every node the two SoCs share,
+ * so this only adds the nodes Kaanapali does not have. On Molokai the
+ * aggre1-noc and aggre2-noc providers use the Kaanapali aggre-noc IDs,
+ * and cnoc-main also carries SLAVE_PCIE_CFG.
+ */
+
+#ifndef __DT_BINDINGS_INTERCONNECT_QCOM_MOLOKAI_H
+#define __DT_BINDINGS_INTERCONNECT_QCOM_MOLOKAI_H
+
+#include <dt-bindings/interconnect/qcom,kaanapali-rpmh.h>
+
+/* cnoc-cfg */
+#define SLAVE_CNOC_MNOC_HF_CFG			36
+#define SLAVE_CNOC_MNOC_SF_CFG			37
+
+/* mmss-noc */
+#define MASTER_CNOC_MNOC_HF_CFG			15
+#define MASTER_CNOC_MNOC_SF_CFG			16
+#define SLAVE_SERVICE_MNOC_HF			17
+#define SLAVE_SERVICE_MNOC_SF			18
+
+#endif
Signature · 1 line
2.56.1
#2 lore raw

PATCH v2 2/2 interconnect: qcom: Add Molokai interconnect provider driver

In reply to Venkat Yadlapati

Add the RPMh interconnect provider driver for the Qualcomm Molokai (SM8845) SoC.

It starts from the Kaanapali driver. The topology and QoS settings come from the Molokai downstream driver:

- aggre-noc is split into aggre1 (QUP1, SDCC2, UFS, USB3) and aggre2 (QSPI, QUP2, QUP3, crypto, IPA, SOCCP, QDSS ETR), with new QoS port offsets. QUP1 is a 4 byte qhm port. The crypto engine now goes out through the A2NOC slave; the downstream driver still links it to A1NOC as on Kaanapali, but its QoS port and the downstream devicetree place it on aggre2, as on SM8550, SM8650 and SM8750.
- mmss-noc: the camera, display and video QoS ports moved, there is a single video MVP port, and the config and service nodes are split into HF and SF halves.
- No QUP4, SDCC4, SP, QPACE, CDSP HCP, I2C hub, I3C IBI or SPSS nodes, and no QPC0 or QUP4 BCM.
- The PCIe config slave sits on cnoc-main, the IPC router has two channels and the PCIe ports are 8 bytes wide.
- Several masters no longer set urg_fwd, and the MDSS DCP and gem-noc PCIe priorities changed.

Using the Kaanapali driver on Molokai programs Kaanapali QoS offsets into the Molokai NoCs and reads back the QPC0 BCM, which the Molokai command DB does not have. That read never completes and stalls every later RPMh request.

---
 drivers/interconnect/qcom/Kconfig   |   11 +
 drivers/interconnect/qcom/Makefile  |    2 +
 drivers/interconnect/qcom/molokai.c | 1753 +++++++++++++++++++++++++++++++++++
 3 files changed, 1766 insertions(+)
drivers/interconnect/qcom/Kconfig +11 -0
index 6a3fff343488..57f91636c99e 100644
@@ -90,6 +90,17 @@ config INTERCONNECT_QCOM_MAILI
 	  This is a driver for the Qualcomm Network-on-Chip on maili-based
 	  platforms.
 
+config INTERCONNECT_QCOM_MOLOKAI
+	tristate "Qualcomm Molokai interconnect driver"
+	depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
+	depends on ARM64 || COMPILE_TEST
+	select INTERCONNECT_QCOM_RPMH
+	select INTERCONNECT_QCOM_BCM_VOTER
+	default ARCH_QCOM
+	help
+	  This is a driver for the Qualcomm Network-on-Chip on molokai-based
+	  platforms.
+
 config INTERCONNECT_QCOM_MSM8909
 	tristate "Qualcomm MSM8909 interconnect driver"
 	depends on INTERCONNECT_QCOM
drivers/interconnect/qcom/Makefile +2 -0
index 7fdb3967d391..f371ddb9d75c 100644
@@ -12,6 +12,7 @@ qnoc-kaanapali-objs			:= kaanapali.o
 qnoc-kuno-objs				:= kuno.o
 qnoc-maili-objs				:= maili.o
 qnoc-milos-objs				:= milos.o
+qnoc-molokai-objs			:= molokai.o
 qnoc-msm8909-objs			:= msm8909.o
 qnoc-msm8916-objs			:= msm8916.o
 qnoc-msm8937-objs			:= msm8937.o
@@ -64,6 +65,7 @@ obj-$(CONFIG_INTERCONNECT_QCOM_KAANAPALI) += qnoc-kaanapali.o
 obj-$(CONFIG_INTERCONNECT_QCOM_KUNO) += qnoc-kuno.o
 obj-$(CONFIG_INTERCONNECT_QCOM_MAILI) += qnoc-maili.o
 obj-$(CONFIG_INTERCONNECT_QCOM_MILOS) += qnoc-milos.o
+obj-$(CONFIG_INTERCONNECT_QCOM_MOLOKAI) += qnoc-molokai.o
 obj-$(CONFIG_INTERCONNECT_QCOM_MSM8909) += qnoc-msm8909.o
 obj-$(CONFIG_INTERCONNECT_QCOM_MSM8916) += qnoc-msm8916.o
 obj-$(CONFIG_INTERCONNECT_QCOM_MSM8937) += qnoc-msm8937.o
drivers/interconnect/qcom/molokai.c new file +1753 -0

1,753 lines not on this page · raw message

Signature · 1 line
2.56.1