* [PATCH v6 0/3] Add CAMSS support for Qualcomm Hawi and Maili
@ 2026-12-03 8:17 Nihal Kumar Gupta
2026-12-03 8:17 ` [PATCH v6 1/3] dt-bindings: media: Add CAMSS device for " Nihal Kumar Gupta
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Nihal Kumar Gupta @ 2026-12-03 8:17 UTC (permalink / raw)
To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Hangxiang Ma, Nihal Kumar Gupta,
Bryan O'Donoghue
Cc: Suresh Vankadara, Vikram Sharma, linux-media, linux-arm-msm,
devicetree, linux-kernel, Krzysztof Kozlowski
Hawi and Maili are recently announced Qualcomm Snapdragon SoCs [1].
This series adds Camera Subsystem (CAMSS) support for the Qualcomm
Hawi and Maili SoC's.
[1] https://www.qualcomm.com/smartphones/products/8-series/snapdragon-8-elite-gen-6-mobile-platform
This is the CAMSS/media part split from the previous combined v4 series.
The I2C CCI and CSI-2 PHY patches were posted separately as v5 because
they do not depend on the Kaanapali/KNP CAMSS media patches.
This series carries the CAMSS/media patches from the previous combined v4
series: patch 3/6 (CAMSS binding), patch 5/6 (CSID clock scaling) and
patch 6/6 (Hawi CAMSS support).
Link to combined v4:
https://lore.kernel.org/r/20261106-hawi-maili-camss-v4-0-d528c7a797b4@oss.qualcomm.com
Link to split I2C/PHY v5:
https://lore.kernel.org/all/20261125-hawi-maili-camss-v5-0-1483b7f68dce@oss.qualcomm.com/
Hawi's camera hardware topology:
- 6x CSIPHY (CSI Physical Layer)
- 3x TPG (Test Pattern Generator)
- 3x CSID (CSI Decoder)
- 2x CSID Lite
- 3x VFE (Video Front End), 5 RDI per VFE
- 2x VFE Lite, 4 RDI per VFE Lite
Maili shares the same IP as Hawi. The only difference is Hawi has 6 CSIPHY
while Maili has 5.
Used following tools for the sanity check of these changes.
- make -j32 W=1
- checkpatch.pl
- make DT_CHECKER_FLAGS=-m DT_SCHEMA_FILES=media/qcom,hawi-camss.yaml dt_binding_check W=1
- make CHECK_DTBS=y W=1 dtbs
---
Changes in v6:
- Rebased on next-20261202
- Patch 1: Picked up Krzysztof's Reviewed-by tag.
- Patch 2: Reworked the CSID clock-rate cleanup path to release clock rates from
the common regulator-disable error path.
- Patch 3:
- Added CSID instance IDs for Hawi.
- Used the stream PHY configuration lane count in the CSID 1190 stream
setup path.
- Used csid_index() for RDI buffer completion.
- Link to v5: https://lore.kernel.org/r/20261125-hawi-camss-v5-0-d48c4feb1c2e@oss.qualcomm.com
Changes in v5:
- Split out CAMSS/media patches 3/6, 5/6 and 6/6 from the previous combined v4 series.
- Drop the I2C/PHY patches; they were posted separately for I2C/PHY pickup.
- Base on Bryan's media tree where the required KNP CAMSS patches are picked.
- Link to v4: https://lore.kernel.org/r/20261106-hawi-maili-camss-v4-0-d528c7a797b4@oss.qualcomm.com
Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
---
Hangxiang Ma (2):
dt-bindings: media: Add CAMSS device for Hawi and Maili
media: qcom: camss: Add support for Hawi
Loic Poulain (1):
media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate
.../devicetree/bindings/media/qcom,hawi-camss.yaml | 317 ++++++++++++++++
drivers/media/platform/qcom/camss/Makefile | 2 +
.../media/platform/qcom/camss/camss-csid-1190.c | 417 +++++++++++++++++++++
drivers/media/platform/qcom/camss/camss-csid.c | 206 ++++++++--
drivers/media/platform/qcom/camss/camss-csid.h | 1 +
drivers/media/platform/qcom/camss/camss-vfe-1190.c | 217 +++++++++++
drivers/media/platform/qcom/camss/camss-vfe.c | 1 +
drivers/media/platform/qcom/camss/camss-vfe.h | 1 +
drivers/media/platform/qcom/camss/camss.c | 233 ++++++++++++
drivers/media/platform/qcom/camss/camss.h | 1 +
10 files changed, 1357 insertions(+), 39 deletions(-)
---
base-commit: 1c776b6c21f78619c639d724813c54613d8476b1
change-id: 20261125-hawi-camss-d801843c96b1
Best regards,
--
Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v6 1/3] dt-bindings: media: Add CAMSS device for Hawi and Maili
2026-12-03 8:17 [PATCH v6 0/3] Add CAMSS support for Qualcomm Hawi and Maili Nihal Kumar Gupta
@ 2026-12-03 8:17 ` Nihal Kumar Gupta
2026-12-03 8:32 ` sashiko-bot
2026-12-03 8:17 ` [PATCH v6 2/3] media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate Nihal Kumar Gupta
2026-12-03 8:17 ` [PATCH v6 3/3] media: qcom: camss: Add support for Hawi Nihal Kumar Gupta
2 siblings, 1 reply; 7+ messages in thread
From: Nihal Kumar Gupta @ 2026-12-03 8:17 UTC (permalink / raw)
To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Hangxiang Ma, Nihal Kumar Gupta,
Bryan O'Donoghue
Cc: Suresh Vankadara, Vikram Sharma, linux-media, linux-arm-msm,
devicetree, linux-kernel, Krzysztof Kozlowski
From: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Add bindings for Camera Subsystem (CAMSS) on the Qualcomm Hawi platform.
The Hawi platform provides:
- 6 x CSIPHY (CSI Physical Layer)
- 3 x TPG (Test Pattern Generator)
- 3 x CSID (CSI Decoder)
- 2 x CSID Lite
- 3 x VFE (Video Front End), 5 RDI per VFE
- 2 x VFE Lite, 4 RDI per VFE Lite
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Co-developed-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
.../devicetree/bindings/media/qcom,hawi-camss.yaml | 317 +++++++++++++++++++++
1 file changed, 317 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/qcom,hawi-camss.yaml b/Documentation/devicetree/bindings/media/qcom,hawi-camss.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..22629064ed7132cd19b7b0521ebd7c33d79a1417
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/qcom,hawi-camss.yaml
@@ -0,0 +1,317 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/qcom,hawi-camss.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Hawi and Maili Camera Subsystem (CAMSS)
+
+maintainers:
+ - Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
+ - Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
+
+description:
+ The CAMSS IP is a CSI decoder and ISP present on Qualcomm platforms.
+
+properties:
+ compatible:
+ oneOf:
+ - const: qcom,hawi-camss
+ - items:
+ - const: qcom,maili-camss
+ - const: qcom,hawi-camss
+
+ reg:
+ maxItems: 14
+
+ reg-names:
+ items:
+ - const: top
+ - const: csid0
+ - const: csid1
+ - const: csid2
+ - const: csid_lite0
+ - const: csid_lite1
+ - const: tpg0
+ - const: tpg1
+ - const: tpg2
+ - const: vfe0
+ - const: vfe1
+ - const: vfe2
+ - const: vfe_lite0
+ - const: vfe_lite1
+
+ clocks:
+ maxItems: 26
+
+ clock-names:
+ items:
+ - const: camnoc_nrt_axi
+ - const: camnoc_rt_axi
+ - const: camnoc_dcd_xo
+ - const: cpas_ahb
+ - const: cpas_fast_ahb
+ - const: cpas_mnoc_hf
+ - const: cpas_mnoc_sf
+ - const: cpas_vfe0
+ - const: cpas_vfe1
+ - const: cpas_vfe2
+ - const: cpas_vfe_lite
+ - const: csid
+ - const: csiphy_rx
+ - const: gcc_axi_hf
+ - const: gcc_axi_sf
+ - const: vfe0
+ - const: vfe0_fast_ahb
+ - const: vfe1
+ - const: vfe1_fast_ahb
+ - const: vfe2
+ - const: vfe2_fast_ahb
+ - const: vfe_lite
+ - const: vfe_lite_ahb
+ - const: vfe_lite_cphy_rx
+ - const: vfe_lite_csid
+ - const: qdss_debug_xo
+
+ interrupts:
+ maxItems: 10
+
+ interrupt-names:
+ items:
+ - const: csid0
+ - const: csid1
+ - const: csid2
+ - const: csid_lite0
+ - const: csid_lite1
+ - const: vfe0
+ - const: vfe1
+ - const: vfe2
+ - const: vfe_lite0
+ - const: vfe_lite1
+
+ interconnects:
+ maxItems: 2
+
+ interconnect-names:
+ items:
+ - const: ahb
+ - const: hf_mnoc
+
+ iommus:
+ items:
+ - description: S1 HLOS IFE and IFE_LITE non-protected stream
+
+ power-domains:
+ items:
+ - description: IFE0 GDSC - Global Distributed Switch Controller for IFE0.
+ - description: IFE1 GDSC - Global Distributed Switch Controller for IFE1.
+ - description: IFE2 GDSC - Global Distributed Switch Controller for IFE2.
+ - description: Titan GDSC - Global Distributed Switch Controller for the entire camss.
+
+ power-domain-names:
+ items:
+ - const: ife0
+ - const: ife1
+ - const: ife2
+ - const: top
+
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+
+ description:
+ CSI input ports.
+
+ patternProperties:
+ "^port@[0-5]$":
+ $ref: /schemas/graph.yaml#/$defs/port-base
+ unevaluatedProperties: false
+ description:
+ Input ports for receiving CSI data on CSIPHY 0-5.
+
+ properties:
+ endpoint:
+ $ref: video-interfaces.yaml#
+ unevaluatedProperties: false
+
+ properties:
+ data-lanes:
+ minItems: 1
+ maxItems: 4
+
+ bus-type:
+ enum:
+ - 1 # MEDIA_BUS_TYPE_CSI2_CPHY
+ - 4 # MEDIA_BUS_TYPE_CSI2_DPHY
+
+ required:
+ - data-lanes
+
+required:
+ - compatible
+ - reg
+ - reg-names
+ - clocks
+ - clock-names
+ - interrupts
+ - interrupt-names
+ - interconnects
+ - interconnect-names
+ - iommus
+ - power-domains
+ - power-domain-names
+ - ports
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/qcom,hawi-gcc.h>
+ #include <dt-bindings/clock/qcom,hawi-camcc.h>
+ #include <dt-bindings/interconnect/qcom,icc.h>
+ #include <dt-bindings/interconnect/qcom,hawi-rpmh.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/power/qcom,rpmhpd.h>
+
+ soc {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ isp@900b000 {
+ compatible = "qcom,hawi-camss";
+
+ reg = <0x0 0x0900b000 0x0 0x1000>,
+ <0x0 0x09253000 0x0 0x5e80>,
+ <0x0 0x09263000 0x0 0x5e80>,
+ <0x0 0x09273000 0x0 0x5e80>,
+ <0x0 0x092d3000 0x0 0x3880>,
+ <0x0 0x092e7000 0x0 0x3880>,
+ <0x0 0x093fd000 0x0 0x400>,
+ <0x0 0x093fe000 0x0 0x400>,
+ <0x0 0x093ff000 0x0 0x400>,
+ <0x0 0x09151000 0x0 0x20000>,
+ <0x0 0x09171000 0x0 0x20000>,
+ <0x0 0x09191000 0x0 0x20000>,
+ <0x0 0x092dc000 0x0 0x6800>,
+ <0x0 0x092f0000 0x0 0x6800>;
+ reg-names = "top",
+ "csid0",
+ "csid1",
+ "csid2",
+ "csid_lite0",
+ "csid_lite1",
+ "tpg0",
+ "tpg1",
+ "tpg2",
+ "vfe0",
+ "vfe1",
+ "vfe2",
+ "vfe_lite0",
+ "vfe_lite1";
+
+ clocks = <&camcc CAM_CC_CAMNOC_NRT_AXI_CLK>,
+ <&camcc CAM_CC_CAMNOC_RT_AXI_CLK>,
+ <&camcc CAM_CC_CAMNOC_DCD_XO_CLK>,
+ <&camcc CAM_CC_CAM_TOP_AHB_CLK>,
+ <&camcc CAM_CC_CAM_TOP_FAST_AHB_CLK>,
+ <&camcc CAM_CC_TITAN_MNOC_HF_CLK>,
+ <&camcc CAM_CC_TITAN_MNOC_SF_CLK>,
+ <&camcc CAM_CC_CAMNOC_RT_TFE_0_MAIN_CLK>,
+ <&camcc CAM_CC_CAMNOC_RT_TFE_1_MAIN_CLK>,
+ <&camcc CAM_CC_CAMNOC_RT_TFE_2_MAIN_CLK>,
+ <&camcc CAM_CC_CAMNOC_RT_IFE_LITE_CLK>,
+ <&camcc CAM_CC_CSID_CLK>,
+ <&camcc CAM_CC_CSID_CSIPHY_RX_CLK>,
+ <&gcc GCC_CAMERA_HF_AXI_CLK>,
+ <&gcc GCC_CAMERA_SF_AXI_CLK>,
+ <&camcc CAM_CC_TFE_0_MAIN_CLK>,
+ <&camcc CAM_CC_TFE_0_MAIN_FAST_AHB_CLK>,
+ <&camcc CAM_CC_TFE_1_MAIN_CLK>,
+ <&camcc CAM_CC_TFE_1_MAIN_FAST_AHB_CLK>,
+ <&camcc CAM_CC_TFE_2_MAIN_CLK>,
+ <&camcc CAM_CC_TFE_2_MAIN_FAST_AHB_CLK>,
+ <&camcc CAM_CC_IFE_LITE_CLK>,
+ <&camcc CAM_CC_IFE_LITE_AHB_CLK>,
+ <&camcc CAM_CC_IFE_LITE_CPHY_RX_CLK>,
+ <&camcc CAM_CC_IFE_LITE_CSID_CLK>,
+ <&camcc CAM_CC_QDSS_DEBUG_XO_CLK>;
+ clock-names = "camnoc_nrt_axi",
+ "camnoc_rt_axi",
+ "camnoc_dcd_xo",
+ "cpas_ahb",
+ "cpas_fast_ahb",
+ "cpas_mnoc_hf",
+ "cpas_mnoc_sf",
+ "cpas_vfe0",
+ "cpas_vfe1",
+ "cpas_vfe2",
+ "cpas_vfe_lite",
+ "csid",
+ "csiphy_rx",
+ "gcc_axi_hf",
+ "gcc_axi_sf",
+ "vfe0",
+ "vfe0_fast_ahb",
+ "vfe1",
+ "vfe1_fast_ahb",
+ "vfe2",
+ "vfe2_fast_ahb",
+ "vfe_lite",
+ "vfe_lite_ahb",
+ "vfe_lite_cphy_rx",
+ "vfe_lite_csid",
+ "qdss_debug_xo";
+
+ interrupts = <GIC_SPI 601 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 603 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 431 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 605 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 376 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 433 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 436 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 457 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 606 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 377 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "csid0",
+ "csid1",
+ "csid2",
+ "csid_lite0",
+ "csid_lite1",
+ "vfe0",
+ "vfe1",
+ "vfe2",
+ "vfe_lite0",
+ "vfe_lite1";
+
+ interconnects = <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_ONLY
+ &config_noc SLAVE_CAMERA_CFG QCOM_ICC_TAG_ACTIVE_ONLY>,
+ <&mmss_noc MASTER_CAMNOC_HF QCOM_ICC_TAG_ALWAYS
+ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
+ interconnect-names = "ahb",
+ "hf_mnoc";
+
+ iommus = <&apps_smmu 0x1800 0x00>;
+
+ power-domains = <&camcc CAM_CC_TFE_0_GDSC>,
+ <&camcc CAM_CC_TFE_1_GDSC>,
+ <&camcc CAM_CC_TFE_2_GDSC>,
+ <&camcc CAM_CC_TITAN_TOP_GDSC>;
+ power-domain-names = "ife0",
+ "ife1",
+ "ife2",
+ "top";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ camss_csiphy0_ep: endpoint {
+ data-lanes = <1 2 3 4>;
+ remote-endpoint = <&csiphy0_out>;
+ };
+ };
+ };
+ };
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v6 2/3] media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate
2026-12-03 8:17 [PATCH v6 0/3] Add CAMSS support for Qualcomm Hawi and Maili Nihal Kumar Gupta
2026-12-03 8:17 ` [PATCH v6 1/3] dt-bindings: media: Add CAMSS device for " Nihal Kumar Gupta
@ 2026-12-03 8:17 ` Nihal Kumar Gupta
2026-12-03 8:39 ` sashiko-bot
2026-12-03 8:17 ` [PATCH v6 3/3] media: qcom: camss: Add support for Hawi Nihal Kumar Gupta
2 siblings, 1 reply; 7+ messages in thread
From: Nihal Kumar Gupta @ 2026-12-03 8:17 UTC (permalink / raw)
To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Hangxiang Ma, Nihal Kumar Gupta,
Bryan O'Donoghue
Cc: Suresh Vankadara, Vikram Sharma, linux-media, linux-arm-msm,
devicetree, linux-kernel
From: Loic Poulain <loic.poulain@oss.qualcomm.com>
Only the gen1 "csiN" clocks are scaled with the link rate of the sensor,
the CSID core and CSIPHY receive clocks of all the other SoCs are set to
the first rate of the resource table. A SoC can therefore only be
described for one sensor bandwidth: the lowest rate first breaks fast
sensors, the highest one burns power with the slow ones.
Compute the minimum rate from the link frequency for all generations.
The CSIPHY passes each D-PHY lane to the CSID over an 8 bit wide
interface clocked by the receive clock, so that clock has to run at the
per lane bit rate divided by 8, which is link_freq / 4. The core clock
must not be slower, hence the same minimum for it and the cap of the
receive clock at the core rate. The clocks are matched by suffix and
voted for with clk_set_rate_range(), as the CSIDs of the recent SoCs
share them.
Up to 1.8 Gbps/lane the selected rates are unchanged on every supported
SoC.
Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
---
drivers/media/platform/qcom/camss/camss-csid.c | 206 ++++++++++++++++++++-----
1 file changed, 167 insertions(+), 39 deletions(-)
diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
index e8ecac3505b7789f84ecc233ebe62457b6690ff1..c007cf5d5357bb5aa12e071dc5547b9aa8ff2694 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.c
+++ b/drivers/media/platform/qcom/camss/camss-csid.c
@@ -16,6 +16,7 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
+#include <linux/string.h>
#include <media/media-entity.h>
#include <media/mipi-csi2.h>
#include <media/v4l2-device.h>
@@ -532,72 +533,197 @@ const struct csid_format_info *csid_get_fmt_entry(const struct csid_format_info
return &formats[0];
}
+/* Match the core clock of the CSID */
+static bool csid_match_core_clock_name(struct camss_clock *clock)
+{
+ /* "csid", "vfe0_csid", "vfe_lite_csid", ... */
+ if (strends(clock->name, "csid"))
+ return true;
+
+ /* Named after the CSI port on the SoCs with a gen1 CSID */
+ return !strcmp(clock->name, "csi0") || !strcmp(clock->name, "csi1") ||
+ !strcmp(clock->name, "csi2") || !strcmp(clock->name, "csi3");
+}
+
+/* Match the clock of the CSIPHY to CSID interface */
+static bool csid_match_phy_rx_clock_name(struct camss_clock *clock)
+{
+ /* "csiphy_rx", "csid_csiphy_rx", "vfe0_cphy_rx", ... */
+ return strends(clock->name, "phy_rx");
+}
+
+/* Match a clock whose rate depends on the CSI-2 link rate */
+static bool csid_match_scaled_clock_name(struct camss_clock *clock)
+{
+ return csid_match_core_clock_name(clock) ||
+ csid_match_phy_rx_clock_name(clock);
+}
+
/*
- * csid_set_clock_rates - Calculate and set clock rates on CSID module
- * @csiphy: CSID device
+ * csid_get_min_clock_rate - Get the rate the CSI-2 link requires
+ * @csid: CSID device
+ *
+ * The CSIPHY deserialises every D-PHY data lane into bytes and passes them to
+ * the CSID over an interface which is, as per the CSID HPG, 8 bits wide per
+ * lane and clocked by the CSIPHY receive clock. That clock has to run at the
+ * per lane bit rate divided by 8 at the very least. The link frequency is the
+ * DDR clock of the link, i.e. half the per lane bit rate, which makes the
+ * minimum rate link_freq / 4.
+ *
+ * Qualcomm recommends clocking the CSID core at least as fast as the CSIPHY
+ * receive clock feeding it, so the same minimum applies to the core clock.
+ *
+ * C-PHY maps 16 bits onto 7 symbols and needs a different ratio, but CAMSS
+ * does not support it so far.
+ *
+ * Return the minimum rate in Hz, clock margin included, or 0 if the link
+ * frequency of the sensor is not known
*/
-static int csid_set_clock_rates(struct csid_device *csid)
+static u64 csid_get_min_clock_rate(struct csid_device *csid)
{
- struct device *dev = csid->camss->dev;
const struct csid_format_info *fmt;
s64 link_freq;
- int i, j;
- int ret;
+ u64 min_rate;
fmt = csid_get_fmt_entry(csid->res->formats->formats, csid->res->formats->nformats,
- csid->fmt[MSM_CSIPHY_PAD_SINK].code);
+ csid->fmt[MSM_CSID_PAD_SINK].code);
link_freq = camss_get_link_freq(&csid->subdev.entity, fmt->bpp,
csid->phy.lane_cnt);
if (link_freq < 0)
- link_freq = 0;
+ return 0;
+
+ min_rate = link_freq / 4;
+ camss_add_clock_margin(&min_rate);
+
+ return min_rate;
+}
+
+/* Get the lowest level of a clock above min_rate, or -EINVAL if there is none */
+static int csid_find_clock_level(struct camss_clock *clock, u64 min_rate)
+{
+ int i;
+
+ /* Play safe with the highest level if the link rate is not known */
+ if (!min_rate)
+ return clock->nfreqs - 1;
+
+ for (i = 0; i < clock->nfreqs; i++)
+ if (clock->freq[i] > min_rate)
+ return i;
+
+ return -EINVAL;
+}
+
+/* Lower a level down to max_rate, but never below what min_rate needs */
+static int csid_cap_clock_level(struct camss_clock *clock, int level,
+ u64 min_rate, u64 max_rate)
+{
+ while (level > 0 && clock->freq[level] > max_rate &&
+ clock->freq[level - 1] > min_rate)
+ level--;
+
+ return level;
+}
+
+/*
+ * csid_set_clock_rates - Calculate and set clock rates on CSID module
+ * @csid: CSID device
+ */
+static int csid_set_clock_rates(struct csid_device *csid)
+{
+ struct device *dev = csid->camss->dev;
+ u64 min_rate = csid_get_min_clock_rate(csid);
+ u64 core_rate = 0;
+ int i, j;
+ int ret;
+
+ /*
+ * Settle the rate of the core clock first, as the receive clock must
+ * not outrun it and the clocks are not listed in a fixed order.
+ */
for (i = 0; i < csid->nclocks; i++) {
struct camss_clock *clock = &csid->clock[i];
- if (!strcmp(clock->name, "csi0") ||
- !strcmp(clock->name, "csi1") ||
- !strcmp(clock->name, "csi2") ||
- !strcmp(clock->name, "csi3")) {
- u64 min_rate = link_freq / 4;
- long rate;
+ if (!clock->nfreqs || !csid_match_core_clock_name(clock))
+ continue;
- camss_add_clock_margin(&min_rate);
+ j = csid_find_clock_level(clock, min_rate);
+ if (j < 0) {
+ dev_err(dev, "Link rate is too high for the %s clock\n",
+ clock->name);
+ return j;
+ }
- for (j = 0; j < clock->nfreqs; j++)
- if (min_rate < clock->freq[j])
- break;
+ core_rate = max_t(u64, core_rate, clock->freq[j]);
+ }
- if (j == clock->nfreqs) {
- dev_err(dev,
- "Pixel clock is too high for CSID\n");
- return -EINVAL;
- }
+ for (i = 0; i < csid->nclocks; i++) {
+ struct camss_clock *clock = &csid->clock[i];
- /* if sensor pixel clock is not available */
- /* set highest possible CSID clock rate */
- if (min_rate == 0)
- j = clock->nfreqs - 1;
+ if (!clock->nfreqs)
+ continue;
- rate = clk_round_rate(clock->clk, clock->freq[j]);
- if (rate < 0) {
- dev_err(dev, "clk round rate failed: %ld\n",
- rate);
- return -EINVAL;
- }
+ if (!csid_match_scaled_clock_name(clock)) {
+ /* The remaining clocks run at their lowest level */
- ret = clk_set_rate(clock->clk, rate);
- if (ret < 0) {
- dev_err(dev, "clk set rate failed: %d\n", ret);
- return ret;
- }
- } else if (clock->nfreqs) {
clk_set_rate(clock->clk, clock->freq[0]);
+ continue;
+ }
+
+ j = csid_find_clock_level(clock, min_rate);
+ if (j < 0) {
+ dev_err(dev, "Link rate is too high for the %s clock\n",
+ clock->name);
+ return j;
+ }
+
+ /*
+ * There is nothing to gain from running the receive clock
+ * faster than the core clock, as long as the link rate is
+ * still covered.
+ */
+ if (core_rate && csid_match_phy_rx_clock_name(clock))
+ j = csid_cap_clock_level(clock, j, min_rate, core_rate);
+
+ /*
+ * Vote for the rate as a minimum, as the clock may be shared
+ * with another CSID which needs it to run faster.
+ */
+ ret = clk_set_rate_range(clock->clk, clock->freq[j], ULONG_MAX);
+ if (ret < 0) {
+ dev_err(dev, "clk set rate range failed: %d\n", ret);
+ return ret;
}
}
return 0;
}
+/*
+ * Drop the minimum rates the CSID votes for and take its clocks back to their
+ * lowest level, or to the lowest level the other users of a shared clock need.
+ */
+static void csid_release_clock_rates(struct csid_device *csid)
+{
+ int i;
+
+ for (i = 0; i < csid->nclocks; i++) {
+ struct camss_clock *clock = &csid->clock[i];
+ long rate;
+
+ if (!clock->nfreqs || !csid_match_scaled_clock_name(clock))
+ continue;
+
+ clk_drop_range(clock->clk);
+
+ /* Round first, so that the rate respects the other votes */
+ rate = clk_round_rate(clock->clk, clock->freq[0]);
+ if (rate > 0)
+ clk_set_rate(clock->clk, rate);
+ }
+}
+
/*
* csid_hw_version - CSID hardware version query
* @csid: CSID device
@@ -723,6 +849,7 @@ static int csid_set_power(struct v4l2_subdev *sd, int on)
} else {
disable_irq(csid->irq);
camss_disable_clocks(csid->nclocks, csid->clock);
+ csid_release_clock_rates(csid);
regulator_bulk_disable(csid->num_supplies,
csid->supplies);
pm_runtime_put_sync(dev);
@@ -735,6 +862,7 @@ static int csid_set_power(struct v4l2_subdev *sd, int on)
disable_irq(csid->irq);
camss_disable_clocks(csid->nclocks, csid->clock);
err_regulators_disable:
+ csid_release_clock_rates(csid);
regulator_bulk_disable(csid->num_supplies, csid->supplies);
err_pm_put:
pm_runtime_put_sync(dev);
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v6 3/3] media: qcom: camss: Add support for Hawi
2026-12-03 8:17 [PATCH v6 0/3] Add CAMSS support for Qualcomm Hawi and Maili Nihal Kumar Gupta
2026-12-03 8:17 ` [PATCH v6 1/3] dt-bindings: media: Add CAMSS device for " Nihal Kumar Gupta
2026-12-03 8:17 ` [PATCH v6 2/3] media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate Nihal Kumar Gupta
@ 2026-12-03 8:17 ` Nihal Kumar Gupta
2026-12-03 8:50 ` sashiko-bot
2 siblings, 1 reply; 7+ messages in thread
From: Nihal Kumar Gupta @ 2026-12-03 8:17 UTC (permalink / raw)
To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Hangxiang Ma, Nihal Kumar Gupta,
Bryan O'Donoghue
Cc: Suresh Vankadara, Vikram Sharma, linux-media, linux-arm-msm,
devicetree, linux-kernel
From: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Add CAMSS support for the Hawi SoC. The CSIPHY resource table is reused
from Kaanapali and the TPG table from X1E80100.
Hawi calls its front-end blocks TFEs (Thin Front Ends), but the VFE 1190
driver keeps the VFE naming for consistency. The common CPAS clocks are
managed as PM clocks of the CAMSS resources rather than per-VFE clocks.
CSID 1190 splits RUP and AUP updates into separate registers committed
through a SET register, so the driver provides separate reg_update and
addr_update operations, and VFE 1190 wires up addr_update. The SOF and
EOF INFO bits are also defined.
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Co-developed-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
---
drivers/media/platform/qcom/camss/Makefile | 2 +
.../media/platform/qcom/camss/camss-csid-1190.c | 417 +++++++++++++++++++++
drivers/media/platform/qcom/camss/camss-csid.h | 1 +
drivers/media/platform/qcom/camss/camss-vfe-1190.c | 217 +++++++++++
drivers/media/platform/qcom/camss/camss-vfe.c | 1 +
drivers/media/platform/qcom/camss/camss-vfe.h | 1 +
drivers/media/platform/qcom/camss/camss.c | 233 ++++++++++++
drivers/media/platform/qcom/camss/camss.h | 1 +
8 files changed, 873 insertions(+)
diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/media/platform/qcom/camss/Makefile
index 42a14e8fe1b7f28ba5ffcbe59769093b08db4d6b..e48df14933fa0e2b1910de5e68bec0b5c57dd1b2 100644
--- a/drivers/media/platform/qcom/camss/Makefile
+++ b/drivers/media/platform/qcom/camss/Makefile
@@ -9,6 +9,7 @@ qcom-camss-objs += \
camss-csid-340.o \
camss-csid-680.o \
camss-csid-1080.o \
+ camss-csid-1190.o \
camss-csid-gen2.o \
camss-csid-gen3.o \
camss-csiphy.o \
@@ -27,6 +28,7 @@ qcom-camss-objs += \
camss-vfe-480.o \
camss-vfe-680.o \
camss-vfe-1080.o \
+ camss-vfe-1190.o \
camss-vfe-gen1.o \
camss-vfe-gen3.o \
camss-vfe-vbif.o \
diff --git a/drivers/media/platform/qcom/camss/camss-csid-1190.c b/drivers/media/platform/qcom/camss/camss-csid-1190.c
new file mode 100644
index 0000000000000000000000000000000000000000..e3eb17b8ec5d335154041caf43ce68b4432295fa
--- /dev/null
+++ b/drivers/media/platform/qcom/camss/camss-csid-1190.c
@@ -0,0 +1,417 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * camss-csid-1190.c
+ *
+ * Qualcomm MSM Camera Subsystem - CSID (CSI Decoder) Module
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+#include <linux/completion.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/of.h>
+
+#include "camss.h"
+#include "camss-csid.h"
+#include "camss-csid-gen3.h"
+
+/* Reset and Command Registers */
+#define CSID_RST_CFG 0x108
+#define RST_MODE BIT(0)
+#define RST_LOCATION BIT(4)
+
+/* Reset and Command Registers */
+#define CSID_RST_CMD 0x10C
+#define SELECT_HW_RST BIT(0)
+#define SELECT_IRQ_RST BIT(2)
+#define CSID_IRQ_CMD 0x110
+#define IRQ_CMD_CLEAR BIT(0)
+
+/* Register Update Commands, RUP/AUP */
+#define CSID_RUP_CMD 0x114
+#define CSID_AUP_CMD 0x118
+#define CSID_RUP_AUP_RDI(rdi) (BIT(8) << (rdi))
+#define CSID_RUP_AUP_CMD 0x11C
+#define RUP_SET BIT(0)
+#define MUP BIT(4)
+
+/* Top level interrupt registers */
+#define CSID_TOP_IRQ_STATUS 0x180
+#define CSID_TOP_IRQ_MASK 0x184
+#define CSID_TOP_IRQ_CLEAR 0x188
+#define INFO_RST_DONE BIT(0)
+#define CSI2_RX_IRQ_STATUS BIT(2)
+#define BUF_DONE_IRQ_STATUS BIT(3)
+#define TOP_IRQ_STATUS_RDI_OFFSET 16
+
+/* Buffer done interrupt registers */
+#define CSID_BUF_DONE_IRQ_STATUS 0x1A0
+#define BUF_DONE_IRQ_STATUS_RDI_OFFSET 16
+#define CSID_BUF_DONE_IRQ_MASK 0x1A4
+#define CSID_BUF_DONE_IRQ_CLEAR 0x1A8
+#define CSID_BUF_DONE_IRQ_SET 0x1AC
+
+/* CSI2 RX interrupt registers */
+#define CSID_CSI2_RX_IRQ_STATUS 0x1B0
+#define CSID_CSI2_RX_IRQ_MASK 0x1B4
+#define CSID_CSI2_RX_IRQ_CLEAR 0x1B8
+#define CSID_CSI2_RX_IRQ_SET 0x1BC
+
+/* CSI2 RX Configuration */
+#define CSID_CSI2_RX_CFG0 0x880
+#define CSI2_RX_CFG0_NUM_ACTIVE_LANES 0
+#define CSI2_RX_CFG0_DL0_INPUT_SEL 4
+#define CSI2_RX_CFG0_PHY_NUM_SEL 20
+#define CSI2_RX_CFG0_TPG_MUX_EN BIT(27)
+#define CSI2_RX_CFG0_TPG_MUX_SEL GENMASK(29, 28)
+#define CSI2_RX_CFG0_PHY_SEL_BASE_IDX 1
+#define CSID_CSI2_RX_CFG1 0x884
+#define CSI2_RX_CFG1_ECC_CORRECTION_EN BIT(0)
+#define CSI2_RX_CFG1_VC_MODE BIT(2)
+
+#define MSM_CSID_MAX_SRC_STREAMS_1190 (csid_is_lite(csid) ? 4 : 5)
+
+/* RDI Configuration */
+#define CSID_RDI_CFG0(rdi) (csid_is_lite(csid) ?\
+ (0x3080 + 0x200 * (rdi)) :\
+ (0x5480 + 0x200 * (rdi)))
+#define RDI_CFG0_RETIME_BS BIT(5)
+#define RDI_CFG0_TIMESTAMP_EN BIT(6)
+#define RDI_CFG0_TIMESTAMP_STB_SEL BIT(8)
+#define RDI_CFG0_DECODE_FORMAT 12
+#define RDI_CFG0_DT 16
+#define RDI_CFG0_VC 22
+#define RDI_CFG0_EN BIT(31)
+
+/* RDI Control and Configuration */
+#define CSID_RDI_CTRL(rdi) (csid_is_lite(csid) ?\
+ (0x3088 + 0x200 * (rdi)) :\
+ (0x5488 + 0x200 * (rdi)))
+#define RDI_CTRL_START_CMD BIT(0)
+
+#define CSID_RDI_CFG1(rdi) (csid_is_lite(csid) ?\
+ (0x3094 + 0x200 * (rdi)) :\
+ (0x5494 + 0x200 * (rdi)))
+#define RDI_CFG1_DROP_H_EN BIT(5)
+#define RDI_CFG1_DROP_V_EN BIT(6)
+#define RDI_CFG1_CROP_H_EN BIT(7)
+#define RDI_CFG1_CROP_V_EN BIT(8)
+#define RDI_CFG1_PACKING_FORMAT_MIPI BIT(15)
+
+/* RDI Pixel Store Configuration */
+#define CSID_RDI_PIX_STORE_CFG0(rdi) (0x5498 + 0x200 * (rdi))
+#define RDI_PIX_STORE_CFG0_EN BIT(0)
+#define RDI_PIX_STORE_CFG0_MIN_HBI 1
+
+/* RDI IRQ Status in wrapper */
+#define CSID_CSI2_RDIN_IRQ_STATUS(rdi) (0x224 + (0x10 * (rdi)))
+#define CSID_CSI2_RDIN_IRQ_MASK(rdi) (0x228 + (0x10 * (rdi)))
+#define CSID_CSI2_RDIN_IRQ_CLEAR(rdi) (0x22C + (0x10 * (rdi)))
+#define INFO_RUP_DONE BIT(23)
+#define INFO_INPUT_SOF BIT(12)
+#define INFO_INPUT_EOF BIT(9)
+#define INFO_CAMIF_SOF BIT(4)
+#define INFO_CAMIF_EOF BIT(3)
+
+static void __csid_aup_rup_trigger(struct csid_device *csid)
+{
+ /* trigger SET in combined register */
+ writel(RUP_SET, csid->base + CSID_RUP_AUP_CMD);
+}
+
+static void __csid_addr_update(struct csid_device *csid, int port_id)
+{
+ csid->addr_update |= CSID_RUP_AUP_RDI(port_id);
+ writel(csid->addr_update, csid->base + CSID_AUP_CMD);
+
+ __csid_aup_rup_trigger(csid);
+}
+
+static void __csid_addr_update_clear(struct csid_device *csid, int port_id)
+{
+ /* Hardware clears the registers upon consuming the settings */
+ csid->addr_update &= ~CSID_RUP_AUP_RDI(port_id);
+}
+
+static void __csid_reg_update(struct csid_device *csid, int port_id)
+{
+ csid->reg_update |= CSID_RUP_AUP_RDI(port_id);
+ writel(csid->reg_update, csid->base + CSID_RUP_CMD);
+
+ __csid_aup_rup_trigger(csid);
+}
+
+static void __csid_reg_update_clear(struct csid_device *csid, int port_id)
+{
+ /* Hardware clears the registers upon consuming the settings */
+ csid->reg_update &= ~CSID_RUP_AUP_RDI(port_id);
+}
+
+static void __csid_configure_rx(struct csid_device *csid,
+ struct csid_phy_config *phy)
+{
+ struct camss *camss = csid->camss;
+ u8 lane_cnt = phy->lane_cnt;
+ int val;
+
+ if (!lane_cnt)
+ lane_cnt = 4;
+
+ val = (lane_cnt - 1) << CSI2_RX_CFG0_NUM_ACTIVE_LANES;
+ val |= phy->lane_assign << CSI2_RX_CFG0_DL0_INPUT_SEL;
+
+ if (camss->tpg && csid->tpg_linked &&
+ camss->tpg[phy->csiphy_id].testgen.mode != TPG_PAYLOAD_MODE_DISABLED) {
+ val |= FIELD_PREP(CSI2_RX_CFG0_TPG_MUX_SEL, phy->csiphy_id + 1);
+ val |= CSI2_RX_CFG0_TPG_MUX_EN;
+ } else {
+ val |= (phy->csiphy_id + CSI2_RX_CFG0_PHY_SEL_BASE_IDX)
+ << CSI2_RX_CFG0_PHY_NUM_SEL;
+ }
+
+ writel(val, csid->base + CSID_CSI2_RX_CFG0);
+
+ val = CSI2_RX_CFG1_ECC_CORRECTION_EN;
+ writel(val, csid->base + CSID_CSI2_RX_CFG1);
+}
+
+static void __csid_configure_rx_vc(struct csid_device *csid, int vc)
+{
+ int val;
+
+ if (vc > 3) {
+ val = readl(csid->base + CSID_CSI2_RX_CFG1);
+ val |= CSI2_RX_CFG1_VC_MODE;
+ writel(val, csid->base + CSID_CSI2_RX_CFG1);
+ }
+}
+
+static void __csid_ctrl_rdi(struct csid_device *csid, int enable, u8 rdi)
+{
+ int val = 0;
+
+ if (enable)
+ val = RDI_CTRL_START_CMD;
+
+ writel(val, csid->base + CSID_RDI_CTRL(rdi));
+}
+
+static void __csid_configure_rdi_pix_store(struct csid_device *csid, u8 rdi)
+{
+ u32 val;
+
+ /*
+ * Configure pixel store to allow absorption of hblanking or idle time.
+ * This helps with horizontal crop and prevents line buffer conflicts.
+ * Reset state is 0x8 which has MIN_HBI=4, we keep the default MIN_HBI
+ * and just enable the pixel store functionality.
+ */
+ val = (4 << RDI_PIX_STORE_CFG0_MIN_HBI) | RDI_PIX_STORE_CFG0_EN;
+ writel(val, csid->base + CSID_RDI_PIX_STORE_CFG0(rdi));
+}
+
+static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enable, u8 port, u8 vc)
+{
+ u32 val;
+ u8 lane_cnt = csid->phy.lane_cnt;
+
+ /* Source pads matching RDI channels on hardware.
+ * E.g. Pad 1 -> RDI0, Pad 2 -> RDI1, etc.
+ */
+ struct v4l2_mbus_framefmt *input_format = &csid->fmt[MSM_CSID_PAD_FIRST_SRC + port];
+ const struct csid_format_info *format = csid_get_fmt_entry(csid->res->formats->formats,
+ csid->res->formats->nformats,
+ input_format->code);
+
+ if (!lane_cnt)
+ lane_cnt = 4;
+
+ val = RDI_CFG0_TIMESTAMP_EN;
+ val |= RDI_CFG0_TIMESTAMP_STB_SEL;
+ val |= RDI_CFG0_RETIME_BS;
+
+ /* note: for non-RDI path, this should be format->decode_format */
+ val |= DECODE_FORMAT_PAYLOAD_ONLY << RDI_CFG0_DECODE_FORMAT;
+ val |= vc << RDI_CFG0_VC;
+ val |= format->data_type << RDI_CFG0_DT;
+ writel(val, csid->base + CSID_RDI_CFG0(port));
+
+ val = RDI_CFG1_PACKING_FORMAT_MIPI;
+ writel(val, csid->base + CSID_RDI_CFG1(port));
+
+ /* Configure pixel store using dedicated register in 1190 */
+ if (!csid_is_lite(csid))
+ __csid_configure_rdi_pix_store(csid, port);
+
+ val = 0;
+ writel(val, csid->base + CSID_RDI_CTRL(port));
+
+ val = readl(csid->base + CSID_RDI_CFG0(port));
+
+ if (enable)
+ val |= RDI_CFG0_EN;
+
+ writel(val, csid->base + CSID_RDI_CFG0(port));
+}
+
+static void csid_configure_stream(struct csid_device *csid, u8 enable)
+{
+ u8 i, k;
+
+ __csid_configure_rx(csid, &csid->phy);
+
+ for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS_1190; i++) {
+ if (csid->phy.en_vc & BIT(i)) {
+ __csid_configure_rdi_stream(csid, enable, i, 0);
+ __csid_configure_rx_vc(csid, 0);
+
+ for (k = 0; k < CAMSS_INIT_BUF_COUNT; k++)
+ __csid_addr_update(csid, i);
+
+ __csid_reg_update(csid, i);
+
+ __csid_ctrl_rdi(csid, enable, i);
+ }
+ }
+}
+
+static int csid_configure_testgen_pattern(struct csid_device *csid, s32 val)
+{
+ return 0;
+}
+
+static void csid_subdev_reg_update(struct csid_device *csid, int port_id,
+ bool clear)
+{
+ if (clear)
+ __csid_reg_update_clear(csid, port_id);
+ else
+ __csid_reg_update(csid, port_id);
+}
+
+static void csid_subdev_addr_update(struct csid_device *csid, int port_id,
+ bool clear)
+{
+ if (clear)
+ __csid_addr_update_clear(csid, port_id);
+ else
+ __csid_addr_update(csid, port_id);
+}
+
+/**
+ * csid_isr - CSID module interrupt service routine
+ * @irq: Interrupt line
+ * @dev: CSID device
+ *
+ * Return IRQ_HANDLED on success
+ */
+static irqreturn_t csid_isr(int irq, void *dev)
+{
+ struct csid_device *csid = dev;
+ u32 val, buf_done_val;
+ u8 reset_done;
+ int i;
+
+ val = readl(csid->base + CSID_TOP_IRQ_STATUS);
+ writel(val, csid->base + CSID_TOP_IRQ_CLEAR);
+
+ reset_done = val & INFO_RST_DONE;
+
+ buf_done_val = readl(csid->base + CSID_BUF_DONE_IRQ_STATUS);
+ writel(buf_done_val, csid->base + CSID_BUF_DONE_IRQ_CLEAR);
+
+ for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS_1190; i++) {
+ if (csid->phy.en_vc & BIT(i)) {
+ val = readl(csid->base + CSID_CSI2_RDIN_IRQ_STATUS(i));
+ writel(val, csid->base + CSID_CSI2_RDIN_IRQ_CLEAR(i));
+
+ if (val & INFO_RUP_DONE) {
+ __csid_addr_update_clear(csid, i);
+ __csid_reg_update_clear(csid, i);
+ }
+
+ if (buf_done_val & BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i))
+ camss_buf_done(csid->camss, csid_index(csid), i);
+ }
+ }
+
+ val = IRQ_CMD_CLEAR;
+ writel(val, csid->base + CSID_IRQ_CMD);
+
+ if (reset_done)
+ complete(&csid->reset_complete);
+
+ return IRQ_HANDLED;
+}
+
+/**
+ * csid_reset - Trigger reset on CSID module and wait to complete
+ * @csid: CSID device
+ *
+ * Return 0 on success or a negative error code otherwise
+ */
+static int csid_reset(struct csid_device *csid)
+{
+ unsigned long time;
+ u32 val;
+ int i;
+
+ reinit_completion(&csid->reset_complete);
+
+ val = INFO_RST_DONE | BUF_DONE_IRQ_STATUS;
+ writel(val, csid->base + CSID_TOP_IRQ_CLEAR);
+ writel(val, csid->base + CSID_TOP_IRQ_MASK);
+
+ val = 0;
+ for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS_1190; i++) {
+ if (csid->phy.en_vc & BIT(i)) {
+ /*
+ * Only need to clear buf done IRQ status here,
+ * RUP done IRQ status will be cleared once isr
+ * strobe generated by CSID_RST_CMD
+ */
+ val |= BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i);
+ }
+ }
+ writel(val, csid->base + CSID_BUF_DONE_IRQ_CLEAR);
+ writel(val, csid->base + CSID_BUF_DONE_IRQ_MASK);
+
+ /* Clear all IRQ status with CLEAR bits set */
+ val = IRQ_CMD_CLEAR;
+ writel(val, csid->base + CSID_IRQ_CMD);
+
+ val = RST_LOCATION | RST_MODE;
+ writel(val, csid->base + CSID_RST_CFG);
+
+ val = SELECT_HW_RST | SELECT_IRQ_RST;
+ writel(val, csid->base + CSID_RST_CMD);
+
+ time = wait_for_completion_timeout(&csid->reset_complete,
+ msecs_to_jiffies(CSID_RESET_TIMEOUT_MS));
+
+ if (!time) {
+ dev_err(csid->camss->dev, "CSID reset timeout\n");
+ return -EIO;
+ }
+
+ return 0;
+}
+
+static void csid_subdev_init(struct csid_device *csid)
+{
+ csid->testgen.nmodes = CSID_PAYLOAD_MODE_DISABLED;
+}
+
+const struct csid_hw_ops csid_ops_1190 = {
+ .configure_stream = csid_configure_stream,
+ .configure_testgen_pattern = csid_configure_testgen_pattern,
+ .hw_version = csid_hw_version,
+ .isr = csid_isr,
+ .reset = csid_reset,
+ .src_pad_code = csid_src_pad_code,
+ .subdev_init = csid_subdev_init,
+ .reg_update = csid_subdev_reg_update,
+ .addr_update = csid_subdev_addr_update,
+};
diff --git a/drivers/media/platform/qcom/camss/camss-csid.h b/drivers/media/platform/qcom/camss/camss-csid.h
index a0a4ec41e9264c285a4a510b4e903a7316da1f63..cf77d21ebf039ab65cf8814c40d2c8297728dc57 100644
--- a/drivers/media/platform/qcom/camss/camss-csid.h
+++ b/drivers/media/platform/qcom/camss/camss-csid.h
@@ -230,6 +230,7 @@ extern const struct csid_hw_ops csid_ops_4_7;
extern const struct csid_hw_ops csid_ops_340;
extern const struct csid_hw_ops csid_ops_680;
extern const struct csid_hw_ops csid_ops_1080;
+extern const struct csid_hw_ops csid_ops_1190;
extern const struct csid_hw_ops csid_ops_gen2;
extern const struct csid_hw_ops csid_ops_gen3;
diff --git a/drivers/media/platform/qcom/camss/camss-vfe-1190.c b/drivers/media/platform/qcom/camss/camss-vfe-1190.c
new file mode 100644
index 0000000000000000000000000000000000000000..246519c2294b8d5021ebdd95e056f00d20897a0f
--- /dev/null
+++ b/drivers/media/platform/qcom/camss/camss-vfe-1190.c
@@ -0,0 +1,217 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * camss-vfe-1190.c
+ *
+ * Qualcomm MSM Camera Subsystem - VFE (Video Front End) Module 1190
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/iopoll.h>
+
+#include "camss.h"
+#include "camss-vfe.h"
+
+/* VFE-1190 Bus Register Base Addresses */
+#define BUS_REG_BASE (0x800)
+#define BUS_REG_OFFSET(n) (0x1000 + (n) * 0x200)
+
+#define VFE_BUS_WM_CGC_OVERRIDE (BUS_REG_BASE + 0x4)
+#define WM_CGC_OVERRIDE_ALL (0x7FFFFFF)
+
+#define VFE_BUS_WM_TEST_BUS_CTRL (BUS_REG_BASE + 0x144)
+
+#define VFE_BUS_WM_CFG(n) (BUS_REG_BASE + BUS_REG_OFFSET(n))
+#define WM_CFG_EN BIT(0)
+#define WM_VIR_FRM_EN BIT(1)
+#define WM_CFG_MODE BIT(16)
+#define VFE_BUS_WM_IMAGE_ADDR(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0x4)
+#define VFE_BUS_WM_FRAME_INCR(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0x8)
+#define VFE_BUS_WM_IMAGE_CFG_0(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0xC)
+#define WM_IMAGE_CFG_0_DEFAULT_WIDTH (0xFFFF)
+#define VFE_BUS_WM_IMAGE_CFG_2(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0x14)
+#define WM_IMAGE_CFG_2_DEFAULT_STRIDE (0xFFFF)
+#define VFE_BUS_WM_PACKER_CFG(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0x18)
+
+#define VFE_BUS_WM_IRQ_SUBSAMPLE_PERIOD(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0x30)
+#define VFE_BUS_WM_IRQ_SUBSAMPLE_PATTERN(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0x34)
+
+/* VFE lite has no such registers */
+#define VFE_BUS_WM_FRAMEDROP_PERIOD(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0x38)
+#define VFE_BUS_WM_FRAMEDROP_PATTERN(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0x3C)
+
+#define VFE_BUS_WM_MMU_PREFETCH_CFG(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0x64)
+#define VFE_BUS_WM_MMU_PREFETCH_MAX_OFFSET(n) (BUS_REG_BASE + BUS_REG_OFFSET(n) + 0x68)
+
+/*
+ * VFE 1190 write master client IDs
+ *
+ * VIDEO_FULL_Y 0
+ * VIDEO_FULL_UV 1
+ * VIDEO_DC4_Y 2
+ * VIDEO_DC4_C 3
+ * VIDEO_DC16_Y 4
+ * VIDEO_DC16_C 5
+ * FD_Y 6
+ * FD_C 7
+ * RAW_OUT 8
+ * STATS_AEC_BG 9
+ * STATS_AEC_BHIST 10
+ * STATS_TINTLESS_BG 11
+ * STATS_AWB_BG 12
+ * STATS_AWB_BFW 13
+ * STATS_AF_BHIST 14
+ * STATS_ALSC_BG 15
+ * STATS_FLICKER_BAYERRS 16
+ * STATS_TMC_BHIST 17
+ * PDAF_0 18
+ * PDAF_1 19
+ * PDAF_2 20
+ * PDAF_3 21
+ * PDAF_4 22
+ * RDI0 23
+ * RDI1 24
+ * RDI2 25
+ * RDI3 26
+ * RDI4 27
+ * C2PA Y 28
+ * C2PA C 29
+ *
+ * VFE Lite 1190 write master client IDs
+ *
+ * RDI0 0
+ * RDI1 1
+ * RDI2 2
+ * RDI3 3
+ * GAMMA 4
+ * STATES_BG 5
+ */
+#define RDI_WM(n) ((vfe_is_lite(vfe) ? 0x0 : 0x17) + (n))
+
+static void vfe_wm_start(struct vfe_device *vfe, u8 wm, struct vfe_line *line)
+{
+ struct v4l2_pix_format_mplane *pix =
+ &line->video_out.active_fmt.fmt.pix_mp;
+
+ wm = RDI_WM(wm);
+
+ /* no clock gating at bus input */
+ writel(WM_CGC_OVERRIDE_ALL, vfe->base + VFE_BUS_WM_CGC_OVERRIDE);
+
+ writel(0x0, vfe->base + VFE_BUS_WM_TEST_BUS_CTRL);
+
+ writel(ALIGN(pix->plane_fmt[0].bytesperline, 16) * pix->height >> 8,
+ vfe->base + VFE_BUS_WM_FRAME_INCR(wm));
+ writel((WM_IMAGE_CFG_0_DEFAULT_WIDTH & 0xFFFF),
+ vfe->base + VFE_BUS_WM_IMAGE_CFG_0(wm));
+ writel(WM_IMAGE_CFG_2_DEFAULT_STRIDE,
+ vfe->base + VFE_BUS_WM_IMAGE_CFG_2(wm));
+ writel(0, vfe->base + VFE_BUS_WM_PACKER_CFG(wm));
+
+ /* no dropped frames, one irq per frame */
+ if (!vfe_is_lite(vfe)) {
+ writel(0, vfe->base + VFE_BUS_WM_FRAMEDROP_PERIOD(wm));
+ writel(1, vfe->base + VFE_BUS_WM_FRAMEDROP_PATTERN(wm));
+ }
+
+ writel(0, vfe->base + VFE_BUS_WM_IRQ_SUBSAMPLE_PERIOD(wm));
+ writel(1, vfe->base + VFE_BUS_WM_IRQ_SUBSAMPLE_PATTERN(wm));
+
+ writel(1, vfe->base + VFE_BUS_WM_MMU_PREFETCH_CFG(wm));
+ writel(0xFFFFFFFF, vfe->base + VFE_BUS_WM_MMU_PREFETCH_MAX_OFFSET(wm));
+
+ writel(WM_CFG_EN | WM_CFG_MODE, vfe->base + VFE_BUS_WM_CFG(wm));
+}
+
+static void vfe_wm_stop(struct vfe_device *vfe, u8 wm)
+{
+ wm = RDI_WM(wm);
+ writel(0, vfe->base + VFE_BUS_WM_CFG(wm));
+}
+
+static void vfe_wm_update(struct vfe_device *vfe, u8 wm, u32 addr,
+ struct vfe_line *line)
+{
+ wm = RDI_WM(wm);
+ writel(addr >> 8, vfe->base + VFE_BUS_WM_IMAGE_ADDR(wm));
+
+ dev_dbg(vfe->camss->dev, "wm:%d, image buf addr:0x%x\n", wm, addr);
+}
+
+static void vfe_reg_update(struct vfe_device *vfe, enum vfe_line_id line_id)
+{
+ int port_id = line_id;
+
+ camss_reg_update(vfe->camss, vfe->id, port_id, false);
+}
+
+static inline void vfe_reg_update_clear(struct vfe_device *vfe,
+ enum vfe_line_id line_id)
+{
+ int port_id = line_id;
+
+ camss_reg_update(vfe->camss, vfe->id, port_id, true);
+}
+
+static void vfe_addr_update(struct vfe_device *vfe, enum vfe_line_id line_id)
+{
+ int port_id = line_id;
+
+ camss_addr_update(vfe->camss, vfe->id, port_id, false);
+}
+
+static inline void vfe_addr_update_clear(struct vfe_device *vfe,
+ enum vfe_line_id line_id)
+{
+ int port_id = line_id;
+
+ camss_addr_update(vfe->camss, vfe->id, port_id, true);
+}
+
+static const struct camss_video_ops vfe_video_ops_1190 = {
+ .queue_buffer = vfe_queue_buffer_v2,
+ .flush_buffers = vfe_flush_buffers,
+};
+
+static void vfe_subdev_init(struct device *dev, struct vfe_device *vfe)
+{
+ vfe->video_ops = vfe_video_ops_1190;
+}
+
+static void vfe_global_reset(struct vfe_device *vfe)
+{
+ vfe_isr_reset_ack(vfe);
+}
+
+static irqreturn_t vfe_isr(int irq, void *dev)
+{
+ /* nop */
+ return IRQ_HANDLED;
+}
+
+static int vfe_halt(struct vfe_device *vfe)
+{
+ /* rely on vfe_disable_output() to stop the VFE */
+ return 0;
+}
+
+const struct vfe_hw_ops vfe_ops_1190 = {
+ .addr_update = vfe_addr_update,
+ .addr_update_clear = vfe_addr_update_clear,
+ .global_reset = vfe_global_reset,
+ .hw_version = vfe_hw_version,
+ .isr = vfe_isr,
+ .pm_domain_off = vfe_pm_domain_off,
+ .pm_domain_on = vfe_pm_domain_on,
+ .reg_update = vfe_reg_update,
+ .reg_update_clear = vfe_reg_update_clear,
+ .subdev_init = vfe_subdev_init,
+ .vfe_disable = vfe_disable,
+ .vfe_enable = vfe_enable_v2,
+ .vfe_halt = vfe_halt,
+ .vfe_wm_start = vfe_wm_start,
+ .vfe_wm_stop = vfe_wm_stop,
+ .vfe_buf_done = vfe_buf_done,
+ .vfe_wm_update = vfe_wm_update,
+};
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
index 3225174c063eb1b351d00d6f369c0c5c80a0b587..4bb6f4515071a2c87a169631db8d9df63cad99ba 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
@@ -2048,6 +2048,7 @@ static int vfe_bpl_align_rdi(struct vfe_device *vfe)
case CAMSS_8550:
case CAMSS_8650:
case CAMSS_8775P:
+ case CAMSS_HAWI:
case CAMSS_KAANAPALI:
case CAMSS_X1E80100:
case CAMSS_X1P42100:
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/media/platform/qcom/camss/camss-vfe.h
index c37526caf9a6fc052c3f4ab4215e635167f6da95..d102bf4fa4d67607faef81aa49a91a777283f732 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.h
+++ b/drivers/media/platform/qcom/camss/camss-vfe.h
@@ -253,6 +253,7 @@ extern const struct vfe_hw_ops vfe_ops_340;
extern const struct vfe_hw_ops vfe_ops_480;
extern const struct vfe_hw_ops vfe_ops_680;
extern const struct vfe_hw_ops vfe_ops_1080;
+extern const struct vfe_hw_ops vfe_ops_1190;
extern const struct vfe_hw_ops vfe_ops_gen3;
int vfe_get(struct vfe_device *vfe);
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 3a5b7c665d3a913e06489e985348b38af97c2f39..e63d9aacdd2113673a0fcf3fec0af34bbe4b4e65 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -4529,6 +4529,223 @@ static const struct resources_icc icc_res_sa8775p[] = {
},
};
+static const struct camss_subdev_resources vfe_res_hawi[] = {
+ /* VFE0 - TFE Full */
+ {
+ .clock = { "vfe0_fast_ahb", "vfe0", "cpas_vfe0",
+ "camnoc_rt_axi", "camnoc_nrt_axi", "qdss_debug_xo",
+ "cpas_mnoc_hf", "cpas_mnoc_sf" },
+ .clock_rate = { { 0 },
+ { 238200000, 397000000, 440000000, 480000000,
+ 630000000, 750000000, 833000000 },
+ { 0 },
+ { 171428571, 240000000, 300000000, 400000000,
+ 480000000, 600000000 },
+ { 0 },
+ { 0 },
+ { 0 },
+ { 0 } },
+ .reg = { "vfe0" },
+ .interrupt = { "vfe0" },
+ .vfe = {
+ .line_num = 3,
+ .has_pd = true,
+ .pd_name = "ife0",
+ .hw_ops = &vfe_ops_1190,
+ .formats_rdi = &vfe_formats_rdi_845,
+ .formats_pix = &vfe_formats_pix_845
+ }
+ },
+ /* VFE1 - TFE Full */
+ {
+ .clock = { "vfe1_fast_ahb", "vfe1", "cpas_vfe1",
+ "camnoc_rt_axi", "camnoc_nrt_axi", "qdss_debug_xo",
+ "cpas_mnoc_hf", "cpas_mnoc_sf" },
+ .clock_rate = { { 0 },
+ { 238200000, 397000000, 440000000, 480000000,
+ 630000000, 750000000, 833000000 },
+ { 0 },
+ { 171428571, 240000000, 300000000, 400000000,
+ 480000000, 600000000 },
+ { 0 },
+ { 0 },
+ { 0 },
+ { 0 } },
+ .reg = { "vfe1" },
+ .interrupt = { "vfe1" },
+ .vfe = {
+ .line_num = 3,
+ .has_pd = true,
+ .pd_name = "ife1",
+ .hw_ops = &vfe_ops_1190,
+ .formats_rdi = &vfe_formats_rdi_845,
+ .formats_pix = &vfe_formats_pix_845
+ }
+ },
+ /* VFE2 - TFE Full */
+ {
+ .clock = { "vfe2_fast_ahb", "vfe2", "cpas_vfe2",
+ "camnoc_rt_axi", "camnoc_nrt_axi", "qdss_debug_xo",
+ "cpas_mnoc_hf", "cpas_mnoc_sf" },
+ .clock_rate = { { 0 },
+ { 238200000, 397000000, 440000000, 480000000,
+ 630000000, 750000000, 833000000 },
+ { 0 },
+ { 171428571, 240000000, 300000000, 400000000,
+ 480000000, 600000000 },
+ { 0 },
+ { 0 },
+ { 0 },
+ { 0 } },
+ .reg = { "vfe2" },
+ .interrupt = { "vfe2" },
+ .vfe = {
+ .line_num = 3,
+ .has_pd = true,
+ .pd_name = "ife2",
+ .hw_ops = &vfe_ops_1190,
+ .formats_rdi = &vfe_formats_rdi_845,
+ .formats_pix = &vfe_formats_pix_845
+ }
+ },
+ /* VFE3 - IFE Lite */
+ {
+ .clock = { "vfe_lite_ahb", "vfe_lite", "cpas_vfe_lite",
+ "camnoc_rt_axi", "camnoc_nrt_axi", "qdss_debug_xo",
+ "cpas_mnoc_hf", "cpas_mnoc_sf" },
+ .clock_rate = { { 0 },
+ { 200000000, 400000000, 480000000 },
+ { 0 },
+ { 171428571, 240000000, 300000000, 400000000,
+ 480000000, 600000000 },
+ { 0 },
+ { 0 },
+ { 0 },
+ { 0 } },
+ .reg = { "vfe_lite0" },
+ .interrupt = { "vfe_lite0" },
+ .vfe = {
+ .line_num = 3,
+ .is_lite = true,
+ .hw_ops = &vfe_ops_1190,
+ .formats_rdi = &vfe_formats_rdi_845,
+ .formats_pix = &vfe_formats_pix_845
+ }
+ },
+ /* VFE4 - IFE Lite */
+ {
+ .clock = { "vfe_lite_ahb", "vfe_lite", "cpas_vfe_lite",
+ "camnoc_rt_axi", "camnoc_nrt_axi", "qdss_debug_xo",
+ "cpas_mnoc_hf", "cpas_mnoc_sf" },
+ .clock_rate = { { 0 },
+ { 200000000, 400000000, 480000000 },
+ { 0 },
+ { 171428571, 240000000, 300000000, 400000000,
+ 480000000, 600000000 },
+ { 0 },
+ { 0 },
+ { 0 },
+ { 0 } },
+ .reg = { "vfe_lite1" },
+ .interrupt = { "vfe_lite1" },
+ .vfe = {
+ .line_num = 3,
+ .is_lite = true,
+ .hw_ops = &vfe_ops_1190,
+ .formats_rdi = &vfe_formats_rdi_845,
+ .formats_pix = &vfe_formats_pix_845
+ }
+ },
+};
+
+static const struct camss_subdev_resources csid_res_hawi[] = {
+ /* CSID0 */
+ {
+ .clock = { "csid", "csiphy_rx" },
+ .clock_rate = { { 200000000, 300000000, 480000000 },
+ { 200000000, 300000000, 480000000 } },
+ .reg = { "csid0" },
+ .interrupt = { "csid0" },
+ .csid = {
+ .id = 0,
+ .parent_dev_ops = &vfe_parent_dev_ops,
+ .hw_ops = &csid_ops_1190,
+ .formats = &csid_formats_gen2
+ }
+ },
+ /* CSID1 */
+ {
+ .clock = { "csid", "csiphy_rx" },
+ .clock_rate = { { 200000000, 300000000, 480000000 },
+ { 200000000, 300000000, 480000000 } },
+ .reg = { "csid1" },
+ .interrupt = { "csid1" },
+ .csid = {
+ .id = 1,
+ .parent_dev_ops = &vfe_parent_dev_ops,
+ .hw_ops = &csid_ops_1190,
+ .formats = &csid_formats_gen2
+ }
+ },
+ /* CSID2 */
+ {
+ .clock = { "csid", "csiphy_rx" },
+ .clock_rate = { { 200000000, 300000000, 480000000 },
+ { 200000000, 300000000, 480000000 } },
+ .reg = { "csid2" },
+ .interrupt = { "csid2" },
+ .csid = {
+ .id = 2,
+ .parent_dev_ops = &vfe_parent_dev_ops,
+ .hw_ops = &csid_ops_1190,
+ .formats = &csid_formats_gen2
+ }
+ },
+ /* CSID_LITE0 */
+ {
+ .clock = { "vfe_lite_csid", "vfe_lite_cphy_rx" },
+ .clock_rate = { { 200000000, 300000000, 480000000 },
+ { 200000000, 300000000, 480000000 } },
+ .reg = { "csid_lite0" },
+ .interrupt = { "csid_lite0" },
+ .csid = {
+ .id = 3,
+ .is_lite = true,
+ .parent_dev_ops = &vfe_parent_dev_ops,
+ .hw_ops = &csid_ops_1190,
+ .formats = &csid_formats_gen2
+ }
+ },
+ /* CSID_LITE1 */
+ {
+ .clock = { "vfe_lite_csid", "vfe_lite_cphy_rx" },
+ .clock_rate = { { 200000000, 300000000, 480000000 },
+ { 200000000, 300000000, 480000000 } },
+ .reg = { "csid_lite1" },
+ .interrupt = { "csid_lite1" },
+ .csid = {
+ .id = 4,
+ .is_lite = true,
+ .parent_dev_ops = &vfe_parent_dev_ops,
+ .hw_ops = &csid_ops_1190,
+ .formats = &csid_formats_gen2
+ }
+ }
+};
+
+static const struct resources_icc icc_res_hawi[] = {
+ {
+ .name = "ahb",
+ .icc_bw_tbl.avg = 38400,
+ .icc_bw_tbl.peak = 76800,
+ },
+ {
+ .name = "hf_mnoc",
+ .icc_bw_tbl.avg = 2097152,
+ .icc_bw_tbl.peak = 2097152,
+ },
+};
+
static const struct camss_subdev_resources csiphy_res_x1e80100[] = {
/* CSIPHY0 */
{
@@ -6403,6 +6620,21 @@ static const struct camss_resources sm8650_resources = {
.vfe_num = ARRAY_SIZE(vfe_res_sm8650),
};
+static const struct camss_resources hawi_resources = {
+ .version = CAMSS_HAWI,
+ .pd_name = "top",
+ .pm_clks = { "cpas_fast_ahb", "cpas_ahb", "gcc_axi_hf" },
+ .tpg_res = tpg_res_8775p,
+ .csid_res = csid_res_hawi,
+ .vfe_res = vfe_res_hawi,
+ .icc_res = icc_res_hawi,
+ .icc_path_num = ARRAY_SIZE(icc_res_hawi),
+ .csiphy_num = 6,
+ .tpg_num = ARRAY_SIZE(tpg_res_8775p),
+ .csid_num = ARRAY_SIZE(csid_res_hawi),
+ .vfe_num = ARRAY_SIZE(vfe_res_hawi),
+};
+
static const struct camss_resources x1e80100_resources = {
.version = CAMSS_X1E80100,
.pd_name = "top",
@@ -6436,6 +6668,7 @@ static const struct camss_resources x1p42100_resources = {
};
static const struct of_device_id camss_dt_match[] = {
+ { .compatible = "qcom,hawi-camss", .data = &hawi_resources },
{ .compatible = "qcom,kaanapali-camss", .data = &kaanapali_resources },
{ .compatible = "qcom,msm8916-camss", .data = &msm8916_resources },
{ .compatible = "qcom,msm8939-camss", .data = &msm8939_resources },
diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h
index 734023839abe9ec6a89b1a5c2a0bd5e545846c0e..97373d6103d0a50fc435df2f53190bd8b4b8d31a 100644
--- a/drivers/media/platform/qcom/camss/camss.h
+++ b/drivers/media/platform/qcom/camss/camss.h
@@ -97,6 +97,7 @@ enum camss_version {
CAMSS_8550,
CAMSS_8650,
CAMSS_8775P,
+ CAMSS_HAWI,
CAMSS_KAANAPALI,
CAMSS_X1E80100,
CAMSS_X1P42100,
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v6 1/3] dt-bindings: media: Add CAMSS device for Hawi and Maili
2026-12-03 8:17 ` [PATCH v6 1/3] dt-bindings: media: Add CAMSS device for " Nihal Kumar Gupta
@ 2026-12-03 8:32 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-12-03 8:32 UTC (permalink / raw)
To: Nihal Kumar Gupta; +Cc: devicetree, robh, conor+dt, media-ci
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] dt-bindings: media: allow port@5 for Maili despite missing
CSIPHY5
- [Medium] dt-bindings: media: require unregistered camnoc_dcd_xo clock
on Hawi
- [Low] dt-bindings: media: commit message body omits Maili platform
--
commit 9efe59058f4afe0734b221202bbfa51af2675808
Author: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
> dt-bindings: media: Add CAMSS device for Hawi and Maili
>
> Add bindings for Camera Subsystem (CAMSS) on the Qualcomm Hawi platform.
>
> The Hawi platform provides:
> - 6 x CSIPHY (CSI Physical Layer)
> - 3 x TPG (Test Pattern Generator)
> - 3 x CSID (CSI Decoder)
> - 2 x CSID Lite
> - 3 x VFE (Video Front End), 5 RDI per VFE
> - 2 x VFE Lite, 4 RDI per VFE Lite
>
> Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
> Co-developed-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
> Signed-off-by: Nihal Kumar Gupta <nihal.gupta@oss.qualcomm.com>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
[Severity: Low]
Should the commit message body also describe the Maili platform? The
subject and schema add qcom,maili-camss with a fallback to qcom,hawi-camss,
but the body only covers Hawi and does not explain why Maili shares the
binding or how it differs (such as having 5 CSIPHY instances instead of 6).
> diff --git a/Documentation/devicetree/bindings/media/qcom,hawi-camss.yaml b/Documentation/devicetree/bindings/media/qcom,hawi-camss.yaml
> new file mode 100644
> index 0000000000000..22629064ed713
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/qcom,hawi-camss.yaml
> @@ -0,0 +1,317 @@
[ ... ]
> + clocks:
> + maxItems: 26
> +
> + clock-names:
> + items:
> + - const: camnoc_nrt_axi
> + - const: camnoc_rt_axi
> + - const: camnoc_dcd_xo
[Severity: Medium]
Should camnoc_dcd_xo be required in clock-names?
In drivers/clk/qcom/camcc-hawi.c, cam_cc_hawi_clocks[] leaves
CAM_CC_CAMNOC_DCD_XO_CLK unpopulated and enables it internally as an
always-on entry in cam_cc_hawi_critical_cbcrs[] instead. Because
qcom_cc_clk_hw_get() returns NULL for unpopulated entries, requiring
camnoc_dcd_xo in the binding wires consumers to a silent no-op clock
handle. Either drop camnoc_dcd_xo from this binding or register
CAM_CC_CAMNOC_DCD_XO_CLK in cam_cc_hawi_clocks[] if consumers need to
manage it.
[ ... ]
> + ports:
> + $ref: /schemas/graph.yaml#/properties/ports
> +
> + description:
> + CSI input ports.
> +
> + patternProperties:
> + "^port@[0-5]$":
> + $ref: /schemas/graph.yaml#/$defs/port-base
> + unevaluatedProperties: false
> + description:
> + Input ports for receiving CSI data on CSIPHY 0-5.
[Severity: Medium]
Should port@5 be disallowed for qcom,maili-camss?
In drivers/clk/qcom/camcc-hawi.c, cam_cc_hawi_probe() clears
CAM_CC_CSI5PHYTIMER_CLK_SRC, CAM_CC_CSI5PHYTIMER_CLK, and
CAM_CC_CSIPHY5_CLK for qcom,maili-camcc because Maili only implements
CSIPHY 0-4. Without an allOf conditional rejecting port@5 when compatible
contains qcom,maili-camss, dtbs_check will accept Maili device trees that
reference a non-existent 6th CSIPHY port.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-hawi-camss-v6-0-6a30cc09a064@oss.qualcomm.com?part=1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v6 2/3] media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate
2026-12-03 8:17 ` [PATCH v6 2/3] media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate Nihal Kumar Gupta
@ 2026-12-03 8:39 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-12-03 8:39 UTC (permalink / raw)
To: Nihal Kumar Gupta; +Cc: devicetree, robh, conor+dt, media-ci
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] media: qcom: camss: leaf-branch votes fail to protect shared
cphy_rx RCG
- [Medium] media: qcom: camss: csid_cap_clock_level() is a no-op for
known link rates
- [Medium] media: qcom: camss: clk_set_rate_range() leaves CSID clocks
stuck high
--
commit 4e29d22048255b4715c551cb9170cf49335975d6
Author: Loic Poulain <loic.poulain@oss.qualcomm.com>
media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate
This commit scales the CSID core and CSIPHY receive clocks according to
the sensor CSI-2 link frequency across all CAMSS generations using
clk_set_rate_range(), and drops those minimum rate votes on power-off.
> diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c
> index 123c097ee54bf..543ea9d05127f 100644
> --- a/drivers/media/platform/qcom/camss/camss-csid.c
> +++ b/drivers/media/platform/qcom/camss/camss-csid.c
[ ... ]
> +/* Lower a level down to max_rate, but never below what min_rate needs */
> +static int csid_cap_clock_level(struct camss_clock *clock, int level,
> + u64 min_rate, u64 max_rate)
> +{
> + while (level > 0 && clock->freq[level] > max_rate &&
> + clock->freq[level - 1] > min_rate)
> + level--;
> +
> + return level;
> +}
[Severity: Medium]
Is csid_cap_clock_level() a no-op for every known sensor link rate?
When min_rate is non-zero, csid_find_clock_level() returns the lowest
index where clock->freq[level] > min_rate, so clock->freq[level - 1] is
always <= min_rate. The while loop can therefore only execute when
min_rate is 0.
Because csid_set_clock_rates() also settles core_rate before resolving
phy_rx clocks, a phy_rx clock can outrun the core clock even when a
faster core OPP exists.
For example, on SM6150 with 269.33 MHz <= min_rate < 320 MHz,
vfe0_cphy_rx steps up to 384 MHz while vfe0_csid stays at 320 MHz
despite 540 MHz being available, risking CSID backpressure or overflow.
Resolving the phy_rx clock first and selecting a core level at least as
high would keep the core clock ahead.
[ ... ]
> + /*
> + * Vote for the rate as a minimum, as the clock may be shared
> + * with another CSID which needs it to run faster.
> + */
> + ret = clk_set_rate_range(clock->clk, clock->freq[j], ULONG_MAX);
> + if (ret < 0) {
> + dev_err(dev, "clk set rate range failed: %d\n", ret);
> + return ret;
> }
> }
[Severity: Medium]
Does calling clk_set_rate_range() with ULONG_MAX alone leave scaled
clocks stuck at a higher rate?
clk_set_rate_range_nolock() clamps clk->core->req_rate to [min, max],
so passing ULONG_MAX never lowers an already-higher req_rate. On
X1E80100, tpg_set_clock_rates() leaves csid_csiphy_rx at 400 MHz after
power-off, keeping a later 300 MHz sensor stuck at 400 MHz.
Rounding and setting clock->freq[j] afterwards, as
csid_release_clock_rates() does, would lower req_rate while still
respecting higher votes on the same clock.
[ ... ]
> +static void csid_release_clock_rates(struct csid_device *csid)
> +{
> + int i;
> +
> + for (i = 0; i < csid->nclocks; i++) {
> + struct camss_clock *clock = &csid->clock[i];
> + long rate;
> +
> + if (!clock->nfreqs || !csid_match_scaled_clock_name(clock))
> + continue;
> +
> + clk_drop_range(clock->clk);
> +
> + /* Round first, so that the rate respects the other votes */
> + rate = clk_round_rate(clock->clk, clock->freq[0]);
> + if (rate > 0)
> + clk_set_rate(clock->clk, rate);
> + }
> +}
[Severity: High]
Can sibling CSID branch clocks sharing a parent RCG still underclock an
actively streaming CSID?
clk_set_rate_range() records min_rate only on the leaf clk_branch2
consumer, and clk_core_get_boundaries() aggregates votes only across
core->clks of that clock. Because clk_branch2_ops propagates rate
changes via CLK_SET_RATE_PARENT, the shared parent RCG's min_rate stays 0.
On SM8550 and X1E80100, full CSIDs scale cam_cc_csid_csiphy_rx_clk while
lite CSIDs scale cam_cc_ife_lite_cphy_rx_clk, two distinct clk_branch2
children of cam_cc_cphy_rx_clk_src (and SM6150 has three vfe*_cphy_rx
siblings).
When a full CSID streams at 480 MHz and a lite CSID starts a slower
sensor or powers off via csid_release_clock_rates() (including on the
csid_set_power() error path), the sibling branch lowers
cam_cc_cphy_rx_clk_src underneath the active CSID.
Underclocking the receive clock below link_freq / 4 causes CSI-2 receive
FIFO overruns, dropped or corrupted frames, or stream failure during
concurrent multi-camera capture.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-hawi-camss-v6-0-6a30cc09a064@oss.qualcomm.com?part=2
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v6 3/3] media: qcom: camss: Add support for Hawi
2026-12-03 8:17 ` [PATCH v6 3/3] media: qcom: camss: Add support for Hawi Nihal Kumar Gupta
@ 2026-12-03 8:50 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-12-03 8:50 UTC (permalink / raw)
To: Nihal Kumar Gupta; +Cc: devicetree, robh, conor+dt, media-ci
Thank you for your contribution! Sashiko AI review found 10 potential
issues to consider:
- [High] media: qcom: camss: unconditional AUP strobes in
csid_configure_stream()
- [Medium] media: qcom: camss: unsynchronized RMW race on csid
addr_update/reg_update
- [Medium] media: camss: csid_configure_stream() skips
CSID_BUF_DONE_IRQ_MASK update
- [Medium] media: qcom: camss: camnoc_rt_axi rates in vfe_res_hawi
mismatch camcc-hawi
- [Medium] media: qcom: camss: hawi omits required gcc_axi_sf clock
- [Low] media: qcom: camss: camss-csid-1190.c duplicates
camss-csid-1080.c verbatim
- [Low] media: qcom: camss: unused-but-set lane_cnt in
__csid_configure_rdi_stream()
- [Low] media: qcom: camss: MSM_CSID_MAX_SRC_STREAMS_1190 captures local
variable
- [Low] media: qcom: camss: commit message contradicts hawi_resources
tables
- [Low] media: qcom: camss: qcom,glymur-camss not moved above
qcom,hawi-camss
--
commit 9ba484f0cc1b829c5b791460b883c113d8262ec0
Author: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
media: qcom: camss: Add support for Hawi
This patch adds CAMSS support for the Hawi SoC by introducing CSID 1190
and VFE 1190 hardware operations along with the Hawi resource tables and
device tree match entry.
> Add CAMSS support for the Hawi SoC. The CSIPHY resource table is reused
> from Kaanapali and the TPG table from X1E80100.
>
> Hawi calls its front-end blocks TFEs (Thin Front Ends), but the VFE 1190
> driver keeps the VFE naming for consistency. The common CPAS clocks are
> managed as PM clocks of the CAMSS resources rather than per-VFE clocks.
[Severity: Low]
Does the commit message match hawi_resources and vfe_res_hawi?
hawi_resources sets .tpg_res to tpg_res_8775p rather than
tpg_res_x1e80100, and neither kaanapali_resources nor hawi_resources
defines a CSIPHY resource table (both leave .csiphy_res NULL for
standalone PHYs). Also, while hawi_resources.pm_clks holds cpas_fast_ahb
and cpas_ahb, vfe_res_hawi still lists the shared cpas_mnoc_hf and
cpas_mnoc_sf clocks in every per-VFE entry.
> diff --git a/drivers/media/platform/qcom/camss/camss-csid-1190.c b/drivers/media/platform/qcom/camss/camss-csid-1190.c
> new file mode 100644
> index 0000000000000..e3eb17b8ec5d3
> --- /dev/null
> +++ b/drivers/media/platform/qcom/camss/camss-csid-1190.c
[ ... ]
> +#define MSM_CSID_MAX_SRC_STREAMS_1190 (csid_is_lite(csid) ? 4 : 5)
[Severity: Low]
This isn't a bug, but MSM_CSID_MAX_SRC_STREAMS_1190 implicitly relies on a
local variable named csid in every caller scope. Passing csid as a macro
argument or using an inline helper avoids hidden variable capture.
[ ... ]
> +static void __csid_aup_rup_trigger(struct csid_device *csid)
> +{
> + /* trigger SET in combined register */
> + writel(RUP_SET, csid->base + CSID_RUP_AUP_CMD);
> +}
> +
> +static void __csid_addr_update(struct csid_device *csid, int port_id)
> +{
> + csid->addr_update |= CSID_RUP_AUP_RDI(port_id);
> + writel(csid->addr_update, csid->base + CSID_AUP_CMD);
> +
> + __csid_aup_rup_trigger(csid);
> +}
> +
> +static void __csid_addr_update_clear(struct csid_device *csid, int port_id)
> +{
> + /* Hardware clears the registers upon consuming the settings */
> + csid->addr_update &= ~CSID_RUP_AUP_RDI(port_id);
> +}
> +
> +static void __csid_reg_update(struct csid_device *csid, int port_id)
> +{
> + csid->reg_update |= CSID_RUP_AUP_RDI(port_id);
> + writel(csid->reg_update, csid->base + CSID_RUP_CMD);
> +
> + __csid_aup_rup_trigger(csid);
> +}
> +
> +static void __csid_reg_update_clear(struct csid_device *csid, int port_id)
> +{
> + /* Hardware clears the registers upon consuming the settings */
> + csid->reg_update &= ~CSID_RUP_AUP_RDI(port_id);
> +}
[Severity: Medium]
Can concurrent updates to csid->addr_update and csid->reg_update race
between process context and csid_isr()?
vfe_queue_buffer_v2() calls ops->addr_update() and ops->reg_update() while
holding only vfe->output_lock, csid_configure_stream() calls them with no
lock and IRQs enabled, and csid_isr() clears bits on INFO_RUP_DONE without
holding any lock:
CPU0 (vfe_queue_buffer_v2) CPU1 (csid_isr)
read csid->addr_update
csid->addr_update &= ~BIT(i)
csid->addr_update |= BIT(j) <-- resurrects cleared BIT(i)
writel(addr_update, CSID_AUP_CMD)
writel(RUP_SET, CSID_RUP_AUP_CMD)
A lost bit set can stall capture, while a resurrected bit can spuriously
re-trigger AUP/RUP for an already-consumed port. Protecting these fields
and the AUP/RUP/SET register writes with an IRQ-safe spinlock on struct
csid_device would close the race.
[ ... ]
> +static void __csid_configure_rdi_stream(struct csid_device *csid, u8 enable, u8 port, u8 vc)
> +{
> + u32 val;
> + u8 lane_cnt = csid->phy.lane_cnt;
> +
> + /* Source pads matching RDI channels on hardware.
> + * E.g. Pad 1 -> RDI0, Pad 2 -> RDI1, etc.
> + */
> + struct v4l2_mbus_framefmt *input_format = &csid->fmt[MSM_CSID_PAD_FIRST_SRC + port];
> + const struct csid_format_info *format = csid_get_fmt_entry(csid->res->formats->formats,
> + csid->res->formats->nformats,
> + input_format->code);
> +
> + if (!lane_cnt)
> + lane_cnt = 4;
[Severity: Low]
Is lane_cnt used anywhere in __csid_configure_rdi_stream()? It is
initialized and conditionally assigned, but never read, which triggers a
-Wunused-but-set-variable warning under W=1 builds.
[ ... ]
> +static void csid_configure_stream(struct csid_device *csid, u8 enable)
> +{
> + u8 i, k;
> +
> + __csid_configure_rx(csid, &csid->phy);
> +
> + for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS_1190; i++) {
> + if (csid->phy.en_vc & BIT(i)) {
> + __csid_configure_rdi_stream(csid, enable, i, 0);
> + __csid_configure_rx_vc(csid, 0);
> +
> + for (k = 0; k < CAMSS_INIT_BUF_COUNT; k++)
> + __csid_addr_update(csid, i);
> +
> + __csid_reg_update(csid, i);
> +
> + __csid_ctrl_rdi(csid, enable, i);
> + }
> + }
> +}
[Severity: High]
Can this loop latch uninitialized or stale DMA addresses into the VFE
write master when VIDIOC_STREAMON is called with fewer than
CAMSS_INIT_BUF_COUNT buffers queued?
msm_video_register() leaves vb2_queue.min_queued_buffers at 0, so
userspace can call VIDIOC_STREAMON with 0 or 1 buffers queued.
vfe_enable_output_v2() then programs VFE_BUS_WM_IMAGE_ADDR() only for the
available pending buffers, but csid_configure_stream() unconditionally
fires CAMSS_INIT_BUF_COUNT AUP strobes and a RUP strobe for every
link-enabled RDI port (even when enable is 0 or a linked port is not
streaming).
That mismatch latches uninitialized, stale, or duplicate addresses into
hardware, risking SMMU faults or DMA overwrites, and desynchronizes
software buffer accounting once subsequent VIDIOC_QBUF calls trigger
additional addr_update() strobes in vfe_queue_buffer_v2().
[ ... ]
> + val = 0;
> + for (i = 0; i < MSM_CSID_MAX_SRC_STREAMS_1190; i++) {
> + if (csid->phy.en_vc & BIT(i)) {
> + /*
> + * Only need to clear buf done IRQ status here,
> + * RUP done IRQ status will be cleared once isr
> + * strobe generated by CSID_RST_CMD
> + */
> + val |= BIT(BUF_DONE_IRQ_STATUS_RDI_OFFSET + i);
> + }
> + }
> + writel(val, csid->base + CSID_BUF_DONE_IRQ_CLEAR);
> + writel(val, csid->base + CSID_BUF_DONE_IRQ_MASK);
[Severity: Medium]
Can a newly linked RDI stream start with its buffer-done interrupt left
masked in CSID_BUF_DONE_IRQ_MASK?
csid_reset() is the only place that writes CSID_BUF_DONE_IRQ_MASK, and it
only runs when csid->subdev.entity.use_count transitions from 0 to 1.
During VIDIOC_STREAMON, video_prepare_streaming() powers on CSID and
releases mdev->graph_mutex before video_start_streaming() marks CSID pads
as streaming:
CPU0 (VIDIOC_STREAMON) CPU1 (MEDIA_IOC_SETUP_LINK)
video_prepare_streaming()
v4l2_pipeline_pm_get()
csid_reset() /* masks BIT(0) */
/* drops mdev->graph_mutex */
__media_entity_setup_link()
csid_link_setup()
csid->phy.en_vc |= BIT(1)
video_start_streaming()
csid_configure_stream() <-- starts RDI1 with IRQ masked
Because csid_configure_stream() never updates CSID_BUF_DONE_IRQ_MASK,
camss_buf_done() is never delivered for the second stream and frame
completion stalls. Updating CSID_BUF_DONE_IRQ_MASK in
csid_configure_stream() (or unmasking all RDI bits in csid_reset()) avoids
this.
[ ... ]
> +const struct csid_hw_ops csid_ops_1190 = {
> + .configure_stream = csid_configure_stream,
> + .configure_testgen_pattern = csid_configure_testgen_pattern,
> + .hw_version = csid_hw_version,
> + .isr = csid_isr,
> + .reset = csid_reset,
> + .src_pad_code = csid_src_pad_code,
> + .subdev_init = csid_subdev_init,
> + .reg_update = csid_subdev_reg_update,
> + .addr_update = csid_subdev_addr_update,
> +};
[Severity: Low]
Can csid_res_hawi reuse csid_ops_1080 directly instead of adding
camss-csid-1190.c?
Every register offset, bitmask, stream count, and function implementation
in camss-csid-1190.c is functionally identical to camss-csid-1080.c,
differing only in symbol renames and comments. Likewise, camss-vfe-1190.c
duplicates all VFE helper functions and ops from camss-vfe-1080.c,
differing only in the bus register offset macros.
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 0404f95a35fe6..4ac5a2b4f1232 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
[ ... ]
> +static const struct camss_subdev_resources vfe_res_hawi[] = {
> + /* VFE0 - TFE Full */
> + {
> + .clock = { "vfe0_fast_ahb", "vfe0", "cpas_vfe0",
> + "camnoc_rt_axi", "camnoc_nrt_axi", "qdss_debug_xo",
> + "cpas_mnoc_hf", "cpas_mnoc_sf" },
> + .clock_rate = { { 0 },
> + { 238200000, 397000000, 440000000, 480000000,
> + 630000000, 750000000, 833000000 },
> + { 0 },
> + { 171428571, 240000000, 300000000, 400000000,
> + 480000000, 600000000 },
[Severity: Medium]
Do the camnoc_rt_axi rates across vfe_res_hawi match the Hawi CAMCC
frequency table?
In drivers/clk/qcom/camcc-hawi.c, ftbl_cam_cc_camnoc_rt_axi_clk_src
defines 120, 160, 240, 320, and 480 MHz (maximum 480 MHz), and even
ftbl_cam_cc_camnoc_rt_axi_clk_src_maili starts at 200 MHz with no
171428571 Hz step. Because cam_cc_camnoc_rt_axi_clk_src uses CEIL
rounding, requesting 171428571 Hz skips the 120 and 160 MHz OPPs (both
while streaming and in vfe_release_clock_rates()), 400 MHz skips 320 MHz,
and 600 MHz installs an unsatisfiable consumer min_rate above Hawi's
480 MHz ceiling in vfe_set_clock_rates().
[ ... ]
> +static const struct camss_resources hawi_resources = {
> + .version = CAMSS_HAWI,
> + .pd_name = "top",
> + .pm_clks = { "cpas_fast_ahb", "cpas_ahb", "gcc_axi_hf" },
[Severity: Medium]
Should gcc_axi_sf be included in hawi_resources.pm_clks (or vfe_res_hawi)?
All five VFE entries in vfe_res_hawi enable cpas_mnoc_sf
(cam_cc_titan_mnoc_sf_clk), which uses BRANCH_HALT with no hwcg_reg, and
the Hawi DT binding requires gcc_axi_sf alongside gcc_axi_hf. Because
gcc_camera_sf_axi_clk in drivers/clk/qcom/gcc-hawi.c is not marked
critical or ignore-unused, clk_disable_unused() gates it, and enabling
cpas_mnoc_sf during vfe_get() can fail with -EBUSY and a branch-halt
warning in clk_branch_wait() unless firmware forces it on.
[ ... ]
> static const struct of_device_id camss_dt_match[] = {
> + { .compatible = "qcom,hawi-camss", .data = &hawi_resources },
> { .compatible = "qcom,kaanapali-camss", .data = &kaanapali_resources },
[Severity: Low]
As reported by Bryan O'Donoghue on v3 [1], qcom,glymur-camss at the bottom
of camss_dt_match[] still needs to be moved to the top above
qcom,hawi-camss to keep the match table in alphabetical order.
[1] https://lore.kernel.org/r/23845ad3-dedd-4e24-803b-5abf3b030c4a@kernel.org
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-hawi-camss-v6-0-6a30cc09a064@oss.qualcomm.com?part=3
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-12-03 8:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 8:17 [PATCH v6 0/3] Add CAMSS support for Qualcomm Hawi and Maili Nihal Kumar Gupta
2026-12-03 8:17 ` [PATCH v6 1/3] dt-bindings: media: Add CAMSS device for " Nihal Kumar Gupta
2026-12-03 8:32 ` sashiko-bot
2026-12-03 8:17 ` [PATCH v6 2/3] media: qcom: camss: csid: Scale the clocks with the CSI-2 link rate Nihal Kumar Gupta
2026-12-03 8:39 ` sashiko-bot
2026-12-03 8:17 ` [PATCH v6 3/3] media: qcom: camss: Add support for Hawi Nihal Kumar Gupta
2026-12-03 8:50 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox