Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider
@ 2026-11-30 10:49 Atanas Filipov
  2026-11-30 10:49 ` [PATCH 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Camera drivers can set a minimum rate on the shared camera NoC
clocks. The interconnect provider lets clients request bandwidth on
their camera NoC ports and on the camera AHB path. It uses those votes
to set the AXI and AHB clock rates and select a power rail level.

The series supports SM8250, SC7280 and SA8775P. The AXI rate follows
the largest bandwidth request across the rate nodes, with a margin and
a minimum rate. The AHB rate uses fixed levels. The provider uses OPPs
to vote for MMCX on SM8250, CX on SC7280, and MMCX and MXC on SA8775P.

The provider programs static QoS settings on runtime resume. It logs
and clears camera NoC errors. A client can use qcom_cam_icc_link() to
resume the provider before it resumes.

This series adds the provider. CAMSS and JPEG client conversion will
follow in separate series.

Validation:
- Built this series with W=1 for RB5, RB3 Gen2 and RB8.
- Checked all three bindings and the RB5, RB3 Gen2, Lemans EVK and
  SA8255P Ride DTBs against the camera NoC schemas.
- Ran sparse on arm64 and x86 and checkpatch with codespell on all
  patches. There were no camera NoC diagnostics apart from the
  checkpatch notice about MAINTAINERS.
- Earlier hardware tests used separate CAMSS client patches. CAMSS
  capture ran on RB5, RB3 Gen2 and RB8. On RB5, a forced IOMMU fault
  produced a camera NoC slave error and the next capture worked.
  Hardware testing of this series is pending.

Atanas Filipov (10):
  dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC
  dt-bindings: interconnect: add the Qualcomm SC7280 Titan camera NoC
  dt-bindings: interconnect: add the Qualcomm SA8775P Titan camera NoC
  media: qcom: cam-icc: add the Titan camera NoC driver
  media: qcom: cam-icc: add the SM8250 data
  media: qcom: cam-icc: add the SC7280 data
  media: qcom: cam-icc: add the SA8775P data
  arm64: dts: qcom: sm8250: add the Titan camera NoC node
  arm64: dts: qcom: sc7280: add the Titan camera NoC node
  arm64: dts: qcom: sa8775p: add the Titan camera NoC node

 .../interconnect/qcom,sa8775p-cam-icc.yaml    | 163 +++++
 .../interconnect/qcom,sc7280-cam-icc.yaml     | 160 +++++
 .../interconnect/qcom,sm8250-cam-icc.yaml     | 149 ++++
 arch/arm64/boot/dts/qcom/kodiak.dtsi          |  62 ++
 arch/arm64/boot/dts/qcom/lemans-gearvm.dtsi   |   6 +
 arch/arm64/boot/dts/qcom/lemans.dtsi          |  58 ++
 arch/arm64/boot/dts/qcom/sm8250.dtsi          |  49 ++
 drivers/media/platform/qcom/Kconfig           |   1 +
 drivers/media/platform/qcom/Makefile          |   1 +
 drivers/media/platform/qcom/cam-icc/Kconfig   |  14 +
 drivers/media/platform/qcom/cam-icc/Makefile  |   5 +
 .../platform/qcom/cam-icc/qcom-cam-icc-core.c | 638 ++++++++++++++++++
 .../platform/qcom/cam-icc/qcom-cam-icc-core.h | 146 ++++
 .../qcom/cam-icc/qcom-cam-icc-sa8775p.c       | 116 ++++
 .../qcom/cam-icc/qcom-cam-icc-sc7280.c        | 143 ++++
 .../qcom/cam-icc/qcom-cam-icc-sm8250.c        | 136 ++++
 .../interconnect/qcom,sa8775p-cam-icc.h       |  17 +
 .../interconnect/qcom,sc7280-cam-icc.h        |  21 +
 .../interconnect/qcom,sm8250-cam-icc.h        |  21 +
 include/media/qcom-cam-icc.h                  |  26 +
 20 files changed, 1932 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml
 create mode 100644 drivers/media/platform/qcom/cam-icc/Kconfig
 create mode 100644 drivers/media/platform/qcom/cam-icc/Makefile
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c
 create mode 100644 include/dt-bindings/interconnect/qcom,sa8775p-cam-icc.h
 create mode 100644 include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h
 create mode 100644 include/dt-bindings/interconnect/qcom,sm8250-cam-icc.h
 create mode 100644 include/media/qcom-cam-icc.h


base-commit: 3dd8c790a7b7027abdd568e36db5e82ffaea7c77
-- 
2.25.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC
  2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
@ 2026-11-30 10:49 ` Atanas Filipov
  2026-11-30 10:49 ` [PATCH 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the binding of the SM8250 Titan camera NoC. The camera NoC connects
the camera blocks to the multimedia NoC and DDR.

It is an interconnect and not only a clock: each camera block has its
own ports on the camera NoC, and the votes on these ports set the
camera NoC clock rates and the rail level.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 .../interconnect/qcom,sm8250-cam-icc.yaml     | 149 ++++++++++++++++++
 .../interconnect/qcom,sm8250-cam-icc.h        |  21 +++
 2 files changed, 170 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml
 create mode 100644 include/dt-bindings/interconnect/qcom,sm8250-cam-icc.h

diff --git a/Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml b/Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml
new file mode 100644
index 000000000000..a3d77e7e6886
--- /dev/null
+++ b/Documentation/devicetree/bindings/interconnect/qcom,sm8250-cam-icc.yaml
@@ -0,0 +1,149 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interconnect/qcom,sm8250-cam-icc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Titan camera NoC
+
+maintainers:
+  - Atanas Filipov <atanas.filipov@oss.qualcomm.com>
+
+description:
+  The camera NoC connects the camera blocks to the multimedia NoC and
+  DDR. It has one node for each camera NoC port and one node for the
+  camera AHB (config) path. Clients request bandwidth on paths that
+  start at these nodes.
+
+properties:
+  compatible:
+    enum:
+      - qcom,sm8250-cam-icc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: GCC camera AHB clock
+      - description: GCC camera HF AXI clock
+      - description: GCC camera SF AXI clock
+      - description: camera slow AHB clock source
+      - description: CPAS AHB clock
+      - description: camera core AHB clock
+      - description: camera NoC AXI clock
+
+  clock-names:
+    items:
+      - const: iface
+      - const: gcc_axi_hf
+      - const: gcc_axi_sf
+      - const: slow_ahb_src
+      - const: cpas_ahb
+      - const: core_ahb
+      - const: camnoc_axi
+
+  power-domains:
+    items:
+      - description: Titan top GDSC
+      - description: MMCX power domain, for the camera NoC clock rate
+
+  power-domain-names:
+    items:
+      - const: top
+      - const: mmcx
+
+  operating-points-v2: true
+
+  opp-table:
+    type: object
+
+  interconnects:
+    items:
+      - description: config path from the CPU to the camera config space
+      - description: camera NoC HF port to DDR
+      - description: camera NoC SF port to DDR
+
+  interconnect-names:
+    items:
+      - const: cfg
+      - const: hf
+      - const: sf
+
+  '#interconnect-cells':
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - power-domains
+  - power-domain-names
+  - operating-points-v2
+  - interconnects
+  - interconnect-names
+  - '#interconnect-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,camcc-sm8250.h>
+    #include <dt-bindings/clock/qcom,gcc-sm8250.h>
+    #include <dt-bindings/interconnect/qcom,sm8250.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/qcom,rpmhpd.h>
+
+    interconnect@ac42000 {
+        compatible = "qcom,sm8250-cam-icc";
+        reg = <0x0ac42000 0x8000>;
+
+        interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+        clocks = <&gcc GCC_CAMERA_AHB_CLK>,
+                 <&gcc GCC_CAMERA_HF_AXI_CLK>,
+                 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+                 <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+                 <&camcc CAM_CC_CPAS_AHB_CLK>,
+                 <&camcc CAM_CC_CORE_AHB_CLK>,
+                 <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+        clock-names = "iface",
+                      "gcc_axi_hf",
+                      "gcc_axi_sf",
+                      "slow_ahb_src",
+                      "cpas_ahb",
+                      "core_ahb",
+                      "camnoc_axi";
+
+        power-domains = <&camcc TITAN_TOP_GDSC>,
+                        <&rpmhpd RPMHPD_MMCX>;
+        power-domain-names = "top", "mmcx";
+
+        operating-points-v2 = <&camnoc_opp_table>;
+
+        interconnects = <&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_CAMERA_CFG 0>,
+                        <&mmss_noc MASTER_CAMNOC_HF 0 &mc_virt SLAVE_EBI_CH0 0>,
+                        <&mmss_noc MASTER_CAMNOC_SF 0 &mc_virt SLAVE_EBI_CH0 0>;
+        interconnect-names = "cfg", "hf", "sf";
+
+        #interconnect-cells = <2>;
+
+        camnoc_opp_table: opp-table {
+            compatible = "operating-points-v2";
+
+            opp-300000000 {
+                opp-hz = /bits/ 64 <300000000>;
+                required-opps = <&rpmhpd_opp_low_svs>;
+            };
+
+            opp-400000000 {
+                opp-hz = /bits/ 64 <400000000>;
+                required-opps = <&rpmhpd_opp_svs>;
+            };
+        };
+    };
diff --git a/include/dt-bindings/interconnect/qcom,sm8250-cam-icc.h b/include/dt-bindings/interconnect/qcom,sm8250-cam-icc.h
new file mode 100644
index 000000000000..5afbe0372de7
--- /dev/null
+++ b/include/dt-bindings/interconnect/qcom,sm8250-cam-icc.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Qualcomm SM8250 camera NoC interconnect IDs
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __DT_BINDINGS_INTERCONNECT_QCOM_SM8250_CAM_ICC_H
+#define __DT_BINDINGS_INTERCONNECT_QCOM_SM8250_CAM_ICC_H
+
+#define MASTER_CAMNOC_IFE_LINEAR_WR	1
+#define MASTER_CAMNOC_IFE_RDI_WR	2
+#define MASTER_CAMNOC_IFE_RDI_RD	3
+#define MASTER_CAMNOC_JPEG_WR		4
+#define MASTER_CAMNOC_JPEG_RD		5
+#define MASTER_CAMNOC_AHB		6
+#define SLAVE_CAMNOC_HF			7
+#define SLAVE_CAMNOC_SF			8
+#define SLAVE_CAMNOC_AHB		10
+
+#endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 Titan camera NoC
  2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
  2026-11-30 10:49 ` [PATCH 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
@ 2026-11-30 10:49 ` Atanas Filipov
  2026-11-30 10:49 ` [PATCH 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the Titan camera NoC of SC7280. It is an interconnect provider for
the camera clients, with one node per camera NoC port and one node for
the camera AHB path. Compared to SM8250, it has no GCC camera AHB clock
and no camera core AHB clock, and the camera NoC registers are at a
different address.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 .../interconnect/qcom,sc7280-cam-icc.yaml     | 160 ++++++++++++++++++
 .../interconnect/qcom,sc7280-cam-icc.h        |  21 +++
 2 files changed, 181 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
 create mode 100644 include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h

diff --git a/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml b/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
new file mode 100644
index 000000000000..719b8e1ef577
--- /dev/null
+++ b/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
@@ -0,0 +1,160 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interconnect/qcom,sc7280-cam-icc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm SC7280 Titan camera NoC
+
+maintainers:
+  - Atanas Filipov <atanas.filipov@oss.qualcomm.com>
+
+description:
+  The camera NoC connects the camera blocks to the multimedia NoC and
+  DDR. It has one node for each camera NoC port and one node for the
+  camera AHB (config) path. Clients request bandwidth on paths that
+  start at these nodes.
+
+properties:
+  compatible:
+    enum:
+      - qcom,sc7280-cam-icc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: GCC camera HF AXI clock
+      - description: GCC camera SF AXI clock
+      - description: camera slow AHB clock source
+      - description: CPAS AHB clock
+      - description: camera NoC AXI clock
+      - description: camera NoC AXI clock source
+
+  clock-names:
+    items:
+      - const: gcc_axi_hf
+      - const: gcc_axi_sf
+      - const: slow_ahb_src
+      - const: cpas_ahb
+      - const: camnoc_axi
+      - const: camnoc_axi_src
+
+  power-domains:
+    items:
+      - description: Titan top GDSC
+      - description: CX power domain, for the camera NoC clock rate
+
+  power-domain-names:
+    items:
+      - const: top
+      - const: cx
+
+  operating-points-v2: true
+
+  opp-table:
+    type: object
+
+  interconnects:
+    items:
+      - description: config path from the CPU to the camera config space
+      - description: camera NoC HF port to DDR
+      - description: camera NoC SF port to DDR
+
+  interconnect-names:
+    items:
+      - const: cfg
+      - const: hf
+      - const: sf
+
+  '#interconnect-cells':
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - power-domains
+  - power-domain-names
+  - operating-points-v2
+  - interconnects
+  - interconnect-names
+  - '#interconnect-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,camcc-sc7280.h>
+    #include <dt-bindings/clock/qcom,gcc-sc7280.h>
+    #include <dt-bindings/interconnect/qcom,sc7280.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/qcom,rpmhpd.h>
+
+    interconnect@ac9f000 {
+        compatible = "qcom,sc7280-cam-icc";
+        reg = <0x0ac9f000 0x10000>;
+
+        interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+        clocks = <&gcc GCC_CAMERA_HF_AXI_CLK>,
+                 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+                 <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+                 <&camcc CAM_CC_CPAS_AHB_CLK>,
+                 <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+                 <&camcc CAM_CC_CAMNOC_AXI_CLK_SRC>;
+        clock-names = "gcc_axi_hf",
+                      "gcc_axi_sf",
+                      "slow_ahb_src",
+                      "cpas_ahb",
+                      "camnoc_axi",
+                      "camnoc_axi_src";
+
+        power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>,
+                        <&rpmhpd SC7280_CX>;
+        power-domain-names = "top", "cx";
+
+        operating-points-v2 = <&camnoc_opp_table>;
+
+        interconnects = <&gem_noc MASTER_APPSS_PROC 0 &cnoc2 SLAVE_CAMERA_CFG 0>,
+                        <&mmss_noc MASTER_CAMNOC_HF 0 &mc_virt SLAVE_EBI1 0>,
+                        <&mmss_noc MASTER_CAMNOC_SF 0 &mc_virt SLAVE_EBI1 0>;
+        interconnect-names = "cfg", "hf", "sf";
+
+        #interconnect-cells = <2>;
+
+        camnoc_opp_table: opp-table {
+            compatible = "operating-points-v2";
+
+            opp-150000000 {
+                opp-hz = /bits/ 64 <150000000>;
+                required-opps = <&rpmhpd_opp_low_svs>;
+            };
+
+            opp-240000000 {
+                opp-hz = /bits/ 64 <240000000>;
+                required-opps = <&rpmhpd_opp_svs>;
+            };
+
+            opp-320000000 {
+                opp-hz = /bits/ 64 <320000000>;
+                required-opps = <&rpmhpd_opp_svs_l1>;
+            };
+
+            opp-400000000 {
+                opp-hz = /bits/ 64 <400000000>;
+                required-opps = <&rpmhpd_opp_nom>;
+            };
+
+            opp-480000000 {
+                opp-hz = /bits/ 64 <480000000>;
+                required-opps = <&rpmhpd_opp_turbo>;
+            };
+        };
+    };
diff --git a/include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h b/include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h
new file mode 100644
index 000000000000..4c7721fa503e
--- /dev/null
+++ b/include/dt-bindings/interconnect/qcom,sc7280-cam-icc.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Qualcomm SC7280 camera NoC interconnect IDs
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __DT_BINDINGS_INTERCONNECT_QCOM_SC7280_CAM_ICC_H
+#define __DT_BINDINGS_INTERCONNECT_QCOM_SC7280_CAM_ICC_H
+
+#define MASTER_CAMNOC_IFE_RDI_WR	0
+#define MASTER_CAMNOC_IFE_PIXEL_WR	1
+#define MASTER_CAMNOC_IFE2_PIXEL_WR	2
+#define MASTER_CAMNOC_JPEG_WR		3
+#define MASTER_CAMNOC_JPEG_RD		4
+#define MASTER_CAMNOC_AHB		5
+#define SLAVE_CAMNOC_HF			6
+#define SLAVE_CAMNOC_SF			7
+#define SLAVE_CAMNOC_AHB		9
+
+#endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P Titan camera NoC
  2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
  2026-11-30 10:49 ` [PATCH 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
  2026-11-30 10:49 ` [PATCH 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
@ 2026-11-30 10:49 ` Atanas Filipov
  2026-11-30 10:49 ` [PATCH 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the Titan camera NoC of SA8775P. Compared to SM8250, the camera NoC
rate is set on the fast AHB clock and needs both the MMCX and MXC
rails.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 .../interconnect/qcom,sa8775p-cam-icc.yaml    | 163 ++++++++++++++++++
 .../interconnect/qcom,sa8775p-cam-icc.h       |  17 ++
 2 files changed, 180 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
 create mode 100644 include/dt-bindings/interconnect/qcom,sa8775p-cam-icc.h

diff --git a/Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml b/Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
new file mode 100644
index 000000000000..6e771d8d0e7b
--- /dev/null
+++ b/Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
@@ -0,0 +1,163 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interconnect/qcom,sa8775p-cam-icc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm SA8775P Titan camera NoC
+
+maintainers:
+  - Atanas Filipov <atanas.filipov@oss.qualcomm.com>
+
+description:
+  The camera NoC connects the camera blocks to the multimedia NoC and
+  DDR. It has one node for each camera NoC port and one node for the
+  camera AHB (config) path. Clients request bandwidth on paths that
+  start at these nodes.
+
+properties:
+  compatible:
+    enum:
+      - qcom,sa8775p-cam-icc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: GCC camera AHB clock
+      - description: GCC camera HF AXI clock
+      - description: GCC camera SF AXI clock
+      - description: camera slow AHB clock source
+      - description: CPAS AHB clock
+      - description: camera core AHB clock
+      - description: camera fast AHB clock source
+      - description: CPAS fast AHB clock
+      - description: camera NoC AXI clock
+      - description: camera NoC AXI clock source
+
+  clock-names:
+    items:
+      - const: iface
+      - const: gcc_axi_hf
+      - const: gcc_axi_sf
+      - const: slow_ahb_src
+      - const: cpas_ahb
+      - const: core_ahb
+      - const: fast_ahb_src
+      - const: cpas_fast_ahb
+      - const: camnoc_axi
+      - const: camnoc_axi_src
+
+  power-domains:
+    items:
+      - description: Titan top GDSC
+      - description: MMCX power domain, for the camera NoC clock rate
+      - description: MXC power domain, for the camera NoC clock rate
+
+  power-domain-names:
+    items:
+      - const: top
+      - const: mmcx
+      - const: mxc
+
+  operating-points-v2: true
+
+  opp-table:
+    type: object
+
+  interconnects:
+    items:
+      - description: config path from the CPU to the camera config space
+      - description: camera NoC HF port to DDR
+
+  interconnect-names:
+    items:
+      - const: cfg
+      - const: hf
+
+  '#interconnect-cells':
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - power-domains
+  - power-domain-names
+  - operating-points-v2
+  - interconnects
+  - interconnect-names
+  - '#interconnect-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,sa8775p-camcc.h>
+    #include <dt-bindings/clock/qcom,sa8775p-gcc.h>
+    #include <dt-bindings/interconnect/qcom,sa8775p-rpmh.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/qcom,rpmhpd.h>
+
+    interconnect@ac1a000 {
+        compatible = "qcom,sa8775p-cam-icc";
+        reg = <0x0ac1a000 0x9400>;
+
+        interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+        clocks = <&gcc GCC_CAMERA_AHB_CLK>,
+                 <&gcc GCC_CAMERA_HF_AXI_CLK>,
+                 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+                 <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+                 <&camcc CAM_CC_CPAS_AHB_CLK>,
+                 <&camcc CAM_CC_CORE_AHB_CLK>,
+                 <&camcc CAM_CC_FAST_AHB_CLK_SRC>,
+                 <&camcc CAM_CC_CPAS_FAST_AHB_CLK>,
+                 <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+                 <&camcc CAM_CC_CAMNOC_AXI_CLK_SRC>;
+        clock-names = "iface",
+                      "gcc_axi_hf",
+                      "gcc_axi_sf",
+                      "slow_ahb_src",
+                      "cpas_ahb",
+                      "core_ahb",
+                      "fast_ahb_src",
+                      "cpas_fast_ahb",
+                      "camnoc_axi",
+                      "camnoc_axi_src";
+
+        power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>,
+                        <&rpmhpd SA8775P_MMCX>,
+                        <&rpmhpd SA8775P_MXC>;
+        power-domain-names = "top", "mmcx", "mxc";
+
+        operating-points-v2 = <&camnoc_opp_table>;
+
+        interconnects = <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_CAMERA_CFG 0>,
+                        <&mmss_noc MASTER_CAMNOC_HF 0 &mc_virt SLAVE_EBI1 0>;
+        interconnect-names = "cfg", "hf";
+
+        #interconnect-cells = <2>;
+
+        camnoc_opp_table: opp-table {
+            compatible = "operating-points-v2";
+
+            opp-300000000 {
+                opp-hz = /bits/ 64 <300000000>;
+                required-opps = <&rpmhpd_opp_svs_l1>,
+                                <&rpmhpd_opp_svs_l1>;
+            };
+
+            opp-400000000 {
+                opp-hz = /bits/ 64 <400000000>;
+                required-opps = <&rpmhpd_opp_nom>,
+                                <&rpmhpd_opp_nom>;
+            };
+        };
+    };
diff --git a/include/dt-bindings/interconnect/qcom,sa8775p-cam-icc.h b/include/dt-bindings/interconnect/qcom,sa8775p-cam-icc.h
new file mode 100644
index 000000000000..06c5769c9541
--- /dev/null
+++ b/include/dt-bindings/interconnect/qcom,sa8775p-cam-icc.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Qualcomm SA8775P camera NoC interconnect IDs
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __DT_BINDINGS_INTERCONNECT_QCOM_SA8775P_CAM_ICC_H
+#define __DT_BINDINGS_INTERCONNECT_QCOM_SA8775P_CAM_ICC_H
+
+#define MASTER_CAMNOC_IFE_RT_WR0	0
+#define MASTER_CAMNOC_IFE_RT_WR1	1
+#define MASTER_CAMNOC_AHB		2
+#define SLAVE_CAMNOC_HF			3
+#define SLAVE_CAMNOC_AHB		6
+
+#endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 04/10] media: qcom: cam-icc: add the Titan camera NoC driver
  2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (2 preceding siblings ...)
  2026-11-30 10:49 ` [PATCH 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
@ 2026-11-30 10:49 ` Atanas Filipov
  2026-11-30 12:16   ` Bryan O'Donoghue
  2026-11-30 10:49 ` [PATCH 05/10] media: qcom: cam-icc: add the SM8250 data Atanas Filipov
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add an interconnect provider for the Titan camera NoC. CAMSS blocks
vote bandwidth on their camera NoC port to DDR and on the camera AHB
path. The driver sets the camera NoC AXI and AHB clock rates from the
aggregated votes, and the rail level through an OPP table.

On every runtime resume the driver writes the static QoS settings and
enables the camera NoC error interrupt.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 drivers/media/platform/qcom/Kconfig           |   1 +
 drivers/media/platform/qcom/Makefile          |   1 +
 drivers/media/platform/qcom/cam-icc/Kconfig   |  14 +
 drivers/media/platform/qcom/cam-icc/Makefile  |   4 +
 .../platform/qcom/cam-icc/qcom-cam-icc-core.c | 635 ++++++++++++++++++
 .../platform/qcom/cam-icc/qcom-cam-icc-core.h | 142 ++++
 include/media/qcom-cam-icc.h                  |  26 +
 7 files changed, 823 insertions(+)
 create mode 100644 drivers/media/platform/qcom/cam-icc/Kconfig
 create mode 100644 drivers/media/platform/qcom/cam-icc/Makefile
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
 create mode 100644 include/media/qcom-cam-icc.h

diff --git a/drivers/media/platform/qcom/Kconfig b/drivers/media/platform/qcom/Kconfig
index 4f4d3a68e6e5..95ea812c4996 100644
--- a/drivers/media/platform/qcom/Kconfig
+++ b/drivers/media/platform/qcom/Kconfig
@@ -4,4 +4,5 @@ comment "Qualcomm media platform drivers"
 
 source "drivers/media/platform/qcom/camss/Kconfig"
 source "drivers/media/platform/qcom/iris/Kconfig"
+source "drivers/media/platform/qcom/cam-icc/Kconfig"
 source "drivers/media/platform/qcom/venus/Kconfig"
diff --git a/drivers/media/platform/qcom/Makefile b/drivers/media/platform/qcom/Makefile
index ea2221a202c0..f5b95ba6dd98 100644
--- a/drivers/media/platform/qcom/Makefile
+++ b/drivers/media/platform/qcom/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-y += camss/
 obj-y += iris/
+obj-y += cam-icc/
 obj-y += venus/
diff --git a/drivers/media/platform/qcom/cam-icc/Kconfig b/drivers/media/platform/qcom/cam-icc/Kconfig
new file mode 100644
index 000000000000..8fae973ce1b0
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/Kconfig
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config QCOM_CAM_ICC
+	tristate "Qualcomm Titan camera NoC core driver"
+	depends on ARCH_QCOM || COMPILE_TEST
+	depends on COMMON_CLK && PM
+	depends on INTERCONNECT
+	select PM_OPP
+	default ARCH_QCOM
+	help
+	  Core driver for the camera NoC of Qualcomm SoCs. It manages the
+	  camera NoC resources shared by the camera drivers (CAMSS).
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called qcom-cam-icc.
diff --git a/drivers/media/platform/qcom/cam-icc/Makefile b/drivers/media/platform/qcom/cam-icc/Makefile
new file mode 100644
index 000000000000..4d1cbf60fea0
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+qcom-cam-icc-y := qcom-cam-icc-core.o
+
+obj-$(CONFIG_QCOM_CAM_ICC) += qcom-cam-icc.o
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
new file mode 100644
index 000000000000..beb0ee0cad7a
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
@@ -0,0 +1,635 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#include <linux/bitfield.h>
+#include <linux/bits.h>
+#include <linux/clk.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/interconnect-provider.h>
+#include <linux/interconnect.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/math64.h>
+#include <linux/minmax.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/pm_opp.h>
+#include <linux/pm_runtime.h>
+#include <linux/property.h>
+#include <linux/slab.h>
+
+#include <media/qcom-cam-icc.h>
+
+#include "qcom-cam-icc-core.h"
+
+#define QCOM_CAM_ICC_MIN_BW_KBPS	3000000
+#define QCOM_CAM_ICC_BUS_WIDTH		32
+#define QCOM_CAM_ICC_MARGIN_PCT		20
+
+#define QCOM_CAM_ICC_ERL_MAINCTL		0x08
+#define QCOM_CAM_ICC_ERL_MAINCTL_STALL_EN	BIT(0)
+#define QCOM_CAM_ICC_ERL_MAINCTL_FAULT_EN	BIT(1)
+#define QCOM_CAM_ICC_ERL_ERRCLR			0x18
+#define QCOM_CAM_ICC_ERL_ERRLOG0		0x20
+#define QCOM_CAM_ICC_ERL_ERRLOG0_CODE		GENMASK(10, 8)
+#define QCOM_CAM_ICC_ERL_ERRLOG1		0x28
+
+struct qcom_cam_icc {
+	struct device *dev;
+	const struct qcom_cam_icc_data *data;
+	void __iomem *base;
+	u32 irq_mask;
+	struct clk_bulk_data *clks;
+	int num_clks;
+	struct clk *axi_src;
+	struct clk *ahb_src;
+	struct icc_provider provider;
+	struct icc_onecell_data *icc_data;
+	u64 axi_rate;
+	const struct qcom_cam_icc_ahb_level *ahb_level;
+	struct dev_pm_domain_list *pd_list;
+	struct dev_pm_domain_list *rail_pd_list;
+	struct icc_path *cfg_path;
+	struct icc_path *hf_path;
+};
+
+static int qcom_cam_icc_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw,
+				      u32 peak_bw, u32 *agg_avg, u32 *agg_peak)
+{
+	const struct qcom_cam_icc_node *desc = node->data;
+
+	if (desc->merge == QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE) {
+		avg_bw /= 2;
+		peak_bw /= 2;
+	}
+
+	*agg_avg += avg_bw;
+	*agg_peak = max(*agg_peak, peak_bw);
+
+	return 0;
+}
+
+static u64 qcom_cam_icc_axi_rate(struct qcom_cam_icc *camnoc)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	u64 bw = 0;
+	size_t i;
+
+	for (i = 0; i < data->num_nodes; i++) {
+		const struct qcom_cam_icc_node *desc = &data->nodes[i];
+		struct icc_node *node = camnoc->icc_data->nodes[desc->id];
+
+		if (!desc->rate_node || !node)
+			continue;
+
+		bw = max_t(u64, bw, (u64)max(node->avg_bw, node->peak_bw) * desc->width_factor);
+	}
+
+	if (!bw)
+		return 0;
+
+	bw += div_u64(bw * QCOM_CAM_ICC_MARGIN_PCT, 100);
+	bw = max_t(u64, bw, QCOM_CAM_ICC_MIN_BW_KBPS);
+
+	return div_u64(bw * 1000, QCOM_CAM_ICC_BUS_WIDTH);
+}
+
+static int qcom_cam_icc_set_axi_rate(struct qcom_cam_icc *camnoc, u64 rate)
+{
+	unsigned long freq = rate;
+	struct dev_pm_opp *opp;
+	int ret;
+
+	if (!rate) {
+		ret = clk_set_rate_range(camnoc->axi_src, 0, ULONG_MAX);
+		if (ret)
+			return ret;
+
+		return dev_pm_opp_set_opp(camnoc->dev, NULL);
+	}
+
+	opp = dev_pm_opp_find_freq_ceil(camnoc->dev, &freq);
+	if (IS_ERR(opp))
+		opp = dev_pm_opp_find_freq_floor(camnoc->dev, &freq);
+	if (IS_ERR(opp))
+		return PTR_ERR(opp);
+
+	ret = dev_pm_opp_set_opp(camnoc->dev, opp);
+	dev_pm_opp_put(opp);
+
+	return ret;
+}
+
+static const struct qcom_cam_icc_ahb_level *
+qcom_cam_icc_ahb_level(struct qcom_cam_icc *camnoc, u32 peak)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	size_t i;
+
+	if (!peak || !data->num_ahb_levels)
+		return NULL;
+
+	for (i = 0; i < data->num_ahb_levels; i++) {
+		if (data->ahb_levels[i].cfg_kbps >= peak)
+			return &data->ahb_levels[i];
+	}
+
+	return &data->ahb_levels[data->num_ahb_levels - 1];
+}
+
+static int qcom_cam_icc_update(struct qcom_cam_icc *camnoc)
+{
+	struct icc_node *ahb = camnoc->icc_data->nodes[camnoc->data->ahb_id];
+	const struct qcom_cam_icc_ahb_level *level;
+	unsigned long ahb_rate;
+	u64 rate;
+	int ret;
+
+	rate = qcom_cam_icc_axi_rate(camnoc);
+	level = qcom_cam_icc_ahb_level(camnoc, ahb ? ahb->peak_bw : 0);
+	if (rate == camnoc->axi_rate && level == camnoc->ahb_level)
+		return 0;
+
+	if (rate != camnoc->axi_rate) {
+		ret = qcom_cam_icc_set_axi_rate(camnoc, rate);
+		if (ret)
+			return ret;
+
+		camnoc->axi_rate = rate;
+	}
+
+	if (level != camnoc->ahb_level) {
+		ahb_rate = level ? level->slow_ahb_rate : 0;
+		ret = clk_set_rate_range(camnoc->ahb_src, ahb_rate, ULONG_MAX);
+		if (ret)
+			return ret;
+
+		camnoc->ahb_level = level;
+	}
+
+	dev_dbg(camnoc->dev, "request: camnoc axi %llu Hz, cfg %u kBps, slow ahb %lu Hz\n",
+		rate, level ? level->cfg_kbps : 0, level ? level->slow_ahb_rate : 0);
+
+	return 0;
+}
+
+static int qcom_cam_icc_icc_set(struct icc_node *src, struct icc_node *dst)
+{
+	struct qcom_cam_icc *camnoc = container_of(src->provider, struct qcom_cam_icc, provider);
+
+	return qcom_cam_icc_update(camnoc);
+}
+
+static int qcom_cam_icc_icc_get_bw(struct icc_node *node, u32 *avg, u32 *peak)
+{
+	*avg = 0;
+	*peak = 0;
+
+	return 0;
+}
+
+static int qcom_cam_icc_icc_link_path(struct qcom_cam_icc *camnoc,
+				      struct icc_node *node, const char *path)
+{
+	struct device_node *np = camnoc->dev->of_node;
+	struct icc_node_data *link_data;
+	struct of_phandle_args args;
+	struct icc_node *link;
+	int idx, ret;
+
+	idx = of_property_match_string(np, "interconnect-names", path);
+	if (idx < 0)
+		return idx;
+
+	ret = of_parse_phandle_with_args(np, "interconnects", "#interconnect-cells", idx * 2,
+					 &args);
+	if (ret)
+		return ret;
+
+	link_data = of_icc_get_from_provider(&args);
+	of_node_put(args.np);
+	if (IS_ERR(link_data))
+		return PTR_ERR(link_data);
+
+	link = link_data->node;
+	kfree(link_data);
+
+	return icc_link_nodes(node, &link);
+}
+
+static int qcom_cam_icc_icc_init(struct qcom_cam_icc *camnoc)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	struct icc_provider *provider = &camnoc->provider;
+	struct icc_onecell_data *icc_data;
+	size_t i, j;
+	int ret;
+
+	icc_data = devm_kzalloc(camnoc->dev, struct_size(icc_data, nodes, data->num_ids),
+				GFP_KERNEL);
+	if (!icc_data)
+		return -ENOMEM;
+
+	icc_data->num_nodes = data->num_ids;
+	camnoc->icc_data = icc_data;
+
+	provider->dev = camnoc->dev;
+	provider->set = qcom_cam_icc_icc_set;
+	provider->aggregate = qcom_cam_icc_icc_aggregate;
+	provider->get_bw = qcom_cam_icc_icc_get_bw;
+	provider->xlate = of_icc_xlate_onecell;
+	provider->data = icc_data;
+	icc_provider_init(provider);
+
+	for (i = 0; i < data->num_nodes; i++) {
+		const struct qcom_cam_icc_node *desc = &data->nodes[i];
+		struct icc_node *node;
+
+		node = icc_node_create_dyn();
+		if (IS_ERR(node)) {
+			ret = PTR_ERR(node);
+			goto err_remove_nodes;
+		}
+
+		ret = icc_node_set_name(node, provider, desc->name);
+		if (ret) {
+			icc_node_destroy(node->id);
+			goto err_remove_nodes;
+		}
+
+		node->data = (void *)desc;
+		icc_data->nodes[desc->id] = node;
+		icc_node_add(node, provider);
+	}
+
+	for (i = 0; i < data->num_nodes; i++) {
+		const struct qcom_cam_icc_node *desc = &data->nodes[i];
+
+		for (j = 0; j < desc->num_links; j++) {
+			ret = icc_link_nodes(icc_data->nodes[desc->id],
+					     &icc_data->nodes[desc->links[j]]);
+			if (ret)
+				goto err_remove_nodes;
+		}
+
+		if (desc->link_path) {
+			ret = qcom_cam_icc_icc_link_path(camnoc, icc_data->nodes[desc->id],
+							 desc->link_path);
+			if (ret)
+				goto err_remove_nodes;
+		}
+	}
+
+	ret = icc_provider_register(provider);
+	if (ret)
+		goto err_remove_nodes;
+
+	return 0;
+
+err_remove_nodes:
+	icc_nodes_remove(provider);
+
+	return ret;
+}
+
+static void qcom_cam_icc_qos_init(struct qcom_cam_icc *camnoc)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	size_t i;
+
+	for (i = 0; i < data->num_qos; i++)
+		writel(data->qos[i].value, camnoc->base + data->qos[i].offset);
+}
+
+static void qcom_cam_icc_irq_init(struct qcom_cam_icc *camnoc)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	size_t i;
+
+	writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
+
+	for (i = 0; i < data->num_irq_errs; i++) {
+		const struct qcom_cam_icc_irq_err *err = &data->irq_errs[i];
+
+		writel(1, camnoc->base + err->base + err->clear_off);
+		writel(err->enable_val, camnoc->base + err->base + err->enable_off);
+	}
+
+	if (data->erl) {
+		writel(1, camnoc->base + data->erl->base + QCOM_CAM_ICC_ERL_ERRCLR);
+		writel(QCOM_CAM_ICC_ERL_MAINCTL_STALL_EN | QCOM_CAM_ICC_ERL_MAINCTL_FAULT_EN,
+		       camnoc->base + data->erl->base + QCOM_CAM_ICC_ERL_MAINCTL);
+	}
+
+	writel(camnoc->irq_mask, camnoc->base + data->sbm->enable_reg);
+}
+
+static void qcom_cam_icc_erl_handle(struct qcom_cam_icc *camnoc)
+{
+	void __iomem *erl = camnoc->base + camnoc->data->erl->base;
+	u32 log0 = readl(erl + QCOM_CAM_ICC_ERL_ERRLOG0);
+
+	dev_err_ratelimited(camnoc->dev, "slave error, code %lu, errlog0 %#x, errlog1 %#x\n",
+			    FIELD_GET(QCOM_CAM_ICC_ERL_ERRLOG0_CODE, log0), log0,
+			    readl(erl + QCOM_CAM_ICC_ERL_ERRLOG1));
+	writel(1, erl + QCOM_CAM_ICC_ERL_ERRCLR);
+}
+
+static irqreturn_t qcom_cam_icc_irq(int irq, void *dev_id)
+{
+	struct qcom_cam_icc *camnoc = dev_id;
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	u32 status, pending, enable;
+	size_t i;
+
+	if (pm_runtime_get_if_active(camnoc->dev) <= 0)
+		return IRQ_NONE;
+
+	status = readl(camnoc->base + data->sbm->status_reg);
+	pending = status & camnoc->irq_mask;
+	if (!pending) {
+		pm_runtime_put(camnoc->dev);
+		return IRQ_NONE;
+	}
+
+	enable = readl(camnoc->base + data->sbm->enable_reg);
+	writel(enable & ~pending, camnoc->base + data->sbm->enable_reg);
+	writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
+
+	if (data->erl && (pending & data->erl->sbm_mask))
+		qcom_cam_icc_erl_handle(camnoc);
+
+	for (i = 0; i < data->num_irq_errs; i++) {
+		const struct qcom_cam_icc_irq_err *err = &data->irq_errs[i];
+
+		if (!(pending & err->sbm_mask))
+			continue;
+
+		dev_err_ratelimited(camnoc->dev, "%s error, status %#x\n", err->name,
+				    readl(camnoc->base + err->base + err->status_off));
+		writel(1, camnoc->base + err->base + err->clear_off);
+	}
+
+	pm_runtime_put(camnoc->dev);
+
+	return IRQ_HANDLED;
+}
+
+static int qcom_cam_icc_irq_request(struct platform_device *pdev, struct qcom_cam_icc *camnoc)
+{
+	const struct qcom_cam_icc_data *data = camnoc->data;
+	size_t i;
+	int irq;
+
+	for (i = 0; i < data->num_irq_errs; i++)
+		camnoc->irq_mask |= data->irq_errs[i].sbm_mask;
+
+	if (data->erl)
+		camnoc->irq_mask |= data->erl->sbm_mask;
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
+
+	return devm_request_threaded_irq(camnoc->dev, irq, NULL, qcom_cam_icc_irq, IRQF_ONESHOT,
+					 dev_name(camnoc->dev), camnoc);
+}
+
+static int qcom_cam_icc_runtime_suspend(struct device *dev)
+{
+	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
+
+	clk_bulk_disable_unprepare(camnoc->num_clks, camnoc->clks);
+	icc_set_bw(camnoc->hf_path, 0, 0);
+
+	return icc_set_bw(camnoc->cfg_path, 0, 0);
+}
+
+static int qcom_cam_icc_runtime_resume(struct device *dev)
+{
+	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
+	int ret;
+
+	ret = icc_set_bw(camnoc->cfg_path, 0, camnoc->data->ahb_levels[0].cfg_kbps);
+	if (ret)
+		return ret;
+
+	ret = icc_set_bw(camnoc->hf_path, 0, 1);
+	if (ret)
+		goto err_cfg;
+
+	ret = clk_bulk_prepare_enable(camnoc->num_clks, camnoc->clks);
+	if (ret)
+		goto err_cfg;
+
+	qcom_cam_icc_qos_init(camnoc);
+	qcom_cam_icc_irq_init(camnoc);
+
+	return 0;
+
+err_cfg:
+	icc_set_bw(camnoc->hf_path, 0, 0);
+	icc_set_bw(camnoc->cfg_path, 0, 0);
+
+	return ret;
+}
+
+static const struct dev_pm_ops qcom_cam_icc_pm_ops = {
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+	RUNTIME_PM_OPS(qcom_cam_icc_runtime_suspend, qcom_cam_icc_runtime_resume, NULL)
+};
+
+static const char * const qcom_cam_icc_pd_names[] = { "top" };
+
+static const struct dev_pm_domain_attach_data qcom_cam_icc_pd_data = {
+	.pd_names = qcom_cam_icc_pd_names,
+	.num_pd_names = ARRAY_SIZE(qcom_cam_icc_pd_names),
+	.pd_flags = PD_FLAG_DEV_LINK_ON,
+};
+
+static int qcom_cam_icc_pd_init(struct qcom_cam_icc *camnoc)
+{
+	int ret;
+
+	ret = devm_pm_domain_attach_list(camnoc->dev, &qcom_cam_icc_pd_data, &camnoc->pd_list);
+	if (ret < 0)
+		return ret;
+
+	ret = devm_pm_domain_attach_list(camnoc->dev, camnoc->data->rail_pd_data,
+					 &camnoc->rail_pd_list);
+	if (ret < 0)
+		return ret;
+
+	return 0;
+}
+
+static int qcom_cam_icc_config_clks(struct device *dev, struct opp_table *opp_table,
+				    struct dev_pm_opp *opp, void *data, bool scaling_down)
+{
+	struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
+
+	return clk_set_rate_range(camnoc->axi_src, dev_pm_opp_get_freq(opp), ULONG_MAX);
+}
+
+static int qcom_cam_icc_opp_init(struct qcom_cam_icc *camnoc)
+{
+	struct dev_pm_opp_config config = {
+		.clk_names = (const char *[]){ camnoc->data->rate_clk, NULL },
+		.config_clks = qcom_cam_icc_config_clks,
+	};
+	int ret;
+
+	ret = devm_pm_opp_set_config(camnoc->dev, &config);
+	if (ret)
+		return ret;
+
+	return devm_pm_opp_of_add_table(camnoc->dev);
+}
+
+static const struct of_device_id qcom_cam_icc_of_match[] = {
+	{ }
+};
+MODULE_DEVICE_TABLE(of, qcom_cam_icc_of_match);
+
+/**
+ * qcom_cam_icc_link() - link a camera NoC client to the camera NoC
+ * @client: client device with a camera NoC path in its "interconnects"
+ *
+ * Add a runtime PM device link from @client to the camera NoC, so that a
+ * runtime resume of @client resumes the camera NoC first.
+ *
+ * Return: 0 on success, -ENODEV if @client has no camera NoC path,
+ * -EPROBE_DEFER if the camera NoC driver is not bound yet, or another
+ * negative error code.
+ */
+int qcom_cam_icc_link(struct device *client)
+{
+	struct platform_device *pdev;
+	struct of_phandle_args args;
+	struct device_link *link;
+	int i;
+
+	for (i = 0; ; i++) {
+		if (of_parse_phandle_with_args(client->of_node, "interconnects",
+					       "#interconnect-cells", i, &args))
+			return -ENODEV;
+
+		if (of_match_node(qcom_cam_icc_of_match, args.np))
+			break;
+
+		of_node_put(args.np);
+	}
+
+	pdev = of_find_device_by_node(args.np);
+	of_node_put(args.np);
+	if (!pdev)
+		return -EPROBE_DEFER;
+
+	if (!platform_get_drvdata(pdev)) {
+		put_device(&pdev->dev);
+		return -EPROBE_DEFER;
+	}
+
+	link = device_link_add(client, &pdev->dev,
+			       DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER);
+	put_device(&pdev->dev);
+
+	return link ? 0 : -EINVAL;
+}
+EXPORT_SYMBOL_GPL(qcom_cam_icc_link);
+
+static int qcom_cam_icc_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct qcom_cam_icc *camnoc;
+	int ret;
+
+	camnoc = devm_kzalloc(dev, sizeof(*camnoc), GFP_KERNEL);
+	if (!camnoc)
+		return -ENOMEM;
+
+	camnoc->dev = dev;
+	camnoc->data = device_get_match_data(dev);
+	if (!camnoc->data)
+		return -EINVAL;
+
+	camnoc->base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(camnoc->base))
+		return PTR_ERR(camnoc->base);
+
+	camnoc->num_clks = devm_clk_bulk_get_all(dev, &camnoc->clks);
+	if (camnoc->num_clks < 0)
+		return dev_err_probe(dev, camnoc->num_clks, "failed to get clocks\n");
+
+	camnoc->axi_src = devm_clk_get(dev, camnoc->data->rate_clk);
+	if (IS_ERR(camnoc->axi_src))
+		return dev_err_probe(dev, PTR_ERR(camnoc->axi_src), "no %s clock\n",
+				     camnoc->data->rate_clk);
+
+	camnoc->ahb_src = devm_clk_get(dev, "slow_ahb_src");
+	if (IS_ERR(camnoc->ahb_src))
+		return dev_err_probe(dev, PTR_ERR(camnoc->ahb_src), "no slow_ahb_src clock\n");
+
+	camnoc->cfg_path = devm_of_icc_get(dev, "cfg");
+	if (IS_ERR(camnoc->cfg_path))
+		return dev_err_probe(dev, PTR_ERR(camnoc->cfg_path),
+				     "failed to get the cfg path\n");
+
+	camnoc->hf_path = devm_of_icc_get(dev, "hf");
+	if (IS_ERR(camnoc->hf_path))
+		return dev_err_probe(dev, PTR_ERR(camnoc->hf_path),
+				     "failed to get the hf path\n");
+
+	platform_set_drvdata(pdev, camnoc);
+
+	ret = qcom_cam_icc_pd_init(camnoc);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to attach the power domains\n");
+
+	ret = qcom_cam_icc_opp_init(camnoc);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to add the OPP table\n");
+
+	ret = devm_pm_runtime_enable(dev);
+	if (ret)
+		return ret;
+
+	ret = qcom_cam_icc_irq_request(pdev, camnoc);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to request the interrupt\n");
+
+	ret = qcom_cam_icc_icc_init(camnoc);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to register the interconnect provider\n");
+
+	return 0;
+}
+
+static void qcom_cam_icc_remove(struct platform_device *pdev)
+{
+	struct qcom_cam_icc *camnoc = platform_get_drvdata(pdev);
+
+	icc_provider_deregister(&camnoc->provider);
+	icc_nodes_remove(&camnoc->provider);
+}
+
+static struct platform_driver qcom_cam_icc_driver = {
+	.probe = qcom_cam_icc_probe,
+	.remove = qcom_cam_icc_remove,
+	.driver = {
+		.name = "qcom-cam-icc",
+		.of_match_table = qcom_cam_icc_of_match,
+		.pm = pm_ptr(&qcom_cam_icc_pm_ops),
+		.sync_state = icc_sync_state,
+	},
+};
+module_platform_driver(qcom_cam_icc_driver);
+
+MODULE_DESCRIPTION("Qualcomm Titan camera NoC core driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
new file mode 100644
index 000000000000..0de2aff3fe95
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
@@ -0,0 +1,142 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __QCOM_CAM_ICC_H__
+#define __QCOM_CAM_ICC_H__
+
+#include <linux/types.h>
+
+struct dev_pm_domain_attach_data;
+
+#define QCOM_CAM_ICC_MAX_LINKS		1
+
+#define QCOM_CAM_ICC_PRIORITYLUT_LOW	0x30
+#define QCOM_CAM_ICC_PRIORITYLUT_HIGH	0x34
+#define QCOM_CAM_ICC_URGENCY_LOW	0x38
+#define QCOM_CAM_ICC_DANGERLUT_LOW	0x40
+#define QCOM_CAM_ICC_SAFELUT_LOW	0x48
+#define QCOM_CAM_ICC_MAINCTL_LOW	0x08
+#define QCOM_CAM_ICC_SHAPING_LOW	0x20
+#define QCOM_CAM_ICC_SHAPING_HIGH	0x24
+#define QCOM_CAM_ICC_DECERRSTATUS_LOW	0x110
+#define QCOM_CAM_ICC_DECERRCLR_LOW	0x118
+#define QCOM_CAM_ICC_DECERREN_LOW	0x120
+#define QCOM_CAM_ICC_ENCCTL_LOW		0x188
+#define QCOM_CAM_ICC_ENCERRSTATUS_LOW	0x190
+#define QCOM_CAM_ICC_ENCERRCLR_LOW	0x198
+#define QCOM_CAM_ICC_ENCERREN_LOW	0x1a0
+
+enum qcom_cam_icc_merge {
+	QCOM_CAM_ICC_MERGE_SUM,
+	QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE,
+};
+
+struct qcom_cam_icc_node {
+	const char *name;
+	u16 id;
+	u16 num_links;
+	u16 links[QCOM_CAM_ICC_MAX_LINKS];
+	enum qcom_cam_icc_merge merge;
+	u8 width_factor;
+	bool rate_node;
+	const char *link_path;
+};
+
+struct qcom_cam_icc_ahb_level {
+	u32 cfg_kbps;
+	unsigned long slow_ahb_rate;
+};
+
+struct qcom_cam_icc_qos {
+	u32 offset;
+	u32 value;
+};
+
+struct qcom_cam_icc_sbm {
+	u32 enable_reg;
+	u32 status_reg;
+	u32 clear_reg;
+	u32 clear_val;
+};
+
+struct qcom_cam_icc_irq_err {
+	const char *name;
+	u32 sbm_mask;
+	u32 base;
+	u32 enable_off;
+	u32 enable_val;
+	u32 status_off;
+	u32 clear_off;
+};
+
+struct qcom_cam_icc_erl {
+	u32 base;
+	u32 sbm_mask;
+};
+
+struct qcom_cam_icc_data {
+	const char *rate_clk;
+	const struct qcom_cam_icc_node *nodes;
+	size_t num_nodes;
+	size_t num_ids;
+	const struct qcom_cam_icc_ahb_level *ahb_levels;
+	size_t num_ahb_levels;
+	u16 ahb_id;
+	const struct dev_pm_domain_attach_data *rail_pd_data;
+	const struct qcom_cam_icc_qos *qos;
+	size_t num_qos;
+	const struct qcom_cam_icc_sbm *sbm;
+	const struct qcom_cam_icc_irq_err *irq_errs;
+	size_t num_irq_errs;
+	const struct qcom_cam_icc_erl *erl;
+};
+
+#define CAMNOC_PORT(_id, _name, _link)			\
+	{						\
+		.name = _name,				\
+		.id = _id,				\
+		.num_links = 1,				\
+		.links = { _link },			\
+		.merge = QCOM_CAM_ICC_MERGE_SUM,	\
+		.width_factor = 1,			\
+		.rate_node = true,			\
+	}
+
+#define CAMNOC_INTERNAL(_id, _name, _link, _merge)	\
+	{						\
+		.name = _name,				\
+		.id = _id,				\
+		.num_links = 1,				\
+		.links = { _link },			\
+		.merge = _merge,			\
+		.width_factor = 1,			\
+		.rate_node = true,			\
+	}
+
+#define CAMNOC_LINK_SLAVE(_id, _name, _link_path)	\
+	{						\
+		.name = _name,				\
+		.id = _id,				\
+		.link_path = _link_path,		\
+	}
+
+#define CAMNOC_QOS(_base, _reg, _value)				\
+	{							\
+		.offset = (_base) + QCOM_CAM_ICC_##_reg,	\
+		.value = _value,				\
+	}
+
+#define CAMNOC_IRQ_ERR(_name, _mask, _base, _type, _enable_val)		\
+	{								\
+		.name = _name,						\
+		.sbm_mask = _mask,					\
+		.base = _base,						\
+		.enable_off = QCOM_CAM_ICC_##_type##ERREN_LOW,		\
+		.enable_val = _enable_val,				\
+		.status_off = QCOM_CAM_ICC_##_type##ERRSTATUS_LOW,	\
+		.clear_off = QCOM_CAM_ICC_##_type##ERRCLR_LOW,		\
+	}
+
+#endif
diff --git a/include/media/qcom-cam-icc.h b/include/media/qcom-cam-icc.h
new file mode 100644
index 000000000000..68c230687377
--- /dev/null
+++ b/include/media/qcom-cam-icc.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __MEDIA_QCOM_CAM_ICC_H__
+#define __MEDIA_QCOM_CAM_ICC_H__
+
+#include <linux/errno.h>
+
+struct device;
+
+#if IS_ENABLED(CONFIG_QCOM_CAM_ICC)
+
+int qcom_cam_icc_link(struct device *client);
+
+#else
+
+static inline int qcom_cam_icc_link(struct device *client)
+{
+	return -ENODEV;
+}
+
+#endif
+
+#endif
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 05/10] media: qcom: cam-icc: add the SM8250 data
  2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (3 preceding siblings ...)
  2026-11-30 10:49 ` [PATCH 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
@ 2026-11-30 10:49 ` Atanas Filipov
  2026-11-30 10:49 ` [PATCH 06/10] media: qcom: cam-icc: add the SC7280 data Atanas Filipov
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the SM8250 camera NoC nodes, AHB levels, MMCX rail, static QoS
settings and error interrupt sources. The port list, the AHB levels,
the rail levels and the QoS values are taken from the downstream camera
driver of this SoC.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 drivers/media/platform/qcom/cam-icc/Makefile  |   2 +-
 .../platform/qcom/cam-icc/qcom-cam-icc-core.c |   1 +
 .../platform/qcom/cam-icc/qcom-cam-icc-core.h |   2 +
 .../qcom/cam-icc/qcom-cam-icc-sm8250.c        | 136 ++++++++++++++++++
 4 files changed, 140 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c

diff --git a/drivers/media/platform/qcom/cam-icc/Makefile b/drivers/media/platform/qcom/cam-icc/Makefile
index 4d1cbf60fea0..aa2acbe56285 100644
--- a/drivers/media/platform/qcom/cam-icc/Makefile
+++ b/drivers/media/platform/qcom/cam-icc/Makefile
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-qcom-cam-icc-y := qcom-cam-icc-core.o
+qcom-cam-icc-y := qcom-cam-icc-core.o qcom-cam-icc-sm8250.o
 
 obj-$(CONFIG_QCOM_CAM_ICC) += qcom-cam-icc.o
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
index beb0ee0cad7a..0f49e8644de8 100644
--- a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
@@ -493,6 +493,7 @@ static int qcom_cam_icc_opp_init(struct qcom_cam_icc *camnoc)
 }
 
 static const struct of_device_id qcom_cam_icc_of_match[] = {
+	{ .compatible = "qcom,sm8250-cam-icc", .data = &qcom_cam_icc_sm8250_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, qcom_cam_icc_of_match);
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
index 0de2aff3fe95..0ab90d22a6fd 100644
--- a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
@@ -139,4 +139,6 @@ struct qcom_cam_icc_data {
 		.clear_off = QCOM_CAM_ICC_##_type##ERRCLR_LOW,		\
 	}
 
+extern const struct qcom_cam_icc_data qcom_cam_icc_sm8250_data;
+
 #endif
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c
new file mode 100644
index 000000000000..4a74fc71de67
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c
@@ -0,0 +1,136 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#include <linux/array_size.h>
+#include <linux/bits.h>
+#include <linux/pm_domain.h>
+
+#include <dt-bindings/interconnect/qcom,sm8250-cam-icc.h>
+
+#include "qcom-cam-icc-core.h"
+
+#define SM8250_CDM		0x0000
+#define SM8250_FD		0x0600
+#define SM8250_IFE_LINEAR	0x0a00
+#define SM8250_IFE_RDI_RD	0x1000
+#define SM8250_IFE_RDI_WR	0x1400
+#define SM8250_IFE_UBWC_STATS	0x1a00
+#define SM8250_IPE0_RD		0x1e00
+#define SM8250_IPE1_BPS_RD	0x2400
+#define SM8250_IPE_BPS_WR	0x2800
+#define SM8250_JPEG		0x2e00
+
+enum {
+	SM8250_CAMNOC_RT0_WR = SLAVE_CAMNOC_AHB + 1,
+	SM8250_CAMNOC_RT0_RD,
+	SM8250_CAMNOC_NRT0_WR,
+	SM8250_CAMNOC_NRT0_RD,
+	SM8250_CAMNOC_NUM_NODES,
+};
+
+static const struct qcom_cam_icc_node sm8250_nodes[] = {
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_LINEAR_WR, "camnoc_ife_linear_wr", SM8250_CAMNOC_RT0_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_RDI_WR, "camnoc_ife_rdi_wr", SM8250_CAMNOC_RT0_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_RDI_RD, "camnoc_ife_rdi_rd", SM8250_CAMNOC_RT0_RD),
+	CAMNOC_PORT(MASTER_CAMNOC_JPEG_WR, "camnoc_jpeg_wr", SM8250_CAMNOC_NRT0_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_JPEG_RD, "camnoc_jpeg_rd", SM8250_CAMNOC_NRT0_RD),
+	{
+		.name = "camnoc_ahb",
+		.id = MASTER_CAMNOC_AHB,
+		.num_links = 1,
+		.links = { SLAVE_CAMNOC_AHB },
+	},
+	CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_HF, "camnoc_hf", "hf"),
+	CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_SF, "camnoc_sf", "sf"),
+	CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_AHB, "camnoc_ahb_slv", "cfg"),
+	CAMNOC_INTERNAL(SM8250_CAMNOC_RT0_WR, "camnoc_rt0_wr", SLAVE_CAMNOC_HF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+	CAMNOC_INTERNAL(SM8250_CAMNOC_RT0_RD, "camnoc_rt0_rd", SLAVE_CAMNOC_HF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+	CAMNOC_INTERNAL(SM8250_CAMNOC_NRT0_WR, "camnoc_nrt0_wr", SLAVE_CAMNOC_SF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+	CAMNOC_INTERNAL(SM8250_CAMNOC_NRT0_RD, "camnoc_nrt0_rd", SLAVE_CAMNOC_SF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+};
+
+static const struct qcom_cam_icc_ahb_level sm8250_ahb_levels[] = {
+	{ .cfg_kbps = 76800,	.slow_ahb_rate = 80000000 },
+	{ .cfg_kbps = 150000,	.slow_ahb_rate = 80000000 },
+	{ .cfg_kbps = 300000,	.slow_ahb_rate = 80000000 },
+};
+
+static const char * const sm8250_rail_pd_names[] = { "mmcx" };
+
+static const struct dev_pm_domain_attach_data sm8250_rail_pd_data = {
+	.pd_names = sm8250_rail_pd_names,
+	.num_pd_names = ARRAY_SIZE(sm8250_rail_pd_names),
+	.pd_flags = PD_FLAG_REQUIRED_OPP,
+};
+
+static const struct qcom_cam_icc_qos sm8250_qos[] = {
+	CAMNOC_QOS(SM8250_CDM, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SM8250_FD, URGENCY_LOW, 0x33),
+	CAMNOC_QOS(SM8250_IFE_LINEAR, PRIORITYLUT_LOW, 0x66665433),
+	CAMNOC_QOS(SM8250_IFE_LINEAR, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SM8250_IFE_LINEAR, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SM8250_IFE_LINEAR, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SM8250_IFE_LINEAR, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SM8250_IFE_RDI_RD, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SM8250_IFE_RDI_RD, DANGERLUT_LOW, 0x0),
+	CAMNOC_QOS(SM8250_IFE_RDI_WR, PRIORITYLUT_LOW, 0x66665433),
+	CAMNOC_QOS(SM8250_IFE_RDI_WR, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SM8250_IFE_RDI_WR, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SM8250_IFE_RDI_WR, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SM8250_IFE_RDI_WR, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SM8250_IFE_UBWC_STATS, PRIORITYLUT_LOW, 0x66665433),
+	CAMNOC_QOS(SM8250_IFE_UBWC_STATS, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SM8250_IFE_UBWC_STATS, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SM8250_IFE_UBWC_STATS, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SM8250_IFE_UBWC_STATS, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SM8250_IPE0_RD, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SM8250_IPE1_BPS_RD, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SM8250_IPE_BPS_WR, PRIORITYLUT_LOW, 0x33333333),
+	CAMNOC_QOS(SM8250_IPE_BPS_WR, PRIORITYLUT_HIGH, 0x33333333),
+	CAMNOC_QOS(SM8250_IPE_BPS_WR, URGENCY_LOW, 0x30),
+	CAMNOC_QOS(SM8250_JPEG, PRIORITYLUT_LOW, 0x22222222),
+	CAMNOC_QOS(SM8250_JPEG, PRIORITYLUT_HIGH, 0x22222222),
+	CAMNOC_QOS(SM8250_JPEG, URGENCY_LOW, 0x22),
+};
+
+static const struct qcom_cam_icc_sbm sm8250_sbm = {
+	.enable_reg = 0x3840,
+	.status_reg = 0x3848,
+	.clear_reg = 0x3880,
+	.clear_val = 0x1,
+};
+
+static const struct qcom_cam_icc_irq_err sm8250_irq_errs[] = {
+	CAMNOC_IRQ_ERR("ife_ubwc_stats encode", BIT(1), SM8250_IFE_UBWC_STATS, ENC, 1),
+	CAMNOC_IRQ_ERR("ipe1_bps_rd decode", BIT(2), SM8250_IPE1_BPS_RD, DEC, 1),
+	CAMNOC_IRQ_ERR("ipe0_rd decode", BIT(3), SM8250_IPE0_RD, DEC, 1),
+	CAMNOC_IRQ_ERR("ipe_bps_wr encode", BIT(4), SM8250_IPE_BPS_WR, ENC, 1),
+};
+
+static const struct qcom_cam_icc_erl sm8250_erl = {
+	.base = 0x7000,
+	.sbm_mask = BIT(0),
+};
+
+const struct qcom_cam_icc_data qcom_cam_icc_sm8250_data = {
+	.rate_clk	= "camnoc_axi",
+	.nodes		= sm8250_nodes,
+	.num_nodes	= ARRAY_SIZE(sm8250_nodes),
+	.num_ids	= SM8250_CAMNOC_NUM_NODES,
+	.ahb_levels	= sm8250_ahb_levels,
+	.num_ahb_levels	= ARRAY_SIZE(sm8250_ahb_levels),
+	.ahb_id		= SLAVE_CAMNOC_AHB,
+	.rail_pd_data	= &sm8250_rail_pd_data,
+	.qos		= sm8250_qos,
+	.num_qos	= ARRAY_SIZE(sm8250_qos),
+	.sbm		= &sm8250_sbm,
+	.irq_errs	= sm8250_irq_errs,
+	.num_irq_errs	= ARRAY_SIZE(sm8250_irq_errs),
+	.erl		= &sm8250_erl,
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 06/10] media: qcom: cam-icc: add the SC7280 data
  2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (4 preceding siblings ...)
  2026-11-30 10:49 ` [PATCH 05/10] media: qcom: cam-icc: add the SM8250 data Atanas Filipov
@ 2026-11-30 10:49 ` Atanas Filipov
  2026-11-30 10:49 ` [PATCH 07/10] media: qcom: cam-icc: add the SA8775P data Atanas Filipov
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the SC7280 camera NoC nodes, AHB levels, CX rail, static QoS
settings and error interrupt sources. The port list, the AHB levels,
the rail levels and the QoS values are taken from the downstream camera
driver of this SoC (Titan 165 camera NoC).

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 drivers/media/platform/qcom/cam-icc/Makefile  |   2 +-
 .../platform/qcom/cam-icc/qcom-cam-icc-core.c |   1 +
 .../platform/qcom/cam-icc/qcom-cam-icc-core.h |   1 +
 .../qcom/cam-icc/qcom-cam-icc-sc7280.c        | 143 ++++++++++++++++++
 4 files changed, 146 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c

diff --git a/drivers/media/platform/qcom/cam-icc/Makefile b/drivers/media/platform/qcom/cam-icc/Makefile
index aa2acbe56285..346abef8c51c 100644
--- a/drivers/media/platform/qcom/cam-icc/Makefile
+++ b/drivers/media/platform/qcom/cam-icc/Makefile
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-qcom-cam-icc-y := qcom-cam-icc-core.o qcom-cam-icc-sm8250.o
+qcom-cam-icc-y := qcom-cam-icc-core.o qcom-cam-icc-sc7280.o qcom-cam-icc-sm8250.o
 
 obj-$(CONFIG_QCOM_CAM_ICC) += qcom-cam-icc.o
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
index 0f49e8644de8..c57ad7c4427e 100644
--- a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
@@ -493,6 +493,7 @@ static int qcom_cam_icc_opp_init(struct qcom_cam_icc *camnoc)
 }
 
 static const struct of_device_id qcom_cam_icc_of_match[] = {
+	{ .compatible = "qcom,sc7280-cam-icc", .data = &qcom_cam_icc_sc7280_data },
 	{ .compatible = "qcom,sm8250-cam-icc", .data = &qcom_cam_icc_sm8250_data },
 	{ }
 };
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
index 0ab90d22a6fd..9cb665d31d95 100644
--- a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
@@ -139,6 +139,7 @@ struct qcom_cam_icc_data {
 		.clear_off = QCOM_CAM_ICC_##_type##ERRCLR_LOW,		\
 	}
 
+extern const struct qcom_cam_icc_data qcom_cam_icc_sc7280_data;
 extern const struct qcom_cam_icc_data qcom_cam_icc_sm8250_data;
 
 #endif
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c
new file mode 100644
index 000000000000..4bee299bd15c
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c
@@ -0,0 +1,143 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#include <linux/array_size.h>
+#include <linux/bits.h>
+#include <linux/pm_domain.h>
+
+#include <dt-bindings/interconnect/qcom,sc7280-cam-icc.h>
+
+#include "qcom-cam-icc-core.h"
+
+#define SC7280_NRT_NIU_2		0x2600
+#define SC7280_NRT_NIU_1		0x2a00
+#define SC7280_NRT_NIU_0		0x2e00
+#define SC7280_IFE_NIU_2		0x3600
+#define SC7280_IFE_NIU_0		0x3a00
+#define SC7280_CDM_NIU			0x4200
+#define SC7280_IFE_NIU_0_QOSGEN		0x4700
+#define SC7280_IFE_NIU_2_QOSGEN		0x4800
+#define SC7280_ERL			0x4f00
+#define SC7280_IFE_NIU_1_QOSGEN		0x5180
+#define SC7280_IFE_NIU_1		0x5400
+
+enum {
+	SC7280_CAMNOC_RT0_WR = SLAVE_CAMNOC_AHB + 1,
+	SC7280_CAMNOC_RT1_WR,
+	SC7280_CAMNOC_NRT0_WR,
+	SC7280_CAMNOC_NRT0_RD,
+	SC7280_CAMNOC_NUM_NODES,
+};
+
+static const struct qcom_cam_icc_node sc7280_nodes[] = {
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_RDI_WR, "camnoc_ife_rdi_wr", SC7280_CAMNOC_RT0_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_PIXEL_WR, "camnoc_ife_pixel_wr", SC7280_CAMNOC_RT1_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_IFE2_PIXEL_WR, "camnoc_ife2_pixel_wr", SC7280_CAMNOC_RT1_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_JPEG_WR, "camnoc_jpeg_wr", SC7280_CAMNOC_NRT0_WR),
+	CAMNOC_PORT(MASTER_CAMNOC_JPEG_RD, "camnoc_jpeg_rd", SC7280_CAMNOC_NRT0_RD),
+	{
+		.name = "camnoc_ahb",
+		.id = MASTER_CAMNOC_AHB,
+		.num_links = 1,
+		.links = { SLAVE_CAMNOC_AHB },
+	},
+	CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_HF, "camnoc_hf", "hf"),
+	CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_SF, "camnoc_sf", "sf"),
+	CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_AHB, "camnoc_ahb_slv", "cfg"),
+	CAMNOC_INTERNAL(SC7280_CAMNOC_RT0_WR, "camnoc_rt0_wr", SLAVE_CAMNOC_HF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+	CAMNOC_INTERNAL(SC7280_CAMNOC_RT1_WR, "camnoc_rt1_wr", SLAVE_CAMNOC_HF,
+			QCOM_CAM_ICC_MERGE_SUM_INTERLEAVE),
+	CAMNOC_INTERNAL(SC7280_CAMNOC_NRT0_WR, "camnoc_nrt0_wr", SLAVE_CAMNOC_SF,
+			QCOM_CAM_ICC_MERGE_SUM),
+	CAMNOC_INTERNAL(SC7280_CAMNOC_NRT0_RD, "camnoc_nrt0_rd", SLAVE_CAMNOC_SF,
+			QCOM_CAM_ICC_MERGE_SUM),
+};
+
+static const struct qcom_cam_icc_ahb_level sc7280_ahb_levels[] = {
+	{ .cfg_kbps = 76800,	.slow_ahb_rate = 80000000 },
+	{ .cfg_kbps = 150000,	.slow_ahb_rate = 80000000 },
+	{ .cfg_kbps = 300000,	.slow_ahb_rate = 80000000 },
+};
+
+static const char * const sc7280_rail_pd_names[] = { "cx" };
+
+static const struct dev_pm_domain_attach_data sc7280_rail_pd_data = {
+	.pd_names = sc7280_rail_pd_names,
+	.num_pd_names = ARRAY_SIZE(sc7280_rail_pd_names),
+	.pd_flags = PD_FLAG_REQUIRED_OPP,
+};
+
+static const struct qcom_cam_icc_qos sc7280_qos[] = {
+	CAMNOC_QOS(SC7280_CDM_NIU, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SC7280_IFE_NIU_2, PRIORITYLUT_LOW, 0x55554433),
+	CAMNOC_QOS(SC7280_IFE_NIU_2, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SC7280_IFE_NIU_2, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SC7280_IFE_NIU_2, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SC7280_IFE_NIU_2, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SC7280_IFE_NIU_2_QOSGEN, MAINCTL_LOW, 0x2),
+	CAMNOC_QOS(SC7280_IFE_NIU_2_QOSGEN, SHAPING_LOW, 0x07070707),
+	CAMNOC_QOS(SC7280_IFE_NIU_2_QOSGEN, SHAPING_HIGH, 0x07070707),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, PRIORITYLUT_LOW, 0x55554433),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SC7280_IFE_NIU_0, ENCCTL_LOW, 0x1),
+	CAMNOC_QOS(SC7280_IFE_NIU_0_QOSGEN, MAINCTL_LOW, 0x2),
+	CAMNOC_QOS(SC7280_IFE_NIU_0_QOSGEN, SHAPING_LOW, 0x07070707),
+	CAMNOC_QOS(SC7280_IFE_NIU_0_QOSGEN, SHAPING_HIGH, 0x07070707),
+	CAMNOC_QOS(SC7280_IFE_NIU_1, PRIORITYLUT_LOW, 0x55554433),
+	CAMNOC_QOS(SC7280_IFE_NIU_1, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SC7280_IFE_NIU_1, URGENCY_LOW, 0x1030),
+	CAMNOC_QOS(SC7280_IFE_NIU_1, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SC7280_IFE_NIU_1, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SC7280_IFE_NIU_1_QOSGEN, MAINCTL_LOW, 0x2),
+	CAMNOC_QOS(SC7280_IFE_NIU_1_QOSGEN, SHAPING_LOW, 0x07070707),
+	CAMNOC_QOS(SC7280_IFE_NIU_1_QOSGEN, SHAPING_HIGH, 0x07070707),
+	CAMNOC_QOS(SC7280_NRT_NIU_0, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SC7280_NRT_NIU_1, PRIORITYLUT_LOW, 0x33333333),
+	CAMNOC_QOS(SC7280_NRT_NIU_1, PRIORITYLUT_HIGH, 0x33333333),
+	CAMNOC_QOS(SC7280_NRT_NIU_1, URGENCY_LOW, 0x30),
+	CAMNOC_QOS(SC7280_NRT_NIU_2, PRIORITYLUT_LOW, 0x22222222),
+	CAMNOC_QOS(SC7280_NRT_NIU_2, PRIORITYLUT_HIGH, 0x22222222),
+	CAMNOC_QOS(SC7280_NRT_NIU_2, URGENCY_LOW, 0x22),
+};
+
+static const struct qcom_cam_icc_sbm sc7280_sbm = {
+	.enable_reg = 0x2240,
+	.status_reg = 0x2248,
+	.clear_reg = 0x2280,
+	.clear_val = 0x2,
+};
+
+static const struct qcom_cam_icc_irq_err sc7280_irq_errs[] = {
+	CAMNOC_IRQ_ERR("ife_niu_0 encode", BIT(1), SC7280_IFE_NIU_0, ENC, 1),
+	CAMNOC_IRQ_ERR("ife_niu_1 encode", BIT(2), SC7280_IFE_NIU_1, ENC, 1),
+	CAMNOC_IRQ_ERR("nrt_niu_0 decode", BIT(3), SC7280_NRT_NIU_0, DEC, 1),
+	CAMNOC_IRQ_ERR("nrt_niu_1 encode", BIT(4), SC7280_NRT_NIU_1, ENC, 1),
+};
+
+static const struct qcom_cam_icc_erl sc7280_erl = {
+	.base = SC7280_ERL,
+	.sbm_mask = BIT(0),
+};
+
+const struct qcom_cam_icc_data qcom_cam_icc_sc7280_data = {
+	.rate_clk	= "camnoc_axi_src",
+	.nodes		= sc7280_nodes,
+	.num_nodes	= ARRAY_SIZE(sc7280_nodes),
+	.num_ids	= SC7280_CAMNOC_NUM_NODES,
+	.ahb_levels	= sc7280_ahb_levels,
+	.num_ahb_levels	= ARRAY_SIZE(sc7280_ahb_levels),
+	.ahb_id		= SLAVE_CAMNOC_AHB,
+	.rail_pd_data	= &sc7280_rail_pd_data,
+	.qos		= sc7280_qos,
+	.num_qos	= ARRAY_SIZE(sc7280_qos),
+	.sbm		= &sc7280_sbm,
+	.irq_errs	= sc7280_irq_errs,
+	.num_irq_errs	= ARRAY_SIZE(sc7280_irq_errs),
+	.erl		= &sc7280_erl,
+};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 07/10] media: qcom: cam-icc: add the SA8775P data
  2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (5 preceding siblings ...)
  2026-11-30 10:49 ` [PATCH 06/10] media: qcom: cam-icc: add the SC7280 data Atanas Filipov
@ 2026-11-30 10:49 ` Atanas Filipov
  2026-11-30 10:49 ` [PATCH 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node Atanas Filipov
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the SA8775P camera NoC nodes, AHB levels, MMCX and MXC rails,
static QoS settings and error interrupt sources. The port list, the AHB
levels, the rail levels and the QoS values are taken from the
downstream camera driver of this SoC. The camera NoC rate is set on the
fast AHB clock source.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 drivers/media/platform/qcom/cam-icc/Makefile  |   3 +-
 .../platform/qcom/cam-icc/qcom-cam-icc-core.c |  15 +--
 .../platform/qcom/cam-icc/qcom-cam-icc-core.h |   3 +-
 .../qcom/cam-icc/qcom-cam-icc-sa8775p.c       | 116 ++++++++++++++++++
 .../qcom/cam-icc/qcom-cam-icc-sc7280.c        |   4 +-
 .../qcom/cam-icc/qcom-cam-icc-sm8250.c        |   4 +-
 6 files changed, 132 insertions(+), 13 deletions(-)
 create mode 100644 drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c

diff --git a/drivers/media/platform/qcom/cam-icc/Makefile b/drivers/media/platform/qcom/cam-icc/Makefile
index 346abef8c51c..60d714bfce57 100644
--- a/drivers/media/platform/qcom/cam-icc/Makefile
+++ b/drivers/media/platform/qcom/cam-icc/Makefile
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
-qcom-cam-icc-y := qcom-cam-icc-core.o qcom-cam-icc-sc7280.o qcom-cam-icc-sm8250.o
+qcom-cam-icc-y := qcom-cam-icc-core.o qcom-cam-icc-sa8775p.o qcom-cam-icc-sc7280.o \
+		  qcom-cam-icc-sm8250.o
 
 obj-$(CONFIG_QCOM_CAM_ICC) += qcom-cam-icc.o
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
index c57ad7c4427e..ad065c6038b7 100644
--- a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
@@ -321,10 +321,10 @@ static void qcom_cam_icc_irq_init(struct qcom_cam_icc *camnoc)
 		writel(err->enable_val, camnoc->base + err->base + err->enable_off);
 	}
 
-	if (data->erl) {
-		writel(1, camnoc->base + data->erl->base + QCOM_CAM_ICC_ERL_ERRCLR);
+	if (data->err_logger) {
+		writel(1, camnoc->base + data->err_logger->base + QCOM_CAM_ICC_ERL_ERRCLR);
 		writel(QCOM_CAM_ICC_ERL_MAINCTL_STALL_EN | QCOM_CAM_ICC_ERL_MAINCTL_FAULT_EN,
-		       camnoc->base + data->erl->base + QCOM_CAM_ICC_ERL_MAINCTL);
+		       camnoc->base + data->err_logger->base + QCOM_CAM_ICC_ERL_MAINCTL);
 	}
 
 	writel(camnoc->irq_mask, camnoc->base + data->sbm->enable_reg);
@@ -332,7 +332,7 @@ static void qcom_cam_icc_irq_init(struct qcom_cam_icc *camnoc)
 
 static void qcom_cam_icc_erl_handle(struct qcom_cam_icc *camnoc)
 {
-	void __iomem *erl = camnoc->base + camnoc->data->erl->base;
+	void __iomem *erl = camnoc->base + camnoc->data->err_logger->base;
 	u32 log0 = readl(erl + QCOM_CAM_ICC_ERL_ERRLOG0);
 
 	dev_err_ratelimited(camnoc->dev, "slave error, code %lu, errlog0 %#x, errlog1 %#x\n",
@@ -362,7 +362,7 @@ static irqreturn_t qcom_cam_icc_irq(int irq, void *dev_id)
 	writel(enable & ~pending, camnoc->base + data->sbm->enable_reg);
 	writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
 
-	if (data->erl && (pending & data->erl->sbm_mask))
+	if (data->err_logger && (pending & data->err_logger->sbm_mask))
 		qcom_cam_icc_erl_handle(camnoc);
 
 	for (i = 0; i < data->num_irq_errs; i++) {
@@ -390,8 +390,8 @@ static int qcom_cam_icc_irq_request(struct platform_device *pdev, struct qcom_ca
 	for (i = 0; i < data->num_irq_errs; i++)
 		camnoc->irq_mask |= data->irq_errs[i].sbm_mask;
 
-	if (data->erl)
-		camnoc->irq_mask |= data->erl->sbm_mask;
+	if (data->err_logger)
+		camnoc->irq_mask |= data->err_logger->sbm_mask;
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
@@ -493,6 +493,7 @@ static int qcom_cam_icc_opp_init(struct qcom_cam_icc *camnoc)
 }
 
 static const struct of_device_id qcom_cam_icc_of_match[] = {
+	{ .compatible = "qcom,sa8775p-cam-icc", .data = &qcom_cam_icc_sa8775p_data },
 	{ .compatible = "qcom,sc7280-cam-icc", .data = &qcom_cam_icc_sc7280_data },
 	{ .compatible = "qcom,sm8250-cam-icc", .data = &qcom_cam_icc_sm8250_data },
 	{ }
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
index 9cb665d31d95..c79749fe8daa 100644
--- a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
@@ -90,7 +90,7 @@ struct qcom_cam_icc_data {
 	const struct qcom_cam_icc_sbm *sbm;
 	const struct qcom_cam_icc_irq_err *irq_errs;
 	size_t num_irq_errs;
-	const struct qcom_cam_icc_erl *erl;
+	const struct qcom_cam_icc_erl *err_logger;
 };
 
 #define CAMNOC_PORT(_id, _name, _link)			\
@@ -139,6 +139,7 @@ struct qcom_cam_icc_data {
 		.clear_off = QCOM_CAM_ICC_##_type##ERRCLR_LOW,		\
 	}
 
+extern const struct qcom_cam_icc_data qcom_cam_icc_sa8775p_data;
 extern const struct qcom_cam_icc_data qcom_cam_icc_sc7280_data;
 extern const struct qcom_cam_icc_data qcom_cam_icc_sm8250_data;
 
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c
new file mode 100644
index 000000000000..ae646298c5d9
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c
@@ -0,0 +1,116 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#include <linux/array_size.h>
+#include <linux/bits.h>
+#include <linux/pm_domain.h>
+
+#include <dt-bindings/interconnect/qcom,sa8775p-cam-icc.h>
+
+#include "qcom-cam-icc-core.h"
+
+#define SA8775P_RT0		0x6200
+#define SA8775P_RT1		0x6400
+#define SA8775P_RT2		0x6600
+#define SA8775P_NRT0		0x5c00
+#define SA8775P_NRT1		0x5e00
+#define SA8775P_NRT2		0x6000
+
+enum {
+	SA8775P_CAMNOC_RT_WR0 = SLAVE_CAMNOC_AHB + 1,
+	SA8775P_CAMNOC_RT_WR1,
+	SA8775P_CAMNOC_NUM_NODES,
+};
+
+static const struct qcom_cam_icc_node sa8775p_nodes[] = {
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_RT_WR0, "camnoc_ife_rt_wr0", SA8775P_CAMNOC_RT_WR0),
+	CAMNOC_PORT(MASTER_CAMNOC_IFE_RT_WR1, "camnoc_ife_rt_wr1", SA8775P_CAMNOC_RT_WR1),
+	{
+		.name	= "camnoc_ahb",
+		.id = MASTER_CAMNOC_AHB,
+		.num_links = 1,
+		.links = { SLAVE_CAMNOC_AHB },
+	},
+	CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_HF, "camnoc_hf", "hf"),
+	CAMNOC_LINK_SLAVE(SLAVE_CAMNOC_AHB, "camnoc_ahb_slv", "cfg"),
+	CAMNOC_INTERNAL(SA8775P_CAMNOC_RT_WR0, "camnoc_rt_wr0", SLAVE_CAMNOC_HF,
+			QCOM_CAM_ICC_MERGE_SUM),
+	CAMNOC_INTERNAL(SA8775P_CAMNOC_RT_WR1, "camnoc_rt_wr1", SLAVE_CAMNOC_HF,
+			QCOM_CAM_ICC_MERGE_SUM),
+};
+
+static const struct qcom_cam_icc_ahb_level sa8775p_ahb_levels[] = {
+	{ .cfg_kbps = 76800,	.slow_ahb_rate = 80000000 },
+	{ .cfg_kbps = 150000,	.slow_ahb_rate = 80000000 },
+	{ .cfg_kbps = 300000,	.slow_ahb_rate = 80000000 },
+};
+
+static const char * const sa8775p_rail_pd_names[] = { "mmcx", "mxc" };
+
+static const struct dev_pm_domain_attach_data sa8775p_rail_pd_data = {
+	.pd_names = sa8775p_rail_pd_names,
+	.num_pd_names = ARRAY_SIZE(sa8775p_rail_pd_names),
+	.pd_flags = PD_FLAG_REQUIRED_OPP,
+};
+
+static const struct qcom_cam_icc_qos sa8775p_qos[] = {
+	CAMNOC_QOS(SA8775P_RT0, PRIORITYLUT_LOW, 0x0),
+	CAMNOC_QOS(SA8775P_RT0, PRIORITYLUT_HIGH, 0x0),
+	CAMNOC_QOS(SA8775P_RT0, URGENCY_LOW, 0x1003),
+	CAMNOC_QOS(SA8775P_RT0, DANGERLUT_LOW, 0x0),
+	CAMNOC_QOS(SA8775P_RT0, SAFELUT_LOW, 0xffff),
+	CAMNOC_QOS(SA8775P_RT1, PRIORITYLUT_LOW, 0x66665433),
+	CAMNOC_QOS(SA8775P_RT1, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SA8775P_RT1, URGENCY_LOW, 0x1b30),
+	CAMNOC_QOS(SA8775P_RT1, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SA8775P_RT1, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SA8775P_RT2, PRIORITYLUT_LOW, 0x66665433),
+	CAMNOC_QOS(SA8775P_RT2, PRIORITYLUT_HIGH, 0x66666666),
+	CAMNOC_QOS(SA8775P_RT2, URGENCY_LOW, 0x1b30),
+	CAMNOC_QOS(SA8775P_RT2, DANGERLUT_LOW, 0xffffff00),
+	CAMNOC_QOS(SA8775P_RT2, SAFELUT_LOW, 0xf),
+	CAMNOC_QOS(SA8775P_NRT0, PRIORITYLUT_LOW, 0x0),
+	CAMNOC_QOS(SA8775P_NRT0, PRIORITYLUT_HIGH, 0x0),
+	CAMNOC_QOS(SA8775P_NRT0, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SA8775P_NRT1, PRIORITYLUT_LOW, 0x0),
+	CAMNOC_QOS(SA8775P_NRT1, PRIORITYLUT_HIGH, 0x0),
+	CAMNOC_QOS(SA8775P_NRT1, URGENCY_LOW, 0x3),
+	CAMNOC_QOS(SA8775P_NRT2, PRIORITYLUT_LOW, 0x33333333),
+	CAMNOC_QOS(SA8775P_NRT2, PRIORITYLUT_HIGH, 0x33333333),
+	CAMNOC_QOS(SA8775P_NRT2, URGENCY_LOW, 0x30),
+};
+
+static const struct qcom_cam_icc_sbm sa8775p_sbm = {
+	.enable_reg = 0x240,
+	.status_reg = 0x248,
+	.clear_reg = 0x280,
+	.clear_val = 0x1,
+};
+
+static const struct qcom_cam_icc_irq_err sa8775p_irq_errs[] = {
+	CAMNOC_IRQ_ERR("nrt1 decode", BIT(2), SA8775P_NRT1, DEC, 0xff),
+};
+
+static const struct qcom_cam_icc_erl sa8775p_err_log = {
+	.base = 0x0000,
+	.sbm_mask = BIT(0),
+};
+
+const struct qcom_cam_icc_data qcom_cam_icc_sa8775p_data = {
+	.rate_clk	= "fast_ahb_src",
+	.nodes		= sa8775p_nodes,
+	.num_nodes	= ARRAY_SIZE(sa8775p_nodes),
+	.num_ids	= SA8775P_CAMNOC_NUM_NODES,
+	.ahb_levels	= sa8775p_ahb_levels,
+	.num_ahb_levels	= ARRAY_SIZE(sa8775p_ahb_levels),
+	.ahb_id		= SLAVE_CAMNOC_AHB,
+	.rail_pd_data	= &sa8775p_rail_pd_data,
+	.qos		= sa8775p_qos,
+	.num_qos	= ARRAY_SIZE(sa8775p_qos),
+	.sbm		= &sa8775p_sbm,
+	.irq_errs	= sa8775p_irq_errs,
+	.num_irq_errs	= ARRAY_SIZE(sa8775p_irq_errs),
+	.err_logger	= &sa8775p_err_log,
+};
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c
index 4bee299bd15c..a23349d64722 100644
--- a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c
@@ -120,7 +120,7 @@ static const struct qcom_cam_icc_irq_err sc7280_irq_errs[] = {
 	CAMNOC_IRQ_ERR("nrt_niu_1 encode", BIT(4), SC7280_NRT_NIU_1, ENC, 1),
 };
 
-static const struct qcom_cam_icc_erl sc7280_erl = {
+static const struct qcom_cam_icc_erl sc7280_err_log = {
 	.base = SC7280_ERL,
 	.sbm_mask = BIT(0),
 };
@@ -139,5 +139,5 @@ const struct qcom_cam_icc_data qcom_cam_icc_sc7280_data = {
 	.sbm		= &sc7280_sbm,
 	.irq_errs	= sc7280_irq_errs,
 	.num_irq_errs	= ARRAY_SIZE(sc7280_irq_errs),
-	.erl		= &sc7280_erl,
+	.err_logger	= &sc7280_err_log,
 };
diff --git a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c
index 4a74fc71de67..c69bb387aa93 100644
--- a/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c
@@ -113,7 +113,7 @@ static const struct qcom_cam_icc_irq_err sm8250_irq_errs[] = {
 	CAMNOC_IRQ_ERR("ipe_bps_wr encode", BIT(4), SM8250_IPE_BPS_WR, ENC, 1),
 };
 
-static const struct qcom_cam_icc_erl sm8250_erl = {
+static const struct qcom_cam_icc_erl sm8250_err_log = {
 	.base = 0x7000,
 	.sbm_mask = BIT(0),
 };
@@ -132,5 +132,5 @@ const struct qcom_cam_icc_data qcom_cam_icc_sm8250_data = {
 	.sbm		= &sm8250_sbm,
 	.irq_errs	= sm8250_irq_errs,
 	.num_irq_errs	= ARRAY_SIZE(sm8250_irq_errs),
-	.erl		= &sm8250_erl,
+	.err_logger	= &sm8250_err_log,
 };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node
  2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (6 preceding siblings ...)
  2026-11-30 10:49 ` [PATCH 07/10] media: qcom: cam-icc: add the SA8775P data Atanas Filipov
@ 2026-11-30 10:49 ` Atanas Filipov
  2026-11-30 10:49 ` [PATCH 09/10] arm64: dts: qcom: sc7280: " Atanas Filipov
  2026-11-30 10:49 ` [PATCH 10/10] arm64: dts: qcom: sa8775p: " Atanas Filipov
  9 siblings, 0 replies; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the Titan camera NoC node. It registers the camera NoC
interconnect provider, so the camera clients can vote bandwidth on
their camera NoC ports and on the camera AHB node.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/sm8250.dtsi | 49 ++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index 992284e64d38..798aaa39eb33 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -4407,6 +4407,55 @@ videocc: clock-controller@abf0000 {
 			#power-domain-cells = <1>;
 		};
 
+		camnoc: interconnect@ac42000 {
+			compatible = "qcom,sm8250-cam-icc";
+			reg = <0 0x0ac42000 0 0x8000>;
+
+			interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+			clocks = <&gcc GCC_CAMERA_AHB_CLK>,
+				 <&gcc GCC_CAMERA_HF_AXI_CLK>,
+				 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+				 <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+				 <&camcc CAM_CC_CPAS_AHB_CLK>,
+				 <&camcc CAM_CC_CORE_AHB_CLK>,
+				 <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+			clock-names = "iface",
+				      "gcc_axi_hf",
+				      "gcc_axi_sf",
+				      "slow_ahb_src",
+				      "cpas_ahb",
+				      "core_ahb",
+				      "camnoc_axi";
+
+			power-domains = <&camcc TITAN_TOP_GDSC>,
+					<&rpmhpd RPMHPD_MMCX>;
+			power-domain-names = "top", "mmcx";
+
+			operating-points-v2 = <&camnoc_opp_table>;
+
+			interconnects = <&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_CAMERA_CFG 0>,
+					<&mmss_noc MASTER_CAMNOC_HF 0 &mc_virt SLAVE_EBI_CH0 0>,
+					<&mmss_noc MASTER_CAMNOC_SF 0 &mc_virt SLAVE_EBI_CH0 0>;
+			interconnect-names = "cfg", "hf", "sf";
+
+			#interconnect-cells = <2>;
+
+			camnoc_opp_table: opp-table {
+				compatible = "operating-points-v2";
+
+				opp-300000000 {
+					opp-hz = /bits/ 64 <300000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+				};
+
+				opp-400000000 {
+					opp-hz = /bits/ 64 <400000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+				};
+			};
+		};
+
 		cci0: cci@ac4f000 {
 			compatible = "qcom,sm8250-cci", "qcom,msm8996-cci";
 			#address-cells = <1>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 09/10] arm64: dts: qcom: sc7280: add the Titan camera NoC node
  2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (7 preceding siblings ...)
  2026-11-30 10:49 ` [PATCH 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node Atanas Filipov
@ 2026-11-30 10:49 ` Atanas Filipov
  2026-11-30 10:49 ` [PATCH 10/10] arm64: dts: qcom: sa8775p: " Atanas Filipov
  9 siblings, 0 replies; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the Titan camera NoC node. It registers the camera NoC
interconnect provider, so the camera clients can vote bandwidth on
their camera NoC ports and on the camera AHB node.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/kodiak.dtsi | 62 ++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi
index 10e9a5279ed6..5c4f8c7d1540 100644
--- a/arch/arm64/boot/dts/qcom/kodiak.dtsi
+++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi
@@ -5179,6 +5179,68 @@ cci1_i2c1: i2c-bus@1 {
 			};
 		};
 
+		camnoc: interconnect@ac9f000 {
+			compatible = "qcom,sc7280-cam-icc";
+			reg = <0 0x0ac9f000 0 0x10000>;
+
+			interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+			clocks = <&gcc GCC_CAMERA_HF_AXI_CLK>,
+				 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+				 <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+				 <&camcc CAM_CC_CPAS_AHB_CLK>,
+				 <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+				 <&camcc CAM_CC_CAMNOC_AXI_CLK_SRC>;
+			clock-names = "gcc_axi_hf",
+				      "gcc_axi_sf",
+				      "slow_ahb_src",
+				      "cpas_ahb",
+				      "camnoc_axi",
+				      "camnoc_axi_src";
+
+			power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>,
+					<&rpmhpd SC7280_CX>;
+			power-domain-names = "top", "cx";
+
+			operating-points-v2 = <&camnoc_opp_table>;
+
+			interconnects = <&gem_noc MASTER_APPSS_PROC 0 &cnoc2 SLAVE_CAMERA_CFG 0>,
+					<&mmss_noc MASTER_CAMNOC_HF 0 &mc_virt SLAVE_EBI1 0>,
+					<&mmss_noc MASTER_CAMNOC_SF 0 &mc_virt SLAVE_EBI1 0>;
+			interconnect-names = "cfg", "hf", "sf";
+
+			#interconnect-cells = <2>;
+
+			camnoc_opp_table: opp-table {
+				compatible = "operating-points-v2";
+
+				opp-150000000 {
+					opp-hz = /bits/ 64 <150000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+				};
+
+				opp-240000000 {
+					opp-hz = /bits/ 64 <240000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+				};
+
+				opp-320000000 {
+					opp-hz = /bits/ 64 <320000000>;
+					required-opps = <&rpmhpd_opp_svs_l1>;
+				};
+
+				opp-400000000 {
+					opp-hz = /bits/ 64 <400000000>;
+					required-opps = <&rpmhpd_opp_nom>;
+				};
+
+				opp-480000000 {
+					opp-hz = /bits/ 64 <480000000>;
+					required-opps = <&rpmhpd_opp_turbo>;
+				};
+			};
+		};
+
 		camss: isp@acb3000 {
 			compatible = "qcom,sc7280-camss";
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 10/10] arm64: dts: qcom: sa8775p: add the Titan camera NoC node
  2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
                   ` (8 preceding siblings ...)
  2026-11-30 10:49 ` [PATCH 09/10] arm64: dts: qcom: sc7280: " Atanas Filipov
@ 2026-11-30 10:49 ` Atanas Filipov
  9 siblings, 0 replies; 12+ messages in thread
From: Atanas Filipov @ 2026-11-30 10:49 UTC (permalink / raw)
  To: djakov, bod, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos, Atanas Filipov

Add the Titan camera NoC node. It registers the camera NoC
interconnect provider, so the camera clients can vote bandwidth on
their camera NoC ports and on the camera AHB node.

Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/lemans-gearvm.dtsi |  6 +++
 arch/arm64/boot/dts/qcom/lemans.dtsi        | 58 +++++++++++++++++++++
 2 files changed, 64 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/lemans-gearvm.dtsi b/arch/arm64/boot/dts/qcom/lemans-gearvm.dtsi
index 91c97a55f278..ad7463a701ba 100644
--- a/arch/arm64/boot/dts/qcom/lemans-gearvm.dtsi
+++ b/arch/arm64/boot/dts/qcom/lemans-gearvm.dtsi
@@ -3,6 +3,11 @@
  * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
  */
 
+#include <dt-bindings/clock/qcom,sa8775p-camcc.h>
+#include <dt-bindings/clock/qcom,sa8775p-gcc.h>
+#include <dt-bindings/interconnect/qcom,sa8775p-rpmh.h>
+#include <dt-bindings/power/qcom-rpmpd.h>
+
 #include "lemans.dtsi"
 
 /delete-node/ &xbl_boot_mem;
@@ -21,6 +26,7 @@
 /delete-node/ &pil_video_mem;
 /delete-node/ &scmi_mem;
 /delete-node/ &firmware_reserved_mem;
+/delete-node/ &camnoc;
 
 / {
 	clocks {
diff --git a/arch/arm64/boot/dts/qcom/lemans.dtsi b/arch/arm64/boot/dts/qcom/lemans.dtsi
index e298747c06bc..18148e1582e3 100644
--- a/arch/arm64/boot/dts/qcom/lemans.dtsi
+++ b/arch/arm64/boot/dts/qcom/lemans.dtsi
@@ -3348,6 +3348,64 @@ cci3_i2c1: i2c-bus@1 {
 			};
 		};
 
+		camnoc: interconnect@ac1a000 {
+			compatible = "qcom,sa8775p-cam-icc";
+			reg = <0x0 0x0ac1a000 0x0 0x9400>;
+
+			interrupts = <GIC_SPI 459 IRQ_TYPE_EDGE_RISING>;
+
+			clocks = <&gcc GCC_CAMERA_AHB_CLK>,
+				 <&gcc GCC_CAMERA_HF_AXI_CLK>,
+				 <&gcc GCC_CAMERA_SF_AXI_CLK>,
+				 <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+				 <&camcc CAM_CC_CPAS_AHB_CLK>,
+				 <&camcc CAM_CC_CORE_AHB_CLK>,
+				 <&camcc CAM_CC_FAST_AHB_CLK_SRC>,
+				 <&camcc CAM_CC_CPAS_FAST_AHB_CLK>,
+				 <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+				 <&camcc CAM_CC_CAMNOC_AXI_CLK_SRC>;
+			clock-names = "iface",
+				      "gcc_axi_hf",
+				      "gcc_axi_sf",
+				      "slow_ahb_src",
+				      "cpas_ahb",
+				      "core_ahb",
+				      "fast_ahb_src",
+				      "cpas_fast_ahb",
+				      "camnoc_axi",
+				      "camnoc_axi_src";
+
+			power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>,
+					<&rpmhpd SA8775P_MMCX>,
+					<&rpmhpd SA8775P_MXC>;
+			power-domain-names = "top", "mmcx", "mxc";
+
+			operating-points-v2 = <&camnoc_opp_table>;
+
+			interconnects = <&gem_noc MASTER_APPSS_PROC 0
+					 &config_noc SLAVE_CAMERA_CFG 0>,
+					<&mmss_noc MASTER_CAMNOC_HF 0 &mc_virt SLAVE_EBI1 0>;
+			interconnect-names = "cfg", "hf";
+
+			#interconnect-cells = <2>;
+
+			camnoc_opp_table: opp-table {
+				compatible = "operating-points-v2";
+
+				opp-300000000 {
+					opp-hz = /bits/ 64 <300000000>;
+					required-opps = <&rpmhpd_opp_svs_l1>,
+							<&rpmhpd_opp_svs_l1>;
+				};
+
+				opp-400000000 {
+					opp-hz = /bits/ 64 <400000000>;
+					required-opps = <&rpmhpd_opp_nom>,
+							<&rpmhpd_opp_nom>;
+				};
+			};
+		};
+
 		camss: isp@ac78000 {
 			compatible = "qcom,sa8775p-camss";
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 04/10] media: qcom: cam-icc: add the Titan camera NoC driver
  2026-11-30 10:49 ` [PATCH 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
@ 2026-11-30 12:16   ` Bryan O'Donoghue
  0 siblings, 0 replies; 12+ messages in thread
From: Bryan O'Donoghue @ 2026-11-30 12:16 UTC (permalink / raw)
  To: Atanas Filipov, djakov, linux-pm, linux-media
  Cc: mchehab, andersson, konradybcio, abelvesa, robh, krzk+dt,
	conor+dt, loic.poulain, linux-arm-msm, devicetree, linux-kernel,
	Dmitry Baryshkov, Prashant Shrotriya, Vikram Sharma,
	Gjorgji Rosikopulos

On 30/11/2026 10:49, Atanas Filipov wrote:
> Add an interconnect provider for the Titan camera NoC. CAMSS blocks
> vote bandwidth on their camera NoC port to DDR and on the camera AHB
> path. The driver sets the camera NoC AXI and AHB clock rates from the
> aggregated votes, and the rail level through an OPP table.
> 
> On every runtime resume the driver writes the static QoS settings and
> enables the camera NoC error interrupt.
> 
> Signed-off-by: Atanas Filipov <atanas.filipov@oss.qualcomm.com>
> ---
>   drivers/media/platform/qcom/Kconfig           |   1 +
>   drivers/media/platform/qcom/Makefile          |   1 +
>   drivers/media/platform/qcom/cam-icc/Kconfig   |  14 +
>   drivers/media/platform/qcom/cam-icc/Makefile  |   4 +
>   .../platform/qcom/cam-icc/qcom-cam-icc-core.c | 635 ++++++++++++++++++
>   .../platform/qcom/cam-icc/qcom-cam-icc-core.h | 142 +++
Quick query on this design. I thought you Gjorgji and Dmitry had agreed 
on implementing this as part of CAMCC somehow ?

I guess the conclusion here is that's not possible / undesirable. That 
said looking at the volume of code here I don't think it should go into 
a clock controller.

---
bod

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-11-30 12:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 10:49 [PATCH 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
2026-11-30 10:49 ` [PATCH 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
2026-11-30 10:49 ` [PATCH 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
2026-11-30 10:49 ` [PATCH 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
2026-11-30 10:49 ` [PATCH 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
2026-11-30 12:16   ` Bryan O'Donoghue
2026-11-30 10:49 ` [PATCH 05/10] media: qcom: cam-icc: add the SM8250 data Atanas Filipov
2026-11-30 10:49 ` [PATCH 06/10] media: qcom: cam-icc: add the SC7280 data Atanas Filipov
2026-11-30 10:49 ` [PATCH 07/10] media: qcom: cam-icc: add the SA8775P data Atanas Filipov
2026-11-30 10:49 ` [PATCH 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node Atanas Filipov
2026-11-30 10:49 ` [PATCH 09/10] arm64: dts: qcom: sc7280: " Atanas Filipov
2026-11-30 10:49 ` [PATCH 10/10] arm64: dts: qcom: sa8775p: " Atanas Filipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox