* [PATCH v2 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC
2026-12-04 7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
@ 2026-12-04 7:53 ` Atanas Filipov
2026-12-04 7:53 ` [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
` (8 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Atanas Filipov @ 2026-12-04 7:53 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..7b35a0640c7f
--- /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 SM8250 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: 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: 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,icc.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_CPAS_AHB_CLK>,
+ <&camcc CAM_CC_CORE_AHB_CLK>,
+ <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+ clock-names = "iface",
+ "gcc_axi_hf",
+ "gcc_axi_sf",
+ "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 QCOM_ICC_TAG_ALWAYS
+ &config_noc SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+ <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>,
+ <&mmss_noc MASTER_CAMNOC_SF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>;
+ 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..0461d32c8ab3
--- /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 0
+#define MASTER_CAMNOC_IFE_RDI_WR 1
+#define MASTER_CAMNOC_IFE_RDI_RD 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 8
+
+#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 Titan camera NoC
2026-12-04 7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
2026-12-04 7:53 ` [PATCH v2 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
@ 2026-12-04 7:53 ` Atanas Filipov
2026-12-04 11:10 ` Bryan O'Donoghue
2026-12-04 7:53 ` [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
` (7 subsequent siblings)
9 siblings, 1 reply; 15+ messages in thread
From: Atanas Filipov @ 2026-12-04 7:53 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 | 156 ++++++++++++++++++
.../interconnect/qcom,sc7280-cam-icc.h | 21 +++
2 files changed, 177 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..2d8bc60dd3be
--- /dev/null
+++ b/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
@@ -0,0 +1,156 @@
+# 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: CPAS AHB clock
+ - description: camera NoC AXI clock
+
+ clock-names:
+ items:
+ - const: gcc_axi_hf
+ - const: gcc_axi_sf
+ - const: cpas_ahb
+ - const: camnoc_axi
+
+ 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,icc.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_CPAS_AHB_CLK>,
+ <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+ clock-names = "gcc_axi_hf",
+ "gcc_axi_sf",
+ "cpas_ahb",
+ "camnoc_axi";
+
+ 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 QCOM_ICC_TAG_ALWAYS
+ &cnoc2 SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+ <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+ <&mmss_noc MASTER_CAMNOC_SF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
+ 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..01645008582d
--- /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 8
+
+#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 Titan camera NoC
2026-12-04 7:53 ` [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
@ 2026-12-04 11:10 ` Bryan O'Donoghue
0 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-12-04 11:10 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 04/12/2026 07:53, Atanas Filipov wrote:
> 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 | 156 ++++++++++++++++++
> .../interconnect/qcom,sc7280-cam-icc.h | 21 +++
> 2 files changed, 177 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..2d8bc60dd3be
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/interconnect/qcom,sc7280-cam-icc.yaml
> @@ -0,0 +1,156 @@
> +# 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: CPAS AHB clock
> + - description: camera NoC AXI clock
> +
> + clock-names:
> + items:
> + - const: gcc_axi_hf
> + - const: gcc_axi_sf
> + - const: cpas_ahb
> + - const: camnoc_axi
The last two should probably just be "ahb" and "axi"
> +
> + 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,icc.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";
We have "camcc" so IMO this should just be "camicc" minus the hyphenation.
Otherwise this looks pretty good to me.
---
bod
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P Titan camera NoC
2026-12-04 7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
2026-12-04 7:53 ` [PATCH v2 01/10] dt-bindings: interconnect: add the Qualcomm SM8250 Titan camera NoC Atanas Filipov
2026-12-04 7:53 ` [PATCH v2 02/10] dt-bindings: interconnect: add the Qualcomm SC7280 " Atanas Filipov
@ 2026-12-04 7:53 ` Atanas Filipov
2026-12-04 11:14 ` Bryan O'Donoghue
2026-12-04 7:53 ` [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
` (6 subsequent siblings)
9 siblings, 1 reply; 15+ messages in thread
From: Atanas Filipov @ 2026-12-04 7:53 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
has a CPAS 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 | 148 ++++++++++++++++++
.../interconnect/qcom,sa8775p-cam-icc.h | 17 ++
2 files changed, 165 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..88fe0033074d
--- /dev/null
+++ b/Documentation/devicetree/bindings/interconnect/qcom,sa8775p-cam-icc.yaml
@@ -0,0 +1,148 @@
+# 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: CPAS AHB clock
+ - description: camera core AHB clock
+ - description: CPAS fast AHB clock
+ - description: camera NoC AXI clock
+
+ clock-names:
+ items:
+ - const: iface
+ - const: gcc_axi_hf
+ - const: gcc_axi_sf
+ - const: cpas_ahb
+ - const: core_ahb
+ - const: cpas_fast_ahb
+ - const: camnoc_axi
+
+ 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,icc.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_CPAS_AHB_CLK>,
+ <&camcc CAM_CC_CORE_AHB_CLK>,
+ <&camcc CAM_CC_CPAS_FAST_AHB_CLK>,
+ <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+ clock-names = "iface",
+ "gcc_axi_hf",
+ "gcc_axi_sf",
+ "cpas_ahb",
+ "core_ahb",
+ "cpas_fast_ahb",
+ "camnoc_axi";
+
+ 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 QCOM_ICC_TAG_ALWAYS
+ &config_noc SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+ <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
+ interconnect-names = "cfg", "hf";
+
+ #interconnect-cells = <2>;
+
+ camnoc_opp_table: opp-table {
+ compatible = "operating-points-v2";
+
+ opp-400000000 {
+ opp-hz = /bits/ 64 <400000000>;
+ required-opps = <&rpmhpd_opp_svs_l1>,
+ <&rpmhpd_opp_svs_l1>;
+ };
+ };
+ };
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..4c84a4e14d92
--- /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 4
+
+#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P Titan camera NoC
2026-12-04 7:53 ` [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
@ 2026-12-04 11:14 ` Bryan O'Donoghue
0 siblings, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-12-04 11:14 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 04/12/2026 07:53, Atanas Filipov wrote:
> + clocks:
> + items:
> + - description: GCC camera AHB clock
> + - description: GCC camera HF AXI clock
> + - description: GCC camera SF AXI clock
> + - description: CPAS AHB clock
> + - description: camera core AHB clock
> + - description: CPAS fast AHB clock
> + - description: camera NoC AXI clock
> +
> + clock-names:
> + items:
> + - const: iface
> + - const: gcc_axi_hf
> + - const: gcc_axi_sf
> + - const: cpas_ahb
> + - const: core_ahb
> + - const: cpas_fast_ahb
> + - const: camnoc_axi
Right so this maps back to the comment I just gave. I think one of these
clocks is the core ahb/axi confusingly core_ahb is missing from sc7280.
So, I think you should have an ahb, axi and cpas_ahb clock in 7280 then,
based on this list and I suggest core_ahb and camnoc_axi become "ahb"
and "axi" here.
---
bod
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver
2026-12-04 7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
` (2 preceding siblings ...)
2026-12-04 7:53 ` [PATCH v2 03/10] dt-bindings: interconnect: add the Qualcomm SA8775P " Atanas Filipov
@ 2026-12-04 7:53 ` Atanas Filipov
2026-12-04 11:33 ` Bryan O'Donoghue
2026-12-04 12:25 ` Georgi Djakov
2026-12-04 7:53 ` [PATCH v2 05/10] media: qcom: cam-icc: add the SM8250 data Atanas Filipov
` (5 subsequent siblings)
9 siblings, 2 replies; 15+ messages in thread
From: Atanas Filipov @ 2026-12-04 7:53 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 | 670 ++++++++++++++++++
.../platform/qcom/cam-icc/qcom-cam-icc-core.h | 127 ++++
include/media/qcom-cam-icc.h | 26 +
7 files changed, 843 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..dbfccdb30da3
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
@@ -0,0 +1,670 @@
+// 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_CFG_KBPS 76800
+#define QCOM_CAM_ICC_AHB_RATE 80000000
+/* Set minimum bandwidth required to keep data path functional */
+#define QCOM_CAM_ICC_HF_MIN_KBPS 1
+
+#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;
+ int irq;
+ u32 irq_mask;
+ struct clk_bulk_data *clks;
+ int num_clks;
+ struct clk *axi_clk;
+ struct clk *ahb_clk;
+ struct icc_provider provider;
+ struct icc_onecell_data *icc_data;
+ u64 axi_rate;
+ unsigned long ahb_rate;
+ 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, max(node->avg_bw, node->peak_bw));
+ }
+
+ 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 = min_t(u64, rate, ULONG_MAX);
+ struct dev_pm_opp *opp;
+ int ret;
+
+ if (!rate) {
+ ret = clk_set_min_rate(camnoc->axi_clk, 0);
+ if (ret)
+ return ret;
+
+ ret = clk_set_rate(camnoc->axi_clk, 0);
+ 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 int qcom_cam_icc_update(struct qcom_cam_icc *camnoc)
+{
+ struct icc_node *ahb = camnoc->icc_data->nodes[camnoc->data->ahb_id];
+ unsigned long ahb_rate;
+ u64 rate;
+ int ret;
+
+ rate = qcom_cam_icc_axi_rate(camnoc);
+ ahb_rate = (ahb && (ahb->avg_bw || ahb->peak_bw)) ? QCOM_CAM_ICC_AHB_RATE : 0;
+ if (rate == camnoc->axi_rate && ahb_rate == camnoc->ahb_rate)
+ 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 (ahb_rate != camnoc->ahb_rate) {
+ ret = clk_set_min_rate(camnoc->ahb_clk, ahb_rate);
+ if (ret)
+ return ret;
+
+ ret = clk_set_rate(camnoc->ahb_clk, ahb_rate);
+ if (ret)
+ return ret;
+
+ camnoc->ahb_rate = ahb_rate;
+ }
+
+ dev_dbg(camnoc->dev, "axi %llu Hz, cpas_ahb %lu Hz\n", rate, ahb_rate);
+
+ 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 struct icc_node_data *qcom_cam_icc_xlate(const struct of_phandle_args *spec, void *data)
+{
+ struct icc_node_data *ndata;
+ struct icc_node *node;
+
+ node = of_icc_xlate_onecell(spec, data);
+ if (IS_ERR(node))
+ return ERR_CAST(node);
+
+ ndata = kzalloc_obj(*ndata);
+ if (!ndata)
+ return ERR_PTR(-ENOMEM);
+
+ ndata->node = node;
+ ndata->tag = spec->args[1];
+
+ return ndata;
+}
+
+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;
+ 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_extended = qcom_cam_icc_xlate;
+ 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];
+
+ if (desc->link_path)
+ ret = qcom_cam_icc_icc_link_path(camnoc, icc_data->nodes[desc->id],
+ desc->link_path);
+ else
+ ret = icc_link_nodes(icc_data->nodes[desc->id],
+ &icc_data->nodes[desc->link]);
+ 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->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->err_logger->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->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",
+ 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;
+ 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;
+ }
+
+ 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++) {
+ 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);
+ }
+
+ writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
+
+ 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->err_logger)
+ camnoc->irq_mask |= data->err_logger->sbm_mask;
+
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
+
+ camnoc->irq = 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);
+ icc_set_bw(camnoc->cfg_path, 0, 0);
+
+ return 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, QCOM_CAM_ICC_CFG_KBPS);
+ if (ret)
+ return ret;
+
+ ret = icc_set_bw(camnoc->hf_path, 0, QCOM_CAM_ICC_HF_MIN_KBPS);
+ 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 int qcom_cam_icc_suspend(struct device *dev)
+{
+ struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
+ int ret;
+
+ disable_irq(camnoc->irq);
+
+ ret = pm_runtime_force_suspend(dev);
+ if (ret)
+ enable_irq(camnoc->irq);
+
+ return ret;
+}
+
+static int qcom_cam_icc_resume(struct device *dev)
+{
+ struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
+ int ret;
+
+ ret = pm_runtime_force_resume(dev);
+ if (ret)
+ return ret;
+
+ enable_irq(camnoc->irq);
+
+ return 0;
+}
+
+static const struct dev_pm_ops qcom_cam_icc_pm_ops = {
+ SYSTEM_SLEEP_PM_OPS(qcom_cam_icc_suspend, qcom_cam_icc_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),
+};
+
+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);
+ unsigned long freq = dev_pm_opp_get_freq(opp);
+ int ret;
+
+ ret = clk_set_min_rate(camnoc->axi_clk, freq);
+ if (ret)
+ return ret;
+
+ return clk_set_rate(camnoc->axi_clk, freq);
+}
+
+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. @client must get
+ * its camera NoC interconnect path before this call.
+ *
+ * Return: 0 on success, -ENODEV if @client has no camera NoC path,
+ * -EPROBE_DEFER if the camera NoC device is not created 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;
+
+ 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);
+
+ 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_clk = devm_clk_get(dev, camnoc->data->rate_clk);
+ if (IS_ERR(camnoc->axi_clk))
+ return dev_err_probe(dev, PTR_ERR(camnoc->axi_clk), "no %s clock\n",
+ camnoc->data->rate_clk);
+
+ camnoc->ahb_clk = devm_clk_get(dev, "cpas_ahb");
+ if (IS_ERR(camnoc->ahb_clk))
+ return dev_err_probe(dev, PTR_ERR(camnoc->ahb_clk), "no cpas_ahb 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 = qcom_cam_icc_irq_request(pdev, camnoc);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to request the interrupt\n");
+
+ ret = devm_pm_runtime_enable(dev);
+ if (ret)
+ return ret;
+
+ 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..eee7eb9c4c2d
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
@@ -0,0 +1,127 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __QCOM_CAM_ICC_CORE_H__
+#define __QCOM_CAM_ICC_CORE_H__
+
+#include <linux/types.h>
+
+struct dev_pm_domain_attach_data;
+
+#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 link;
+ enum qcom_cam_icc_merge merge;
+ bool rate_node;
+ const char *link_path;
+};
+
+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;
+ 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 *err_logger;
+};
+
+#define CAMNOC_PORT(_id, _name, _link) \
+ { \
+ .name = _name, \
+ .id = _id, \
+ .link = _link, \
+ .merge = QCOM_CAM_ICC_MERGE_SUM, \
+ .rate_node = true, \
+ }
+
+#define CAMNOC_INTERNAL(_id, _name, _link, _merge) \
+ { \
+ .name = _name, \
+ .id = _id, \
+ .link = _link, \
+ .merge = _merge, \
+ .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.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver
2026-12-04 7:53 ` [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
@ 2026-12-04 11:33 ` Bryan O'Donoghue
2026-12-04 12:25 ` Georgi Djakov
1 sibling, 0 replies; 15+ messages in thread
From: Bryan O'Donoghue @ 2026-12-04 11:33 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 04/12/2026 07:53, 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 | 670 ++++++++++++++++++
> .../platform/qcom/cam-icc/qcom-cam-icc-core.h | 127 ++++
> include/media/qcom-cam-icc.h | 26 +
> 7 files changed, 843 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..dbfccdb30da3
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
> @@ -0,0 +1,670 @@
> +// 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_CFG_KBPS 76800
> +#define QCOM_CAM_ICC_AHB_RATE 80000000
> +/* Set minimum bandwidth required to keep data path functional */
> +#define QCOM_CAM_ICC_HF_MIN_KBPS 1
> +
> +#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;
> + int irq;
> + u32 irq_mask;
> + struct clk_bulk_data *clks;
> + int num_clks;
> + struct clk *axi_clk;
> + struct clk *ahb_clk;
> + struct icc_provider provider;
> + struct icc_onecell_data *icc_data;
> + u64 axi_rate;
> + unsigned long ahb_rate;
> + 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;
> + }
Deserves a comment
> +
> + *agg_avg += avg_bw;
> + *agg_peak = max(*agg_peak, peak_bw);
> +
> + return 0;
Should this routine be void - you return static 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;
Is !node expected to be a valid state ?
> +
> + bw = max_t(u64, bw, max(node->avg_bw, node->peak_bw));
> + }
> +
> + 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 = min_t(u64, rate, ULONG_MAX);
> + struct dev_pm_opp *opp;
> + int ret;
> +
> + if (!rate) {
> + ret = clk_set_min_rate(camnoc->axi_clk, 0);
> + if (ret)
> + return ret;
> +
> + ret = clk_set_rate(camnoc->axi_clk, 0);
> + 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 int qcom_cam_icc_update(struct qcom_cam_icc *camnoc)
> +{
> + struct icc_node *ahb = camnoc->icc_data->nodes[camnoc->data->ahb_id];
> + unsigned long ahb_rate;
> + u64 rate;
> + int ret;
> +
> + rate = qcom_cam_icc_axi_rate(camnoc);
> + ahb_rate = (ahb && (ahb->avg_bw || ahb->peak_bw)) ? QCOM_CAM_ICC_AHB_RATE : 0;
Is !ahb expected to be valid ? Why ? AHB is a fundamental clock.
> + if (rate == camnoc->axi_rate && ahb_rate == camnoc->ahb_rate)
> + 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 (ahb_rate != camnoc->ahb_rate) {
> + ret = clk_set_min_rate(camnoc->ahb_clk, ahb_rate);
> + if (ret)
> + return ret;
> +
> + ret = clk_set_rate(camnoc->ahb_clk, ahb_rate);
> + if (ret)
> + return ret;
> +
> + camnoc->ahb_rate = ahb_rate;
> + }
> +
> + dev_dbg(camnoc->dev, "axi %llu Hz, cpas_ahb %lu Hz\n", rate, ahb_rate);
> +
> + 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 struct icc_node_data *qcom_cam_icc_xlate(const struct of_phandle_args *spec, void *data)
> +{
> + struct icc_node_data *ndata;
> + struct icc_node *node;
> +
> + node = of_icc_xlate_onecell(spec, data);
> + if (IS_ERR(node))
> + return ERR_CAST(node);
> +
> + ndata = kzalloc_obj(*ndata);
> + if (!ndata)
> + return ERR_PTR(-ENOMEM);
> +
> + ndata->node = node;
> + ndata->tag = spec->args[1];
> +
> + return ndata;
> +}
> +
> +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;
> + 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_extended = qcom_cam_icc_xlate;
> + 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];
> +
> + if (desc->link_path)
> + ret = qcom_cam_icc_icc_link_path(camnoc, icc_data->nodes[desc->id],
> + desc->link_path);
> + else
> + ret = icc_link_nodes(icc_data->nodes[desc->id],
> + &icc_data->nodes[desc->link]);
> + 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->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->err_logger->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->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",
> + 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;
> + size_t i;
> +
> + if (pm_runtime_get_if_active(camnoc->dev) <= 0)
> + return IRQ_NONE;
Why would the IRQ run if this is false ?
> +
> + status = readl(camnoc->base + data->sbm->status_reg);
> + pending = status & camnoc->irq_mask;
> + if (!pending) {
> + pm_runtime_put(camnoc->dev);
> + return IRQ_NONE;
As I read this, we run, we read a status and then we return 'nothing to
do' which seems odd to me.
> + }
> +
> + 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++) {
> + 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);
> + }
> +
> + writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
> +
> + 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->err_logger)
> + camnoc->irq_mask |= data->err_logger->sbm_mask;
> +
> + irq = platform_get_irq(pdev, 0);
> + if (irq < 0)
> + return irq;
> +
> + camnoc->irq = 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);
> + icc_set_bw(camnoc->cfg_path, 0, 0);
> +
> + return 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, QCOM_CAM_ICC_CFG_KBPS);
> + if (ret)
> + return ret;
> +
> + ret = icc_set_bw(camnoc->hf_path, 0, QCOM_CAM_ICC_HF_MIN_KBPS);
> + 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 int qcom_cam_icc_suspend(struct device *dev)
> +{
> + struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> + int ret;
> +
> + disable_irq(camnoc->irq);
> +
> + ret = pm_runtime_force_suspend(dev);
> + if (ret)
> + enable_irq(camnoc->irq);
> +
> + return ret;
> +}
> +
> +static int qcom_cam_icc_resume(struct device *dev)
> +{
> + struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> + int ret;
> +
> + ret = pm_runtime_force_resume(dev);
> + if (ret)
> + return ret;
> +
> + enable_irq(camnoc->irq);
> +
> + return 0;
> +}
> +
> +static const struct dev_pm_ops qcom_cam_icc_pm_ops = {
> + SYSTEM_SLEEP_PM_OPS(qcom_cam_icc_suspend, qcom_cam_icc_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),
> +};
> +
> +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);
> + unsigned long freq = dev_pm_opp_get_freq(opp);
> + int ret;
> +
> + ret = clk_set_min_rate(camnoc->axi_clk, freq);
> + if (ret)
> + return ret;
> +
> + return clk_set_rate(camnoc->axi_clk, freq);
> +}
> +
> +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. @client must get
> + * its camera NoC interconnect path before this call.
> + *
> + * Return: 0 on success, -ENODEV if @client has no camera NoC path,
> + * -EPROBE_DEFER if the camera NoC device is not created yet, or another
> + * negative error code.
> + */
This is the only function with an explanatory header. Suggest you either
replicate this everywhere or zap it.
Now that I review a bit later I see we have a new function
qcom_cam_icc_link() ... but why aren't we just describing the camnoc
interconnect exactly as we do any other interconnect ? Why do we need a
custom function ?
Shouldn't it just be icc_set_bw() with the interconnect nodes between
jpeg, ife etc pointing the same way the root DT for this points to
interconnects provided elsewhere the EB ports to DRAM as an example ?
> +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;
> +
> + link = device_link_add(client, &pdev->dev,
> + DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER);
> + put_device(&pdev->dev);
> +
> + return link ? 0 : -EINVAL;
Why -EINVAL and not -ENODEV, i.e. what's the bad input parameter we are
reporting @ -EINVAL, surely its no device here => -ENODEV;
> +}
> +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);
> +
> + 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_clk = devm_clk_get(dev, camnoc->data->rate_clk);
> + if (IS_ERR(camnoc->axi_clk))
> + return dev_err_probe(dev, PTR_ERR(camnoc->axi_clk), "no %s clock\n",
> + camnoc->data->rate_clk);
> +
> + camnoc->ahb_clk = devm_clk_get(dev, "cpas_ahb");
> + if (IS_ERR(camnoc->ahb_clk))
> + return dev_err_probe(dev, PTR_ERR(camnoc->ahb_clk), "no cpas_ahb 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 = qcom_cam_icc_irq_request(pdev, camnoc);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to request the interrupt\n");
> +
> + ret = devm_pm_runtime_enable(dev);
> + if (ret)
> + return ret;
> +
> + 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..eee7eb9c4c2d
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
> @@ -0,0 +1,127 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +
> +#ifndef __QCOM_CAM_ICC_CORE_H__
> +#define __QCOM_CAM_ICC_CORE_H__
> +
> +#include <linux/types.h>
> +
> +struct dev_pm_domain_attach_data;
> +
> +#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 link;
> + enum qcom_cam_icc_merge merge;
> + bool rate_node;
> + const char *link_path;
> +};
> +
> +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;
> + 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 *err_logger;
> +};
> +
> +#define CAMNOC_PORT(_id, _name, _link) \
> + { \
> + .name = _name, \
> + .id = _id, \
> + .link = _link, \
> + .merge = QCOM_CAM_ICC_MERGE_SUM, \
> + .rate_node = true, \
> + }
> +
> +#define CAMNOC_INTERNAL(_id, _name, _link, _merge) \
> + { \
> + .name = _name, \
> + .id = _id, \
> + .link = _link, \
> + .merge = _merge, \
> + .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.34.1
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver
2026-12-04 7:53 ` [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
2026-12-04 11:33 ` Bryan O'Donoghue
@ 2026-12-04 12:25 ` Georgi Djakov
1 sibling, 0 replies; 15+ messages in thread
From: Georgi Djakov @ 2026-12-04 12:25 UTC (permalink / raw)
To: Atanas Filipov, 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
Hi Atanas,
On 12/4/26 9:53 AM, 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 | 670 ++++++++++++++++++
> .../platform/qcom/cam-icc/qcom-cam-icc-core.h | 127 ++++
> include/media/qcom-cam-icc.h | 26 +
> 7 files changed, 843 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
>
This is an interconnect provider with bindings under bindings/interconnect/, but
you put it in drivers/media/platform/qcom/, why? Maybe you should move it to
drivers/interconnect/qcom/
> 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
[..]
> +++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.c
> @@ -0,0 +1,670 @@
> +// 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
Why is this 3GB/s floor? Why not use kBps_to_icc() or MBps_to_icc() etc?
> +#define QCOM_CAM_ICC_BUS_WIDTH 32
> +#define QCOM_CAM_ICC_MARGIN_PCT 20
Please explain this 20% margin? Is it an arbitrary number?
> +#define QCOM_CAM_ICC_CFG_KBPS 76800
> +#define QCOM_CAM_ICC_AHB_RATE 80000000
> +/* Set minimum bandwidth required to keep data path functional */
> +#define QCOM_CAM_ICC_HF_MIN_KBPS 1
What actually needs the MM NoC up while the camera NoC is resumed - maybe the
QoS writes? The "SF" path gets no such vote?
> +
> +#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;
> + int irq;
> + u32 irq_mask;
> + struct clk_bulk_data *clks;
> + int num_clks;
> + struct clk *axi_clk;
> + struct clk *ahb_clk;
> + struct icc_provider provider;
> + struct icc_onecell_data *icc_data;
> + u64 axi_rate;
> + unsigned long ahb_rate;
> + 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;
> + }
Please explain this aggregation policy. With one or two equal clients behind an
internal node, the un-halved port value wins. Looks like halving only matters from
three clients up. Is that the intended behavior?
> +
> + *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, max(node->avg_bw, node->peak_bw));
> + }
> +
> + 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 = min_t(u64, rate, ULONG_MAX);
> + struct dev_pm_opp *opp;
> + int ret;
> +
> + if (!rate) {
> + ret = clk_set_min_rate(camnoc->axi_clk, 0);
> + if (ret)
> + return ret;
> +
> + ret = clk_set_rate(camnoc->axi_clk, 0);
> + 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;
> +}
Have you tried to run this with a real client and PROVE_LOCKING enabled?
> +
> +static int qcom_cam_icc_update(struct qcom_cam_icc *camnoc)
> +{
> + struct icc_node *ahb = camnoc->icc_data->nodes[camnoc->data->ahb_id];
> + unsigned long ahb_rate;
> + u64 rate;
> + int ret;
> +
> + rate = qcom_cam_icc_axi_rate(camnoc);
> + ahb_rate = (ahb && (ahb->avg_bw || ahb->peak_bw)) ? QCOM_CAM_ICC_AHB_RATE : 0;
> + if (rate == camnoc->axi_rate && ahb_rate == camnoc->ahb_rate)
> + 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 (ahb_rate != camnoc->ahb_rate) {
> + ret = clk_set_min_rate(camnoc->ahb_clk, ahb_rate);
> + if (ret)
> + return ret;
> +
> + ret = clk_set_rate(camnoc->ahb_clk, ahb_rate);
> + if (ret)
> + return ret;
This will leave the AXI rate applied and cached if the AHB step fails?
> +
> + camnoc->ahb_rate = ahb_rate;
> + }
> +
> + dev_dbg(camnoc->dev, "axi %llu Hz, cpas_ahb %lu Hz\n", rate, ahb_rate);
> +
> + 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 struct icc_node_data *qcom_cam_icc_xlate(const struct of_phandle_args *spec, void *data)
> +{
> + struct icc_node_data *ndata;
> + struct icc_node *node;
> +
> + node = of_icc_xlate_onecell(spec, data);
> + if (IS_ERR(node))
> + return ERR_CAST(node);
> +
> + ndata = kzalloc_obj(*ndata);
> + if (!ndata)
> + return ERR_PTR(-ENOMEM);
> +
> + ndata->node = node;
> + ndata->tag = spec->args[1];
> +
> + return ndata;
> +}
Looks like a copy of the existing qcom_icc_xlate_extended()
> +
> +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;
> + 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_extended = qcom_cam_icc_xlate;
Why not use qcom_icc_xlate_extended() ?
> + 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];
> +
> + if (desc->link_path)
> + ret = qcom_cam_icc_icc_link_path(camnoc, icc_data->nodes[desc->id],
> + desc->link_path);
> + else
> + ret = icc_link_nodes(icc_data->nodes[desc->id],
> + &icc_data->nodes[desc->link]);
> + 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);
> +
We dereference data->sbm unconditionally while err_logger is optional. Maybe make it
consistent?
> + 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->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->err_logger->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->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",
> + 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;
> + 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;
> + }
> +
> + 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++) {
> + 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);
> + }
> +
> + writel(data->sbm->clear_val, camnoc->base + data->sbm->clear_reg);
> +
> + 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->err_logger)
> + camnoc->irq_mask |= data->err_logger->sbm_mask;
> +
> + irq = platform_get_irq(pdev, 0);
> + if (irq < 0)
> + return irq;
> +
> + camnoc->irq = 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);
> + icc_set_bw(camnoc->cfg_path, 0, 0);
> +
> + return 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, QCOM_CAM_ICC_CFG_KBPS);
> + if (ret)
> + return ret;
> +
> + ret = icc_set_bw(camnoc->hf_path, 0, QCOM_CAM_ICC_HF_MIN_KBPS);
> + 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 int qcom_cam_icc_suspend(struct device *dev)
> +{
> + struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> + int ret;
> +
> + disable_irq(camnoc->irq);
> +
> + ret = pm_runtime_force_suspend(dev);
> + if (ret)
> + enable_irq(camnoc->irq);
> +
> + return ret;
> +}
> +
> +static int qcom_cam_icc_resume(struct device *dev)
> +{
> + struct qcom_cam_icc *camnoc = dev_get_drvdata(dev);
> + int ret;
> +
> + ret = pm_runtime_force_resume(dev);
> + if (ret)
> + return ret;
> +
> + enable_irq(camnoc->irq);
> +
> + return 0;
> +}
> +
> +static const struct dev_pm_ops qcom_cam_icc_pm_ops = {
> + SYSTEM_SLEEP_PM_OPS(qcom_cam_icc_suspend, qcom_cam_icc_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),
> +};
> +
> +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);
> + unsigned long freq = dev_pm_opp_get_freq(opp);
> + int ret;
> +
> + ret = clk_set_min_rate(camnoc->axi_clk, freq);
> + if (ret)
> + return ret;
> +
> + return clk_set_rate(camnoc->axi_clk, freq);
> +}
> +
> +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. @client must get
> + * its camera NoC interconnect path before this call.
> + *
> + * Return: 0 on success, -ENODEV if @client has no camera NoC path,
> + * -EPROBE_DEFER if the camera NoC device is not created 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;
> +
> + 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);
This is exported, but i see no user?
> +
> +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);
Should we check for NULL here?
> +
> + 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_clk = devm_clk_get(dev, camnoc->data->rate_clk);
> + if (IS_ERR(camnoc->axi_clk))
> + return dev_err_probe(dev, PTR_ERR(camnoc->axi_clk), "no %s clock\n",
> + camnoc->data->rate_clk);
> +
> + camnoc->ahb_clk = devm_clk_get(dev, "cpas_ahb");
> + if (IS_ERR(camnoc->ahb_clk))
> + return dev_err_probe(dev, PTR_ERR(camnoc->ahb_clk), "no cpas_ahb 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 = qcom_cam_icc_irq_request(pdev, camnoc);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to request the interrupt\n");
> +
> + ret = devm_pm_runtime_enable(dev);
> + if (ret)
> + return ret;
> +
> + 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..eee7eb9c4c2d
> --- /dev/null
> +++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-core.h
> @@ -0,0 +1,127 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +
> +#ifndef __QCOM_CAM_ICC_CORE_H__
> +#define __QCOM_CAM_ICC_CORE_H__
> +
> +#include <linux/types.h>
> +
> +struct dev_pm_domain_attach_data;
> +
> +#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
I don't see where all these are used? Please remove what is unused.
> +
> +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 link;
> + enum qcom_cam_icc_merge merge;
> + bool rate_node;
> + const char *link_path;
> +};
> +
> +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;
> + 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 *err_logger;
> +};
> +
> +#define CAMNOC_PORT(_id, _name, _link) \
> + { \
> + .name = _name, \
> + .id = _id, \
> + .link = _link, \
> + .merge = QCOM_CAM_ICC_MERGE_SUM, \
> + .rate_node = true, \
> + }
> +
> +#define CAMNOC_INTERNAL(_id, _name, _link, _merge) \
> + { \
> + .name = _name, \
> + .id = _id, \
> + .link = _link, \
> + .merge = _merge, \
> + .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)
I would expect that with a tristate and an IS_ENABLED() stub, a built-in client
against a modular provider will fail to link. Is this a possible scenario?
> +
> +int qcom_cam_icc_link(struct device *client);
> +
> +#else
> +
> +static inline int qcom_cam_icc_link(struct device *client)
> +{
> + return -ENODEV;
> +}
> +
> +#endif
> +
> +#endif
Thanks,
Georgi
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 05/10] media: qcom: cam-icc: add the SM8250 data
2026-12-04 7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
` (3 preceding siblings ...)
2026-12-04 7:53 ` [PATCH v2 04/10] media: qcom: cam-icc: add the Titan camera NoC driver Atanas Filipov
@ 2026-12-04 7:53 ` Atanas Filipov
2026-12-04 7:53 ` [PATCH v2 06/10] media: qcom: cam-icc: add the SC7280 data Atanas Filipov
` (4 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Atanas Filipov @ 2026-12-04 7:53 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, MMCX rail, static QoS settings and
error interrupt sources. The port list, 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 | 127 ++++++++++++++++++
4 files changed, 131 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 dbfccdb30da3..05086221728f 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
@@ -534,6 +534,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 eee7eb9c4c2d..eb2852978bd3 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
@@ -124,4 +124,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..5a07bc61c704
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sm8250.c
@@ -0,0 +1,127 @@
+// 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,
+ .link = 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 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_err_log = {
+ .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_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),
+ .err_logger = &sm8250_err_log,
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 06/10] media: qcom: cam-icc: add the SC7280 data
2026-12-04 7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
` (4 preceding siblings ...)
2026-12-04 7:53 ` [PATCH v2 05/10] media: qcom: cam-icc: add the SM8250 data Atanas Filipov
@ 2026-12-04 7:53 ` Atanas Filipov
2026-12-04 7:53 ` [PATCH v2 07/10] media: qcom: cam-icc: add the SA8775P data Atanas Filipov
` (3 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Atanas Filipov @ 2026-12-04 7:53 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, CX rail, static QoS settings and
error interrupt sources. The port list, 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 | 1 +
.../qcom/cam-icc/qcom-cam-icc-sc7280.c | 134 ++++++++++++++++++
4 files changed, 137 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 05086221728f..4aa5a0c76842 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
@@ -534,6 +534,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 eb2852978bd3..9d4d60653404 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
@@ -124,6 +124,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..56a9459c047d
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sc7280.c
@@ -0,0 +1,134 @@
+// 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,
+ .link = 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 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_err_log = {
+ .base = SC7280_ERL,
+ .sbm_mask = BIT(0),
+};
+
+const struct qcom_cam_icc_data qcom_cam_icc_sc7280_data = {
+ .rate_clk = "camnoc_axi",
+ .nodes = sc7280_nodes,
+ .num_nodes = ARRAY_SIZE(sc7280_nodes),
+ .num_ids = SC7280_CAMNOC_NUM_NODES,
+ .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),
+ .err_logger = &sc7280_err_log,
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 07/10] media: qcom: cam-icc: add the SA8775P data
2026-12-04 7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
` (5 preceding siblings ...)
2026-12-04 7:53 ` [PATCH v2 06/10] media: qcom: cam-icc: add the SC7280 data Atanas Filipov
@ 2026-12-04 7:53 ` Atanas Filipov
2026-12-04 7:53 ` [PATCH v2 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node Atanas Filipov
` (2 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Atanas Filipov @ 2026-12-04 7:53 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, MMCX and MXC rails, static QoS
settings and error interrupt sources. The port list, 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 | 3 +-
.../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-sa8775p.c | 107 ++++++++++++++++++
4 files changed, 111 insertions(+), 1 deletion(-)
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 4aa5a0c76842..c40d2e6f2a46 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
@@ -534,6 +534,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 9d4d60653404..c35286c02a09 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
@@ -124,6 +124,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..a181c1c7540c
--- /dev/null
+++ b/drivers/media/platform/qcom/cam-icc/qcom-cam-icc-sa8775p.c
@@ -0,0 +1,107 @@
+// 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,
+ .link = 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 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 = "camnoc_axi",
+ .nodes = sa8775p_nodes,
+ .num_nodes = ARRAY_SIZE(sa8775p_nodes),
+ .num_ids = SA8775P_CAMNOC_NUM_NODES,
+ .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,
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node
2026-12-04 7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
` (6 preceding siblings ...)
2026-12-04 7:53 ` [PATCH v2 07/10] media: qcom: cam-icc: add the SA8775P data Atanas Filipov
@ 2026-12-04 7:53 ` Atanas Filipov
2026-12-04 7:53 ` [PATCH v2 09/10] arm64: dts: qcom: sc7280: " Atanas Filipov
2026-12-04 7:53 ` [PATCH v2 10/10] arm64: dts: qcom: sa8775p: " Atanas Filipov
9 siblings, 0 replies; 15+ messages in thread
From: Atanas Filipov @ 2026-12-04 7:53 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 | 50 ++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index 992284e64d38..a8ed6d9847b1 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -4407,6 +4407,56 @@ videocc: clock-controller@abf0000 {
#power-domain-cells = <1>;
};
+ cam_icc: 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_CPAS_AHB_CLK>,
+ <&camcc CAM_CC_CORE_AHB_CLK>,
+ <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+ clock-names = "iface",
+ "gcc_axi_hf",
+ "gcc_axi_sf",
+ "cpas_ahb",
+ "core_ahb",
+ "camnoc_axi";
+
+ power-domains = <&camcc TITAN_TOP_GDSC>,
+ <&rpmhpd RPMHPD_MMCX>;
+ power-domain-names = "top", "mmcx";
+
+ operating-points-v2 = <&cam_icc_opp_table>;
+
+ interconnects = <&gem_noc MASTER_AMPSS_M0 QCOM_ICC_TAG_ALWAYS
+ &config_noc SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+ <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>,
+ <&mmss_noc MASTER_CAMNOC_SF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>;
+ interconnect-names = "cfg", "hf", "sf";
+
+ #interconnect-cells = <2>;
+
+ cam_icc_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.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 09/10] arm64: dts: qcom: sc7280: add the Titan camera NoC node
2026-12-04 7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
` (7 preceding siblings ...)
2026-12-04 7:53 ` [PATCH v2 08/10] arm64: dts: qcom: sm8250: add the Titan camera NoC node Atanas Filipov
@ 2026-12-04 7:53 ` Atanas Filipov
2026-12-04 7:53 ` [PATCH v2 10/10] arm64: dts: qcom: sa8775p: " Atanas Filipov
9 siblings, 0 replies; 15+ messages in thread
From: Atanas Filipov @ 2026-12-04 7:53 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 | 61 ++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qcom/kodiak.dtsi
index 10e9a5279ed6..b331a4461719 100644
--- a/arch/arm64/boot/dts/qcom/kodiak.dtsi
+++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi
@@ -5179,6 +5179,67 @@ cci1_i2c1: i2c-bus@1 {
};
};
+ cam_icc: 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_CPAS_AHB_CLK>,
+ <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+ clock-names = "gcc_axi_hf",
+ "gcc_axi_sf",
+ "cpas_ahb",
+ "camnoc_axi";
+
+ power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>,
+ <&rpmhpd SC7280_CX>;
+ power-domain-names = "top", "cx";
+
+ operating-points-v2 = <&cam_icc_opp_table>;
+
+ interconnects = <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+ &cnoc2 SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+ <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+ <&mmss_noc MASTER_CAMNOC_SF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
+ interconnect-names = "cfg", "hf", "sf";
+
+ #interconnect-cells = <2>;
+
+ cam_icc_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.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 10/10] arm64: dts: qcom: sa8775p: add the Titan camera NoC node
2026-12-04 7:53 [PATCH v2 00/10] Add the Qualcomm Titan camera NoC interconnect provider Atanas Filipov
` (8 preceding siblings ...)
2026-12-04 7:53 ` [PATCH v2 09/10] arm64: dts: qcom: sc7280: " Atanas Filipov
@ 2026-12-04 7:53 ` Atanas Filipov
9 siblings, 0 replies; 15+ messages in thread
From: Atanas Filipov @ 2026-12-04 7:53 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-embedded.dtsi | 47 +++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi b/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi
index 0be39bb9de1e..308c05cd6d1a 100644
--- a/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi
+++ b/arch/arm64/boot/dts/qcom/lemans-embedded.dtsi
@@ -2001,6 +2001,53 @@ videocc: clock-controller@abf0000 {
#power-domain-cells = <1>;
};
+ cam_icc: 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_CPAS_AHB_CLK>,
+ <&camcc CAM_CC_CORE_AHB_CLK>,
+ <&camcc CAM_CC_CPAS_FAST_AHB_CLK>,
+ <&camcc CAM_CC_CAMNOC_AXI_CLK>;
+ clock-names = "iface",
+ "gcc_axi_hf",
+ "gcc_axi_sf",
+ "cpas_ahb",
+ "core_ahb",
+ "cpas_fast_ahb",
+ "camnoc_axi";
+
+ power-domains = <&camcc CAM_CC_TITAN_TOP_GDSC>,
+ <&rpmhpd SA8775P_MMCX>,
+ <&rpmhpd SA8775P_MXC>;
+ power-domain-names = "top", "mmcx", "mxc";
+
+ operating-points-v2 = <&cam_icc_opp_table>;
+
+ interconnects = <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+ &config_noc SLAVE_CAMERA_CFG QCOM_ICC_TAG_ALWAYS>,
+ <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
+ interconnect-names = "cfg", "hf";
+
+ #interconnect-cells = <2>;
+
+ cam_icc_opp_table: opp-table {
+ compatible = "operating-points-v2";
+
+ opp-400000000 {
+ opp-hz = /bits/ 64 <400000000>;
+ required-opps = <&rpmhpd_opp_svs_l1>,
+ <&rpmhpd_opp_svs_l1>;
+ };
+ };
+ };
+
camcc: clock-controller@ade0000 {
compatible = "qcom,sa8775p-camcc";
reg = <0x0 0x0ade0000 0x0 0x20000>;
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread