media: qcom: camss: Add SM8450 CAMSS support
Subsystems (7)
v2 cover media: qcom: camss: Add SM8450 CAMSS support
This series adds support of Qualcomm SM8450 Camera Subsystem.
The CSIPHYs are described as separate CSIPHY devices compatible with X1E80100 ones, there is no legacy CSIPHY resource description in the CAMSS driver, and this option is not intended to be supported.
The change can be immediately tested on any SM8450 powered board by running an image stream from TPG to CSIDs, CSIPHY IPs are equal to the ones found on Hamoa platform, and were tested on a private board.
The series was based and tested on linux-next-20261023.
Changes from v1 to v2:
* renamed Waipio SoC name taken from downstream to SM8450 (Krzysztof),
* pushed DTS patches to the end of the series (Krzysztof),
* added Reviewed-by tags by Konrad and Bryan,
* minor non-function commit message and blank space changes.
Link to v1:
* https://lore.kernel.org/linux-arm-msm/[email protected]/
Vladimir Zapolskiy (7):
dt-bindings: phy: qcom,x1e80100-csi2-phy: Add SM8450 compatible
dt-bindings: media: Add Qualcomm SM8450 CAMSS
media: qcom: camss: Allow CSI2 PHY devices without CSIPHY resources
media: qcom: camss: Add SM8450 CAMSS support
arm64: dts: qcom: sm8450: Add CSI2 PHY device tree nodes
arm64: dts: qcom: sm8450: Add CAMSS device tree node
arm64: dts: qcom: sm8450: Add description of pins with MCLK function
.../bindings/media/qcom,sm8450-camss.yaml | 274 +++++++++ .../bindings/phy/qcom,x1e80100-csi2-phy.yaml | 4 +- arch/arm64/boot/dts/qcom/sm8450.dtsi | 565 ++++++++++++++++++ .../media/platform/qcom/camss/camss-csiphy.c | 16 +- drivers/media/platform/qcom/camss/camss-vfe.c | 2 + drivers/media/platform/qcom/camss/camss.c | 244 +++++++- drivers/media/platform/qcom/camss/camss.h | 1 + 7 files changed, 1100 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/qcom,sm8450-camss.yaml
Signature · 1 line
2.51.0
PATCH v2 1/7 dt-bindings: phy: qcom,x1e80100-csi2-phy: Add SM8450 compatible
Qualcomm SM8450 SoC has six CSIPHY IPs, which are compatible with Hamoa ones:
qcom-mipi-csi2-phy acec000.phy: CSIPHY 3PH HW Version = 0x40010000
Hardware supports up to three different 0.9v level power supplies for CSIPHY0/1, CSIPHY2/3 and CSIPHY4/5, but there is just a single 1.2v power line VDD_A_CSI_1P2, which supplies all CSIPHY devices.
--- .../devicetree/bindings/phy/qcom,x1e80100-csi2-phy.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/phy/qcom,x1e80100-csi2-phy.yaml +3 -1
@@ -19,7 +19,9 @@ properties: oneOf: - const: qcom,x1e80100-csi2-phy - items: - - const: qcom,glymur-csi2-phy + - enum: + - qcom,glymur-csi2-phy + - qcom,sm8450-csi2-phy - const: qcom,x1e80100-csi2-phy reg:
Signature · 1 line
2.51.0
PATCH v2 2/7 dt-bindings: media: Add Qualcomm SM8450 CAMSS
In reply to Vladimir ZapolskiyAdd Qualcomm SM8450 CAMSS device tree binding, it contains
* three CSID and two CSID lite blocks,
* three VFE and two VFE lite blocks,
* three CSI test pattern generators,
Six CSIPHY blocks are described as separate CSIPHY devices connected to CAMSS input ports.
--- .../bindings/media/qcom,sm8450-camss.yaml | 274 ++++++++++++++++++ 1 file changed, 274 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,sm8450-camss.yaml
Documentation/devicetree/bindings/media/qcom,sm8450-camss.yaml new file +274 -0
@@ -0,0 +1,274 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,sm8450-camss.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm SM8450 Camera Subsystem (CAMSS) + +maintainers: + - Vladimir Zapolskiy <[email protected]> + +description: + The CAMSS IP is a CSI decoder and ISP present on Qualcomm platforms. + +properties: + compatible: + const: qcom,sm8450-camss + + reg: + maxItems: 14 + + reg-names: + items: + - const: csid_wrapper + - 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: 21 + + clock-names: + items: + - const: camnoc_axi + - const: core_ahb + - const: cpas_ahb + - const: cpas_fast_ahb + - const: cpas_vfe0 + - const: cpas_vfe1 + - const: cpas_vfe2 + - const: cpas_vfe_lite + - const: csid + - const: csiphy_rx + - const: gcc_hf_axi + - 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 + + 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 + + iommus: + items: + - description: S1 HLOS IFE and IFE_LITE non-protected + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: ahb + - const: hf_mnoc + + power-domains: + items: + - description: IFE0 GDSC - Image Front End, Global Distributed Switch Controller. + - description: IFE1 GDSC - Image Front End, Global Distributed Switch Controller. + - description: IFE2 GDSC - Image Front End, Global Distributed Switch Controller. + - description: Titan GDSC - Titan ISP Block, Global Distributed Switch Controller. + + 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 port for receiving CSI data from a CSIPHY device. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 4 + +required: + - compatible + - reg + - reg-names + - clocks + - clock-names + - interconnects + - interconnect-names + - interrupts + - interrupt-names + - iommus + - power-domains + - power-domain-names + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-sm8450.h> + #include <dt-bindings/clock/qcom,sm8450-camcc.h> + #include <dt-bindings/interconnect/qcom,sm8450.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + isp@acb6000 { + compatible = "qcom,sm8450-camss"; + reg = <0 0xacb6000 0 0x1000>, + <0 0xacb7000 0 0x1000>, + <0 0xacb9000 0 0x1000>, + <0 0xacbb000 0 0x1000>, + <0 0xacc6000 0 0x1000>, + <0 0xacca000 0 0x1000>, + <0 0xacf6000 0 0x1000>, + <0 0xacf7000 0 0x1000>, + <0 0xacf8000 0 0x1000>, + <0 0xac62000 0 0x3000>, + <0 0xac71000 0 0x3000>, + <0 0xac80000 0 0x3000>, + <0 0xacc7000 0 0x2000>, + <0 0xaccb000 0 0x2000>; + reg-names = "csid_wrapper", + "csid0", + "csid1", + "csid2", + "csid_lite0", + "csid_lite1", + "tpg0", + "tpg1", + "tpg2", + "vfe0", + "vfe1", + "vfe2", + "vfe_lite0", + "vfe_lite1"; + clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>, + <&camcc CAM_CC_CORE_AHB_CLK>, + <&camcc CAM_CC_CPAS_AHB_CLK>, + <&camcc CAM_CC_CPAS_FAST_AHB_CLK>, + <&camcc CAM_CC_CPAS_IFE_0_CLK>, + <&camcc CAM_CC_CPAS_IFE_1_CLK>, + <&camcc CAM_CC_CPAS_IFE_2_CLK>, + <&camcc CAM_CC_CPAS_IFE_LITE_CLK>, + <&camcc CAM_CC_CSID_CLK>, + <&camcc CAM_CC_CSID_CSIPHY_RX_CLK>, + <&gcc GCC_CAMERA_HF_AXI_CLK>, + <&camcc CAM_CC_IFE_0_CLK>, + <&camcc CAM_CC_IFE_0_FAST_AHB_CLK>, + <&camcc CAM_CC_IFE_1_CLK>, + <&camcc CAM_CC_IFE_1_FAST_AHB_CLK>, + <&camcc CAM_CC_IFE_2_CLK>, + <&camcc CAM_CC_IFE_2_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>; + clock-names = "camnoc_axi", + "core_ahb", + "cpas_ahb", + "cpas_fast_ahb", + "cpas_vfe0", + "cpas_vfe1", + "cpas_vfe2", + "cpas_vfe_lite", + "csid", + "csiphy_rx", + "gcc_hf_axi", + "vfe0", + "vfe0_fast_ahb", + "vfe1", + "vfe1_fast_ahb", + "vfe2", + "vfe2_fast_ahb", + "vfe_lite", + "vfe_lite_ahb", + "vfe_lite_cphy_rx", + "vfe_lite_csid"; + interrupts = <GIC_SPI 464 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 466 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 640 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 468 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 359 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 465 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 467 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 641 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 469 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 360 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 0 &config_noc SLAVE_CAMERA_CFG 0>, + <&mmss_noc MASTER_CAMNOC_HF 0 &mc_virt SLAVE_EBI1 0>; + interconnect-names = "ahb", "hf_mnoc"; + iommus = <&apps_smmu 0x800 0x460>; + power-domains = <&camcc IFE_0_GDSC>, + <&camcc IFE_1_GDSC>, + <&camcc IFE_2_GDSC>, + <&camcc TITAN_TOP_GDSC>; + power-domain-names = "ife0", "ife1", "ife2", "top"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + + camss_csiphy1_ep: endpoint { + remote-endpoint = <&csiphy1_out>; + }; + }; + }; + }; + };
Signature · 1 line
2.51.0
PATCH v2 3/7 media: qcom: camss: Allow CSI2 PHY devices without CSIPHY resources
In reply to Vladimir ZapolskiyIf CAMSS CSIPHYs are supported by the stand-alone CSI2 PHY driver only, there is no need to provide description of legacy CSIPHY resources in the CAMSS driver, therefore if CSIPHY resources are not given for some supported platform, use CAMSS CSIPHY port numbers as CSIPHY identifiers.
--- drivers/media/platform/qcom/camss/camss-csiphy.c | 16 +++++++++++++--- drivers/media/platform/qcom/camss/camss.c | 8 ++++++-- 2 files changed, 19 insertions(+), 5 deletions(-)
drivers/media/platform/qcom/camss/camss-csiphy.c +13 -3
@@ -799,6 +799,11 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss,return ret; } +/* Fallback to generic SDM845 compatible formats for non-legacy CSIPHYs */ +static const struct csiphy_subdev_resources csiphy_res_phy = { + .formats = &csiphy_formats_sdm845, +}; +/* * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources * @camss: CAMSS structure
@@ -808,7 +813,7 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss,*/ int msm_csiphy_subdev_init (struct camss *camss,u8 port) { -const struct camss_subdev_resources *res = &camss->res->csiphy_res[port]; +const struct camss_subdev_resources *res = camss->res->csiphy_res;struct csiphy_device *csiphy = &camss->csiphy[port];struct device *dev = camss->dev;struct device_node *ep, *remote;
@@ -836,8 +841,13 @@ int msm_csiphy_subdev_init(struct camss *camss, u8 port) } csiphy->camss = camss; - csiphy->id = res->csiphy.id; - csiphy->res = &res->csiphy; +if (res) { + csiphy->id = res[port].csiphy.id; + csiphy->res = &res[port].csiphy; + }else { + csiphy->id = port; + csiphy->res = &csiphy_res_phy; + }snprintf (csiphy->name,ARRAY_SIZE (csiphy->name),"csi%d" , csiphy->id);
drivers/media/platform/qcom/camss/camss.c +6 -2
@@ -4796,7 +4796,10 @@ static void camss_detect_legacy_phy(struct camss *camss)struct device_node *remote;struct device_node *ep; - camss->legacy_phy = true; +/* Legacy CSIPHY description implies the provided CSIPHY resources */ + camss->legacy_phy = !!camss->res->csiphy_res; +if (!camss->legacy_phy) + goto done;/* Find first remote-endpoint and determine if its a PHY */ for_each_endpoint_of_node (camss->dev->of_node, ep) {
@@ -4810,6 +4813,7 @@ static void camss_detect_legacy_phy(struct camss *camss)break ; } +done:dev_dbg (camss->dev,"legacy phy mode %s\n" , camss->legacy_phy ?"true" :"false" ); }
@@ -4841,7 +4845,7 @@ static int camss_init_subdevices(struct camss *camss)if (ret <0 ) {dev_err (camss->dev,"csiphy %d init fail\n" , - res->csiphy_res[i].csiphy.id); + res->csiphy_res ? res->csiphy_res[i].csiphy.id : i);return ret; } }
Signature · 1 line
2.51.0
PATCH v2 4/7 media: qcom: camss: Add SM8450 CAMSS support
In reply to Vladimir ZapolskiyAdd support of the camera subsystem (CAMSS) found on Qualcomm SM8450 SoC.
The CAMSS IP on SM8450 contains:
* three CSID and two CSID lite, which are supported by CSID 680,
* three VFE and two VFE lite blocks, which are supported by VFE 680,
* three CSI test pattern generators, which are supported by TPG Gen1.
Qualcomm SM8450 CSIPHYs are supported by the CSI2 PHY driver only.
--- drivers/media/platform/qcom/camss/camss-vfe.c | 2 + drivers/media/platform/qcom/camss/camss.c | 236 ++++++++++++++++++ drivers/media/platform/qcom/camss/camss.h | 1 + 3 files changed, 239 insertions(+)
drivers/media/platform/qcom/camss/camss-vfe.c +2 -0
@@ -350,6 +350,7 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code,case CAMSS_8280XP :case CAMSS_8300 :case CAMSS_845 : +case CAMSS_8450 :case CAMSS_8550 :case CAMSS_8650 :case CAMSS_8775P :
@@ -2010,6 +2011,7 @@ static int vfe_bpl_align_rdi(struct vfe_device *vfe)case CAMSS_8280XP :case CAMSS_8300 :case CAMSS_845 : +case CAMSS_8450 :case CAMSS_8550 :case CAMSS_8650 :case CAMSS_8775P :
drivers/media/platform/qcom/camss/camss.c +236 -0
254 lines not on this page · raw message
drivers/media/platform/qcom/camss/camss.h +1 -0
@@ -93,6 +93,7 @@ enum camss_version {CAMSS_8280XP ,CAMSS_8300 ,CAMSS_845 , +CAMSS_8450 ,CAMSS_8550 ,CAMSS_8650 , CAMSS_8775P,
Signature · 1 line
2.51.0
PATCH v2 5/7 arm64: dts: qcom: sm8450: Add CSI2 PHY device tree nodes
In reply to Vladimir ZapolskiyAdd device tree nodes of six CAMSS CSIPHYs found on Qualcomm SM8450 SoC, and a shared CSIPHY OPP table for them.
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 280 +++++++++++++++++++++++++++ 1 file changed, 280 insertions(+)
arch/arm64/boot/dts/qcom/sm8450.dtsi +280 -0
@@ -564,6 +564,22 @@ cluster_pd: power-domain-cpu-cluster0 { }; }; + csiphy_opp_table: opp-table-csiphy { + compatible = "operating-points-v2"; + + opp-400000000 { + opp-hz = /bits/ 64 <400000000>; + required-opps = <&rpmhpd_opp_low_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-480000000 { + opp-hz = /bits/ 64 <480000000>; + required-opps = <&rpmhpd_opp_low_svs>, + <&rpmhpd_opp_low_svs>; + }; + }; + qup_opp_table_100mhz: opp-table-qup { compatible = "operating-points-v2";
@@ -3294,6 +3310,270 @@ cci1_i2c1: i2c-bus@1 { }; }; + csiphy0: phy@ace4000 { + compatible = "qcom,sm8450-csi2-phy", "qcom,x1e80100-csi2-phy"; + reg = <0 0x0ace4000 0 0x2000>; + + clocks = <&camcc CAM_CC_CSIPHY0_CLK>, + <&camcc CAM_CC_CSI0PHYTIMER_CLK>, + <&camcc CAM_CC_CORE_AHB_CLK>; + clock-names = "core", + "timer", + "ahb"; + + interrupts = <GIC_SPI 477 IRQ_TYPE_EDGE_RISING>; + + power-domains = <&camcc TITAN_TOP_GDSC>, + <&rpmhpd RPMHPD_MMCX>, + <&rpmhpd RPMHPD_MXC>; + power-domain-names = "top", + "mmcx", + "mx"; + + operating-points-v2 = <&csiphy_opp_table>; + + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csiphy0_in_ep: endpoint { + }; + }; + + port@1 { + reg = <1>; + + csiphy0_out_ep: endpoint { + }; + }; + }; + }; + + csiphy1: phy@ace6000 { + compatible = "qcom,sm8450-csi2-phy", "qcom,x1e80100-csi2-phy"; + reg = <0 0x0ace6000 0 0x2000>; + + clocks = <&camcc CAM_CC_CSIPHY1_CLK>, + <&camcc CAM_CC_CSI1PHYTIMER_CLK>, + <&camcc CAM_CC_CORE_AHB_CLK>; + clock-names = "core", + "timer", + "ahb"; + + interrupts = <GIC_SPI 478 IRQ_TYPE_EDGE_RISING>; + + power-domains = <&camcc TITAN_TOP_GDSC>, + <&rpmhpd RPMHPD_MMCX>, + <&rpmhpd RPMHPD_MXC>; + power-domain-names = "top", + "mmcx", + "mx"; + + operating-points-v2 = <&csiphy_opp_table>; + + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csiphy1_in_ep: endpoint { + }; + }; + + port@1 { + reg = <1>; + + csiphy1_out_ep: endpoint { + }; + }; + }; + }; + + csiphy2: phy@ace8000 { + compatible = "qcom,sm8450-csi2-phy", "qcom,x1e80100-csi2-phy"; + reg = <0 0x0ace8000 0 0x2000>; + + clocks = <&camcc CAM_CC_CSIPHY2_CLK>, + <&camcc CAM_CC_CSI2PHYTIMER_CLK>, + <&camcc CAM_CC_CORE_AHB_CLK>; + clock-names = "core", + "timer", + "ahb"; + + interrupts = <GIC_SPI 479 IRQ_TYPE_EDGE_RISING>; + + power-domains = <&camcc TITAN_TOP_GDSC>, + <&rpmhpd RPMHPD_MMCX>, + <&rpmhpd RPMHPD_MXC>; + power-domain-names = "top", + "mmcx", + "mx"; + + operating-points-v2 = <&csiphy_opp_table>; + + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csiphy2_in_ep: endpoint { + }; + }; + + port@1 { + reg = <1>; + + csiphy2_out_ep: endpoint { + }; + }; + }; + }; + + csiphy3: phy@acea000 { + compatible = "qcom,sm8450-csi2-phy", "qcom,x1e80100-csi2-phy"; + reg = <0 0x0acea000 0 0x2000>; + + clocks = <&camcc CAM_CC_CSIPHY3_CLK>, + <&camcc CAM_CC_CSI3PHYTIMER_CLK>, + <&camcc CAM_CC_CORE_AHB_CLK>; + clock-names = "core", + "timer", + "ahb"; + + interrupts = <GIC_SPI 448 IRQ_TYPE_EDGE_RISING>; + + power-domains = <&camcc TITAN_TOP_GDSC>, + <&rpmhpd RPMHPD_MMCX>, + <&rpmhpd RPMHPD_MXC>; + power-domain-names = "top", + "mmcx", + "mx"; + + operating-points-v2 = <&csiphy_opp_table>; + + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csiphy3_in_ep: endpoint { + }; + }; + + port@1 { + reg = <1>; + + csiphy3_out_ep: endpoint { + }; + }; + }; + }; + + csiphy4: phy@acec000 { + compatible = "qcom,sm8450-csi2-phy", "qcom,x1e80100-csi2-phy"; + reg = <0 0x0acec000 0 0x2000>; + + clocks = <&camcc CAM_CC_CSIPHY4_CLK>, + <&camcc CAM_CC_CSI4PHYTIMER_CLK>, + <&camcc CAM_CC_CORE_AHB_CLK>; + clock-names = "core", + "timer", + "ahb"; + + interrupts = <GIC_SPI 122 IRQ_TYPE_EDGE_RISING>; + + power-domains = <&camcc TITAN_TOP_GDSC>, + <&rpmhpd RPMHPD_MMCX>, + <&rpmhpd RPMHPD_MXC>; + power-domain-names = "top", + "mmcx", + "mx"; + + operating-points-v2 = <&csiphy_opp_table>; + + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csiphy4_in_ep: endpoint { + }; + }; + + port@1 { + reg = <1>; + + csiphy4_out_ep: endpoint { + }; + }; + }; + }; + + csiphy5: phy@acee000 { + compatible = "qcom,sm8450-csi2-phy", "qcom,x1e80100-csi2-phy"; + reg = <0 0x0acee000 0 0x2000>; + + clocks = <&camcc CAM_CC_CSIPHY5_CLK>, + <&camcc CAM_CC_CSI5PHYTIMER_CLK>, + <&camcc CAM_CC_CORE_AHB_CLK>; + clock-names = "core", + "timer", + "ahb"; + + interrupts = <GIC_SPI 89 IRQ_TYPE_EDGE_RISING>; + + power-domains = <&camcc TITAN_TOP_GDSC>, + <&rpmhpd RPMHPD_MMCX>, + <&rpmhpd RPMHPD_MXC>; + power-domain-names = "top", + "mmcx", + "mx"; + + operating-points-v2 = <&csiphy_opp_table>; + + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + csiphy5_in_ep: endpoint { + }; + }; + + port@1 { + reg = <1>; + + csiphy5_out_ep: endpoint { + }; + }; + }; + }; + camcc: clock-controller@ade0000 { compatible = "qcom,sm8450-camcc"; reg = <0 0x0ade0000 0 0x20000>;
Signature · 1 line
2.51.0
PATCH v2 6/7 arm64: dts: qcom: sm8450: Add CAMSS device tree node
In reply to Vladimir ZapolskiyAdd Qualcomm SM8450 CAMSS device tree node to the platform dtsi file, the CAMSS input ports are connected to output ports of CSIPHY devices.
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 173 +++++++++++++++++++++++++++ 1 file changed, 173 insertions(+)
arch/arm64/boot/dts/qcom/sm8450.dtsi +173 -0
@@ -3310,6 +3310,173 @@ cci1_i2c1: i2c-bus@1 { }; }; + camss: isp@acb6000 { + compatible = "qcom,sm8450-camss"; + + reg = <0 0xacb6000 0 0x1000>, + <0 0xacb7000 0 0x1000>, + <0 0xacb9000 0 0x1000>, + <0 0xacbb000 0 0x1000>, + <0 0xacc6000 0 0x1000>, + <0 0xacca000 0 0x1000>, + <0 0xacf6000 0 0x1000>, + <0 0xacf7000 0 0x1000>, + <0 0xacf8000 0 0x1000>, + <0 0xac62000 0 0x3000>, + <0 0xac71000 0 0x3000>, + <0 0xac80000 0 0x3000>, + <0 0xacc7000 0 0x2000>, + <0 0xaccb000 0 0x2000>; + reg-names = "csid_wrapper", + "csid0", + "csid1", + "csid2", + "csid_lite0", + "csid_lite1", + "tpg0", + "tpg1", + "tpg2", + "vfe0", + "vfe1", + "vfe2", + "vfe_lite0", + "vfe_lite1"; + + clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>, + <&camcc CAM_CC_CORE_AHB_CLK>, + <&camcc CAM_CC_CPAS_AHB_CLK>, + <&camcc CAM_CC_CPAS_FAST_AHB_CLK>, + <&camcc CAM_CC_CPAS_IFE_0_CLK>, + <&camcc CAM_CC_CPAS_IFE_1_CLK>, + <&camcc CAM_CC_CPAS_IFE_2_CLK>, + <&camcc CAM_CC_CPAS_IFE_LITE_CLK>, + <&camcc CAM_CC_CSID_CLK>, + <&camcc CAM_CC_CSID_CSIPHY_RX_CLK>, + <&gcc GCC_CAMERA_HF_AXI_CLK>, + <&camcc CAM_CC_IFE_0_CLK>, + <&camcc CAM_CC_IFE_0_FAST_AHB_CLK>, + <&camcc CAM_CC_IFE_1_CLK>, + <&camcc CAM_CC_IFE_1_FAST_AHB_CLK>, + <&camcc CAM_CC_IFE_2_CLK>, + <&camcc CAM_CC_IFE_2_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>; + clock-names = "camnoc_axi", + "core_ahb", + "cpas_ahb", + "cpas_fast_ahb", + "cpas_vfe0", + "cpas_vfe1", + "cpas_vfe2", + "cpas_vfe_lite", + "csid", + "csiphy_rx", + "gcc_hf_axi", + "vfe0", + "vfe0_fast_ahb", + "vfe1", + "vfe1_fast_ahb", + "vfe2", + "vfe2_fast_ahb", + "vfe_lite", + "vfe_lite_ahb", + "vfe_lite_cphy_rx", + "vfe_lite_csid"; + + interrupts = <GIC_SPI 464 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 466 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 640 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 468 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 359 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 465 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 467 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 641 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 469 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 360 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 0 + &config_noc SLAVE_CAMERA_CFG 0>, + <&mmss_noc MASTER_CAMNOC_HF 0 + &mc_virt SLAVE_EBI1 0>; + interconnect-names = "ahb", + "hf_mnoc"; + + iommus = <&apps_smmu 0x800 0x460>; + + power-domains = <&camcc IFE_0_GDSC>, + <&camcc IFE_1_GDSC>, + <&camcc IFE_2_GDSC>, + <&camcc TITAN_TOP_GDSC>; + power-domain-names = "ife0", "ife1", "ife2", "top"; + + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + camss_csiphy0_inep: endpoint { + remote-endpoint = <&csiphy0_out_ep>; + }; + }; + + port@1 { + reg = <1>; + + camss_csiphy1_inep: endpoint { + remote-endpoint = <&csiphy1_out_ep>; + }; + }; + + port@2 { + reg = <2>; + + camss_csiphy2_inep: endpoint { + remote-endpoint = <&csiphy2_out_ep>; + }; + }; + + port@3 { + reg = <3>; + + camss_csiphy3_inep: endpoint { + remote-endpoint = <&csiphy3_out_ep>; + }; + }; + + port@4 { + reg = <4>; + + camss_csiphy4_inep: endpoint { + remote-endpoint = <&csiphy4_out_ep>; + }; + }; + + port@5 { + reg = <5>; + + camss_csiphy5_inep: endpoint { + remote-endpoint = <&csiphy5_out_ep>; + }; + }; + }; + }; + csiphy0: phy@ace4000 { compatible = "qcom,sm8450-csi2-phy", "qcom,x1e80100-csi2-phy"; reg = <0 0x0ace4000 0 0x2000>;
@@ -3349,6 +3516,7 @@ port@1 { reg = <1>; csiphy0_out_ep: endpoint { + remote-endpoint = <&camss_csiphy0_inep>; }; }; };
@@ -3393,6 +3561,7 @@ port@1 { reg = <1>; csiphy1_out_ep: endpoint { + remote-endpoint = <&camss_csiphy1_inep>; }; }; };
@@ -3437,6 +3606,7 @@ port@1 { reg = <1>; csiphy2_out_ep: endpoint { + remote-endpoint = <&camss_csiphy2_inep>; }; }; };
@@ -3481,6 +3651,7 @@ port@1 { reg = <1>; csiphy3_out_ep: endpoint { + remote-endpoint = <&camss_csiphy3_inep>; }; }; };
@@ -3525,6 +3696,7 @@ port@1 { reg = <1>; csiphy4_out_ep: endpoint { + remote-endpoint = <&camss_csiphy4_inep>; }; }; };
@@ -3569,6 +3741,7 @@ port@1 { reg = <1>; csiphy5_out_ep: endpoint { + remote-endpoint = <&camss_csiphy5_inep>; }; }; };
Signature · 1 line
2.51.0
PATCH v2 7/7 arm64: dts: qcom: sm8450: Add description of pins with MCLK function
In reply to Vladimir ZapolskiyQualcomm SM8450 SoC provides up to 8 MCLK signals on GPIOs 100 to 107, add the correspondent default and sleep pin configurations.
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 112 +++++++++++++++++++++++++++ 1 file changed, 112 insertions(+)
arch/arm64/boot/dts/qcom/sm8450.dtsi +112 -0
@@ -4292,6 +4292,118 @@ data-pins { }; }; + cam0_default: cam0-default-state { + pins = "gpio100"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam0_sleep: cam0-sleep-state { + pins = "gpio100"; + function = "cam_mclk"; + drive-strength = <2>; + bias-pull-down; + }; + + cam1_default: cam1-default-state { + pins = "gpio101"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam1_sleep: cam1-sleep-state { + pins = "gpio101"; + function = "cam_mclk"; + drive-strength = <2>; + bias-pull-down; + }; + + cam2_default: cam2-default-state { + pins = "gpio102"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam2_sleep: cam2-sleep-state { + pins = "gpio102"; + function = "cam_mclk"; + drive-strength = <2>; + bias-pull-down; + }; + + cam3_default: cam3-default-state { + pins = "gpio103"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam3_sleep: cam3-sleep-state { + pins = "gpio103"; + function = "cam_mclk"; + drive-strength = <2>; + bias-pull-down; + }; + + cam4_default: cam4-default-state { + pins = "gpio104"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam4_sleep: cam4-sleep-state { + pins = "gpio104"; + function = "cam_mclk"; + drive-strength = <2>; + bias-pull-down; + }; + + cam5_default: cam5-default-state { + pins = "gpio105"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam5_sleep: cam5-sleep-state { + pins = "gpio105"; + function = "cam_mclk"; + drive-strength = <2>; + bias-pull-down; + }; + + cam6_default: cam6-default-state { + pins = "gpio106"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam6_sleep: cam6-sleep-state { + pins = "gpio106"; + function = "cam_mclk"; + drive-strength = <2>; + bias-pull-down; + }; + + cam7_default: cam7-default-state { + pins = "gpio107"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + + cam7_sleep: cam7-sleep-state { + pins = "gpio107"; + function = "cam_mclk"; + drive-strength = <2>; + bias-pull-down; + }; + cci0_default: cci0-default-state { /* SDA, SCL */ pins = "gpio110", "gpio111";
Signature · 1 line
2.51.0
Loic Poulain
reviewerRe: [PATCH v2 3/7] media: qcom: camss: Allow CSI2 PHY devices without CSIPHY resources
In reply to Vladimir ZapolskiyHi Vlad,
Quoted 38 lines · Vladimir Zapolskiy
If CAMSS CSIPHYs are supported by the stand-alone CSI2 PHY driver only, there is no need to provide description of legacy CSIPHY resources in the CAMSS driver, therefore if CSIPHY resources are not given for some supported platform, use CAMSS CSIPHY port numbers as CSIPHY identifiers.
Signed-off-by Vladimir Zapolskiy <[email protected]>--- drivers/media/platform/qcom/camss/camss-csiphy.c | 16 +++++++++++++--- drivers/media/platform/qcom/camss/camss.c | 8 ++++++-- 2 files changed, 19 insertions(+), 5 deletions(-)drivers/media/platform/qcom/camss/camss-csiphy.c +6
-1@@ -799,6 +799,11 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss,return ret; } +/* Fallback to generic SDM845 compatible formats for non-legacy CSIPHYs */ +static const struct csiphy_subdev_resources csiphy_res_phy = { + .formats = &csiphy_formats_sdm845, +}; +/* * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources * @camss: CAMSS structure @@ -808,7 +813,7 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss,*/ int msm_csiphy_subdev_init (struct camss *camss,u8 port) { -const struct camss_subdev_resources *res = &camss->res->csiphy_res[port]; +const struct camss_subdev_resources *res = camss->res->csiphy_res;struct csiphy_device *csiphy = &camss->csiphy[port];struct device *dev = camss->dev;struct device_node *ep, *remote;
drivers/media/platform/qcom/camss/camss-csiphy.c int msm_csiphy_subdev_init(struct camss *camss, u8 port) · line 846
Quoted 8 lines
drivers/media/platform/qcom/camss/camss-csiphy.c +3
-2@@ -836,8 +841,13 @@ int msm_csiphy_subdev_init(struct camss *camss, u8 port) } csiphy->camss = camss; - csiphy->id = res->csiphy.id; - csiphy->res = &res->csiphy; +if (res) { + csiphy->id = res[port].csiphy.id; + csiphy->res = &res[port].csiphy;
So, can't we simply drop the above assignment and keep only the port/csiphy_res_phy below? That would provide the same behavior for all non-legacy PHY initializations, regardless of whether legacy CSIPHY resources are described or not.
Quoted 43 lines
drivers/media/platform/qcom/camss/camss-csiphy.c +4
-0+ }else { + csiphy->id = port; + csiphy->res = &csiphy_res_phy; + }snprintf (csiphy->name,ARRAY_SIZE (csiphy->name),"csi%d" , csiphy->id);drivers/media/platform/qcom/camss/camss.c +6
-3@@ -4796,7 +4796,10 @@ static void camss_detect_legacy_phy(struct camss *camss)struct device_node *remote;struct device_node *ep; - camss->legacy_phy = true; +/* Legacy CSIPHY description implies the provided CSIPHY resources */ + camss->legacy_phy = !!camss->res->csiphy_res; +if (!camss->legacy_phy) + goto done;/* Find first remote-endpoint and determine if its a PHY */ for_each_endpoint_of_node (camss->dev->of_node, ep) {@@ -4810,6 +4813,7 @@ static void camss_detect_legacy_phy(struct camss *camss)break ; } +done:dev_dbg (camss->dev,"legacy phy mode %s\n" , camss->legacy_phy ?"true" :"false" ); }@@ -4841,7 +4845,7 @@ static int camss_init_subdevices(struct camss *camss)if (ret <0 ) {dev_err (camss->dev,"csiphy %d init fail\n" , - res->csiphy_res[i].csiphy.id); + res->csiphy_res ? res->csiphy_res[i].csiphy.id : i);return ret; } } --2.51.0
Re: [PATCH v2 5/7] arm64: dts: qcom: sm8450: Add CSI2 PHY device tree nodes
In reply to Vladimir ZapolskiyQuoted 5 lines · Vladimir Zapolskiy
Add device tree nodes of six CAMSS CSIPHYs found on Qualcomm SM8450 SoC, and a shared CSIPHY OPP table for them.
Reviewed-by Bryan O'Donoghue <[email protected]>Signed-off-by Vladimir Zapolskiy <[email protected]>
Re: [PATCH v2 6/7] arm64: dts: qcom: sm8450: Add CAMSS device tree node
In reply to Vladimir ZapolskiyQuoted 4 lines · Vladimir Zapolskiy
Add Qualcomm SM8450 CAMSS device tree node to the platform dtsi file, the CAMSS input ports are connected to output ports of CSIPHY devices.
Signed-off-by Vladimir Zapolskiy <[email protected]>
Re: [PATCH v2 7/7] arm64: dts: qcom: sm8450: Add description of pins with MCLK function
In reply to Vladimir ZapolskiyQuoted 5 lines · Vladimir Zapolskiy
Qualcomm SM8450 SoC provides up to 8 MCLK signals on GPIOs 100 to 107, add the correspondent default and sleep pin configurations.
Reviewed-by Konrad Dybcio <[email protected]>Signed-off-by Vladimir Zapolskiy <[email protected]>
Re: [PATCH v2 3/7] media: qcom: camss: Allow CSI2 PHY devices without CSIPHY resources
In reply to Loic PoulainQuoted 43 lines · Loic Poulain
Hi Vlad,
Quoted 40 lines · Vladimir Zapolskiy
If CAMSS CSIPHYs are supported by the stand-alone CSI2 PHY driver only, there is no need to provide description of legacy CSIPHY resources in the CAMSS driver, therefore if CSIPHY resources are not given for some supported platform, use CAMSS CSIPHY port numbers as CSIPHY identifiers.
Signed-off-by Vladimir Zapolskiy <[email protected]>--- drivers/media/platform/qcom/camss/camss-csiphy.c | 16 +++++++++++++--- drivers/media/platform/qcom/camss/camss.c | 8 ++++++-- 2 files changed, 19 insertions(+), 5 deletions(-)drivers/media/platform/qcom/camss/camss-csiphy.c +6
-1@@ -799,6 +799,11 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss,return ret; } +/* Fallback to generic SDM845 compatible formats for non-legacy CSIPHYs */ +static const struct csiphy_subdev_resources csiphy_res_phy = { + .formats = &csiphy_formats_sdm845, +}; +/* * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources * @camss: CAMSS structure @@ -808,7 +813,7 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss,*/ int msm_csiphy_subdev_init (struct camss *camss,u8 port) { -const struct camss_subdev_resources *res = &camss->res->csiphy_res[port]; +const struct camss_subdev_resources *res = camss->res->csiphy_res;struct csiphy_device *csiphy = &camss->csiphy[port];struct device *dev = camss->dev;struct device_node *ep, *remote;@@ -836,8 +841,13 @@ int msm_csiphy_subdev_init(struct camss *camss, u8 port) }
Quoted 12 lines
drivers/media/platform/qcom/camss/camss-csiphy.c int msm_csiphy_subdev_init(struct camss *camss, u8 port) · line 846
Quoted 6 lines
drivers/media/platform/qcom/camss/camss-csiphy.c +3
-2csiphy->camss = camss; - csiphy->id = res->csiphy.id; - csiphy->res = &res->csiphy; +if (res) { + csiphy->id = res[port].csiphy.id; + csiphy->res = &res[port].csiphy;So, can't we simply drop the above assignment and keep only the port/csiphy_res_phy below? That would provide the same behavior for all non-legacy PHY initializations, regardless of whether legacy CSIPHY resources are described or not.
Please note that 'csiphy_res_phy' was introduced a few lines above by this change, it's only purpose is to provide the needed supported media formats, and this is unavoidable.
This change follows the assumption that pixel formats from all non-legacy PHYs are SDM845 compatible, that's true for this platform, it is expected to be true for the most of approaching non-legacy platforms, and on demand it may be changed later on.
The current form likely is the most compact and the least invasive change, which gets to the point of supporting CAMSS on platforms with no CSIPHY resources given in the CAMSS driver.
For instance, note, the recently proposed Glymur CAMSS [1] references X1E CSIPHY resources, which is actually incorrect, since there is no "csiphyX" I/O resources anymore for Glymur. This change can be reused for Glymur as well, and its reference to X1E CSIPHYs can be dropped, but any better proposal or improvement are welcome.
Quoted 33 lines
Quoted 33 lines
drivers/media/platform/qcom/camss/camss-csiphy.c +4
-0+ }else { + csiphy->id = port; + csiphy->res = &csiphy_res_phy; + }snprintf (csiphy->name,ARRAY_SIZE (csiphy->name),"csi%d" , csiphy->id);drivers/media/platform/qcom/camss/camss.c +5
-1@@ -4796,7 +4796,10 @@ static void camss_detect_legacy_phy(struct camss *camss)struct device_node *remote;struct device_node *ep; - camss->legacy_phy = true; +/* Legacy CSIPHY description implies the provided CSIPHY resources */ + camss->legacy_phy = !!camss->res->csiphy_res; +if (!camss->legacy_phy) + goto done;/* Find first remote-endpoint and determine if its a PHY */ for_each_endpoint_of_node (camss->dev->of_node, ep) {@@ -4810,6 +4813,7 @@ static void camss_detect_legacy_phy(struct camss *camss)break ; } +done:dev_dbg (camss->dev,"legacy phy mode %s\n" , camss->legacy_phy ?"true" :"false" ); }@@ -4841,7 +4845,7 @@ static int camss_init_subdevices(struct camss *camss)
Quoted 10 lines
Quoted 10 lines
drivers/media/platform/qcom/camss/camss.c +1
-2if (ret <0 ) {dev_err (camss->dev,"csiphy %d init fail\n" , - res->csiphy_res[i].csiphy.id); + res->csiphy_res ? res->csiphy_res[i].csiphy.id : i);return ret; } } --2.51.0
[1] https://lore.kernel.org/linux-arm-msm/[email protected]/
Signature · 2 lines
Best wishes, Vladimir
Re: [PATCH v2 1/7] dt-bindings: phy: qcom,x1e80100-csi2-phy: Add SM8450 compatible
In reply to Vladimir ZapolskiyQuoted 9 lines · Vladimir Zapolskiy
Qualcomm SM8450 SoC has six CSIPHY IPs, which are compatible with Hamoa ones:
qcom-mipi-csi2-phy acec000.phy: CSIPHY 3PH HW Version = 0x40010000Hardware supports up to three different 0.9v level power supplies for CSIPHY0/1, CSIPHY2/3 and CSIPHY4/5, but there is just a single 1.2v power line
VDD_A_CSI_1P2, which supplies all CSIPHY devices.
Quoted 5 lines
Reviewed-by Bryan O'Donoghue <[email protected]>Signed-off-by Vladimir Zapolskiy <[email protected]>--- .../devicetree/bindings/phy/qcom,x1e80100-csi2-phy.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Best regards,
Krzysztof
Re: [PATCH v2 2/7] dt-bindings: media: Add Qualcomm SM8450 CAMSS
In reply to Vladimir ZapolskiyQuoted 5 lines · Vladimir Zapolskiy
Add Qualcomm SM8450 CAMSS device tree binding, it contains
* three CSID and two CSID lite blocks,
* three VFE and two VFE lite blocks,
* three CSI test pattern generators,
Quoted 8 lines
Six CSIPHY blocks are described as separate CSIPHY devices connected to CAMSS input ports.
Signed-off-by Vladimir Zapolskiy <[email protected]>--- .../bindings/media/qcom,sm8450-camss.yaml | 274 ++++++++++++++++++ 1 file changed, 274 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,sm8450-camss.yaml
Best regards,
Krzysztof
Re: [PATCH v2 3/7] media: qcom: camss: Allow CSI2 PHY devices without CSIPHY resources
In reply to Vladimir ZapolskiyQuoted 7 lines · Vladimir Zapolskiy
If CAMSS CSIPHYs are supported by the stand-alone CSI2 PHY driver only, there is no need to provide description of legacy CSIPHY resources in the CAMSS driver, therefore if CSIPHY resources are not given for some supported platform, use CAMSS CSIPHY port numbers as CSIPHY identifiers.
Signed-off-by Vladimir Zapolskiy <[email protected]>
Quoted 82 lines
--- drivers/media/platform/qcom/camss/camss-csiphy.c | 16 +++++++++++++--- drivers/media/platform/qcom/camss/camss.c | 8 ++++++-- 2 files changed, 19 insertions(+), 5 deletions(-)drivers/media/platform/qcom/camss/camss-csiphy.c +13
-3@@ -799,6 +799,11 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss,return ret; } +/* Fallback to generic SDM845 compatible formats for non-legacy CSIPHYs */ +static const struct csiphy_subdev_resources csiphy_res_phy = { + .formats = &csiphy_formats_sdm845, +}; +/* * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources * @camss: CAMSS structure @@ -808,7 +813,7 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss,*/ int msm_csiphy_subdev_init (struct camss *camss,u8 port) { -const struct camss_subdev_resources *res = &camss->res->csiphy_res[port]; +const struct camss_subdev_resources *res = camss->res->csiphy_res;struct csiphy_device *csiphy = &camss->csiphy[port];struct device *dev = camss->dev;struct device_node *ep, *remote;@@ -836,8 +841,13 @@ int msm_csiphy_subdev_init(struct camss *camss, u8 port) } csiphy->camss = camss; - csiphy->id = res->csiphy.id; - csiphy->res = &res->csiphy; +if (res) { + csiphy->id = res[port].csiphy.id; + csiphy->res = &res[port].csiphy; + }else { + csiphy->id = port; + csiphy->res = &csiphy_res_phy; + }snprintf (csiphy->name,ARRAY_SIZE (csiphy->name),"csi%d" , csiphy->id);drivers/media/platform/qcom/camss/camss.c +6
-3@@ -4796,7 +4796,10 @@ static void camss_detect_legacy_phy(struct camss *camss)struct device_node *remote;struct device_node *ep; - camss->legacy_phy = true; +/* Legacy CSIPHY description implies the provided CSIPHY resources */ + camss->legacy_phy = !!camss->res->csiphy_res; +if (!camss->legacy_phy) + goto done;/* Find first remote-endpoint and determine if its a PHY */ for_each_endpoint_of_node (camss->dev->of_node, ep) {@@ -4810,6 +4813,7 @@ static void camss_detect_legacy_phy(struct camss *camss)break ; } +done:dev_dbg (camss->dev,"legacy phy mode %s\n" , camss->legacy_phy ?"true" :"false" ); }@@ -4841,7 +4845,7 @@ static int camss_init_subdevices(struct camss *camss)if (ret <0 ) {dev_err (camss->dev,"csiphy %d init fail\n" , - res->csiphy_res[i].csiphy.id); + res->csiphy_res ? res->csiphy_res[i].csiphy.id : i);return ret; } } --2.51.0
Re: [PATCH v2 3/7] media: qcom: camss: Allow CSI2 PHY devices without CSIPHY resources
In reply to Vladimir ZapolskiyQuoted 7 lines · Vladimir Zapolskiy
If CAMSS CSIPHYs are supported by the stand-alone CSI2 PHY driver only, there is no need to provide description of legacy CSIPHY resources in the CAMSS driver, therefore if CSIPHY resources are not given for some supported platform, use CAMSS CSIPHY port numbers as CSIPHY identifiers.
Signed-off-by Vladimir Zapolskiy <[email protected]>---
Quoted 81 lines
drivers/media/platform/qcom/camss/camss-csiphy.c | 16 +++++++++++++--- drivers/media/platform/qcom/camss/camss.c | 8 ++++++-- 2 files changed, 19 insertions(+), 5 deletions(-)drivers/media/platform/qcom/camss/camss-csiphy.c +13
-3@@ -799,6 +799,11 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss,return ret; } +/* Fallback to generic SDM845 compatible formats for non-legacy CSIPHYs */ +static const struct csiphy_subdev_resources csiphy_res_phy = { + .formats = &csiphy_formats_sdm845, +}; +/* * msm_csiphy_subdev_init - Initialize CSIPHY device structure and resources * @camss: CAMSS structure @@ -808,7 +813,7 @@ int msm_csiphy_subdev_init_legacy(struct camss *camss,*/ int msm_csiphy_subdev_init (struct camss *camss,u8 port) { -const struct camss_subdev_resources *res = &camss->res->csiphy_res[port]; +const struct camss_subdev_resources *res = camss->res->csiphy_res;struct csiphy_device *csiphy = &camss->csiphy[port];struct device *dev = camss->dev;struct device_node *ep, *remote;@@ -836,8 +841,13 @@ int msm_csiphy_subdev_init(struct camss *camss, u8 port) } csiphy->camss = camss; - csiphy->id = res->csiphy.id; - csiphy->res = &res->csiphy; +if (res) { + csiphy->id = res[port].csiphy.id; + csiphy->res = &res[port].csiphy; + }else { + csiphy->id = port; + csiphy->res = &csiphy_res_phy; + }snprintf (csiphy->name,ARRAY_SIZE (csiphy->name),"csi%d" , csiphy->id);drivers/media/platform/qcom/camss/camss.c +6
-3@@ -4796,7 +4796,10 @@ static void camss_detect_legacy_phy(struct camss *camss)struct device_node *remote;struct device_node *ep; - camss->legacy_phy = true; +/* Legacy CSIPHY description implies the provided CSIPHY resources */ + camss->legacy_phy = !!camss->res->csiphy_res; +if (!camss->legacy_phy) + goto done;/* Find first remote-endpoint and determine if its a PHY */ for_each_endpoint_of_node (camss->dev->of_node, ep) {@@ -4810,6 +4813,7 @@ static void camss_detect_legacy_phy(struct camss *camss)break ; } +done:dev_dbg (camss->dev,"legacy phy mode %s\n" , camss->legacy_phy ?"true" :"false" ); }@@ -4841,7 +4845,7 @@ static int camss_init_subdevices(struct camss *camss)if (ret <0 ) {dev_err (camss->dev,"csiphy %d init fail\n" , - res->csiphy_res[i].csiphy.id); + res->csiphy_res ? res->csiphy_res[i].csiphy.id : i);return ret; } } --2.51.0
Quoted 133 lines · Vladimir Zapolskiy
Add support of the camera subsystem (CAMSS) found on Qualcomm SM8450 SoC.
The CAMSS IP on SM8450 contains:
* three CSID and two CSID lite, which are supported by CSID 680,
* three VFE and two VFE lite blocks, which are supported by VFE 680,
* three CSI test pattern generators, which are supported by TPG Gen1.Qualcomm SM8450 CSIPHYs are supported by the CSI2 PHY driver only.
Signed-off-by Vladimir Zapolskiy <[email protected]>--- drivers/media/platform/qcom/camss/camss-vfe.c | 2 + drivers/media/platform/qcom/camss/camss.c | 236 ++++++++++++++++++ drivers/media/platform/qcom/camss/camss.h | 1 + 3 files changed, 239 insertions(+)drivers/media/platform/qcom/camss/camss-vfe.c +2
-0@@ -350,6 +350,7 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code,case CAMSS_8280XP :case CAMSS_8300 :case CAMSS_845 : +case CAMSS_8450 :case CAMSS_8550 :case CAMSS_8650 :case CAMSS_8775P :@@ -2010,6 +2011,7 @@ static int vfe_bpl_align_rdi(struct vfe_device *vfe)case CAMSS_8280XP :case CAMSS_8300 :case CAMSS_845 : +case CAMSS_8450 :case CAMSS_8550 :case CAMSS_8650 :case CAMSS_8775P :drivers/media/platform/qcom/camss/camss.c +89
-0@@ -2967,6 +2967,226 @@ static const struct resources_icc icc_res_sc8280xp[] = { }, }; +static const struct camss_subdev_resources csid_res_sm8450[] = { +/* CSID0 */ + { + .regulators = {}, + .clock = {"cpas_ahb" ,"csid" ,"csiphy_rx" }, + .clock_rate = { {0 }, + {480000000 }, + {400000000 }, }, + .reg = {"csid0" }, + .interrupt = {"csid0" }, + .csid = { + .hw_ops = &csid_ops_680, + .parent_dev_ops = &vfe_parent_dev_ops, + .formats = &csid_formats_gen2, + }, + }, +/* CSID1 */ + { + .regulators = {}, + .clock = {"cpas_ahb" ,"csid" ,"csiphy_rx" }, + .clock_rate = { {0 }, + {480000000 }, + {400000000 }, }, + .reg = {"csid1" }, + .interrupt = {"csid1" }, + .csid = { + .hw_ops = &csid_ops_680, + .parent_dev_ops = &vfe_parent_dev_ops, + .formats = &csid_formats_gen2, + }, + }, +/* CSID2 */ + { + .regulators = {}, + .clock = {"cpas_ahb" ,"csid" ,"csiphy_rx" }, + .clock_rate = { {0 }, + {480000000 }, + {400000000 }, }, + .reg = {"csid2" }, + .interrupt = {"csid2" }, + .csid = { + .hw_ops = &csid_ops_680, + .parent_dev_ops = &vfe_parent_dev_ops, + .formats = &csid_formats_gen2, + }, + }, +/* CSID_LITE0 */ + { + .regulators = {}, + .clock = {"cpas_ahb" ,"vfe_lite_csid" ,"vfe_lite_cphy_rx" , +"csiphy_rx" }, + .clock_rate = { {0 }, + {480000000 }, + {400000000 }, + {400000000 }, }, + .reg = {"csid_lite0" }, + .interrupt = {"csid_lite0" }, + .csid = { + .is_lite = true, + .hw_ops = &csid_ops_680, + .parent_dev_ops = &vfe_parent_dev_ops, + .formats = &csid_formats_gen2, + }, + }, +/* CSID_LITE1 */ + { + .regulators = {}, + .clock = {"cpas_ahb" ,"vfe_lite_csid" ,"vfe_lite_cphy_rx" , +"csiphy_rx" }, + .clock_rate = { {0 }, + {480000000 }, + {400000000 }, + {400000000 }, }, + .reg = {"csid_lite1" }, + .interrupt = {"csid_lite1" }, + .csid = { + .is_lite = true, + .hw_ops = &csid_ops_680, + .parent_dev_ops = &vfe_parent_dev_ops, + .formats = &csid_formats_gen2, + }, + }, +}; + +static const struct camss_subdev_resources vfe_res_sm8450[] = { +/* IFE0 */ + { + .regulators = {}, + .clock = {"gcc_hf_axi" ,"camnoc_axi" ,"cpas_ahb" ,
drivers/media/platform/qcom/camss/camss.c static const struct resources_icc icc_res_sc8280xp[] = { · line 3068
Quoted 10 lines
drivers/media/platform/qcom/camss/camss.c +10
-0+"core_ahb" ,"cpas_fast_ahb" ,"cpas_vfe0" , + "vfe0_fast_ahb", "vfe0" }, + .clock_rate = { { 0 }, + { 300000000, 400000000 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 432000000, 594000000, 675000000, 727000000 }, },
Nit:
Can you align clock and clock_rate wrap method,
"gcc_hf_axi", "camnoc_axi", "cpas_ahb",
{0}, { 300000000, 400000000 }, {0},1st line have 3 clock at .clock,
clock rate also 3 clock_rate.
So reader can know corresponding rate quickly,
for example, If I know rate of cpas_fast_ahb, reader can simple
locate by second row and second col.
Frank
Re: [PATCH v2 3/7] media: qcom: camss: Allow CSI2 PHY devices without CSIPHY resources
In reply to Vladimir ZapolskiyQuoted 4 lines · Vladimir Zapolskiy
Please note that '
csiphy_res_phy' was introduced a few lines above by this change, it's only purpose is to provide the needed supported media formats, and this is unavoidable.
Right, agreed. Glymur uses the non-legacy path, but that path still uses camss->res->csiphy_res in msm_csiphy_subdev_init(), at least to get the CSIPHY id and supported media formats. That is why Glymur currently has a non-NULL csiphy_res even though the actual PHY programming is handled by the standalone CSI2 PHY driver.
Quoted 9 lines
This change follows the assumption that pixel formats from all non-legacy PHYs are SDM845 compatible, that's true for this platform, it is expected to be true for the most of approaching non-legacy platforms, and on demand it may be changed later on.
The current form likely is the most compact and the least invasive change, which gets to the point of supporting CAMSS on platforms with no CSIPHY resources given in the CAMSS driver.
Quoted 5 lines
For instance, note, the recently proposed Glymur CAMSS [1] references X1E CSIPHY resources, which is actually incorrect, since there is no "csiphyX" I/O resources anymore for Glymur. This change can be reused for Glymur as well, and its reference to X1E CSIPHYs can be dropped, but any better proposal or improvement are welcome.
The intention was not to describe CAMSS-owned CSIPHY I/O resources for Glymur. This also follows the earlier suggestion to reuse/fall back to the Hamoa/X1E CAMSS description where possible:
https://lore.kernel.org/all/lepv7cgykrylficddcnnbii3kzxsiei3itcwc4ibq53s33rogi@ndnf7zrtu5ex/
Moving Glymur to .csiphy_res = NULL is possible, but with this fallback the CSIPHY id comes from the CAMSS port number. Since Glymur uses CSIPHY ids 0, 1 and 4, that would also require Glymur-specific driver data and DT/binding updates to describe CSIPHY4 as CAMSS port 4.
Bryan, Loic, do you think we need that change now, or should Glymur keep the current approach for this DTS series?
Signature · 2 lines
Regards, Nihal Kumar Gupta
Loic Poulain
reviewerRe: [PATCH v2 3/7] media: qcom: camss: Allow CSI2 PHY devices without CSIPHY resources
Quoted 36 lines · Nihal Kumar Gupta
Quoted 4 lines · Vladimir Zapolskiy
Please note that '
csiphy_res_phy' was introduced a few lines above by this change, it's only purpose is to provide the needed supported media formats, and this is unavoidable.Right, agreed. Glymur uses the non-legacy path, but that path still uses
camss->res->csiphy_resinmsm_csiphy_subdev_init(), at least to get the CSIPHY id and supported media formats. That is why Glymur currently has a non-NULLcsiphy_reseven though the actual PHY programming is handled by the standalone CSI2 PHY driver.Quoted 9 lines
This change follows the assumption that pixel formats from all non-legacy PHYs are SDM845 compatible, that's true for this platform, it is expected to be true for the most of approaching non-legacy platforms, and on demand it may be changed later on.
The current form likely is the most compact and the least invasive change, which gets to the point of supporting CAMSS on platforms with no CSIPHY resources given in the CAMSS driver.
Quoted 5 lines
For instance, note, the recently proposed Glymur CAMSS [1] references X1E CSIPHY resources, which is actually incorrect, since there is no "csiphyX" I/O resources anymore for Glymur. This change can be reused for Glymur as well, and its reference to X1E CSIPHYs can be dropped, but any better proposal or improvement are welcome.
The intention was not to describe CAMSS-owned CSIPHY I/O resources for Glymur. This also follows the earlier suggestion to reuse/fall back to the Hamoa/X1E CAMSS description where possible:
https://lore.kernel.org/all/lepv7cgykrylficddcnnbii3kzxsiei3itcwc4ibq53s33rogi@ndnf7zrtu5ex/
Quoted 7 lines
Moving Glymur to .csiphy_res = NULL is possible, but with this fallback the CSIPHY id comes from the CAMSS port number. Since Glymur uses CSIPHY ids 0, 1 and 4, that would also require Glymur-specific driver data and DT/binding updates to describe CSIPHY4 as CAMSS port 4.
Bryan, Loic, do you think we need that change now, or should Glymur keep the current approach for this DTS series?
I see in the following in your Glymur series:
port@3 {
reg = <3>;
camss_csiphy4_inep: endpoint {
remote-endpoint = <&csiphy4_out_ep>;
};
Which CAMSS pipeline interface index/instance is CSIPHY4 connected to? If it is connected to interface 4 on CAMSS side, then we should use port@4.
Regards,
Loic
Re: [PATCH v2 3/7] media: qcom: camss: Allow CSI2 PHY devices without CSIPHY resources
Quoted 9 lines · Loic Poulain
Quoted 2 lines
Bryan, Loic, do you think we need that change now, or should Glymur keep the current approach for this DTS series?
I see in the following in your Glymur series:
port@3 { reg = <3>; camss_csiphy4_inep: endpoint { remote-endpoint = <&csiphy4_out_ep>; };
Quoted 3 lines
Which CAMSS pipeline interface index/instance is CSIPHY4 connected to? If it is connected to interface 4 on CAMSS side, then we should use port@4.
CSIPHY4 is connected to CAMSS interface/index 4, so the DT should describe it as port@4 for a direct one-to-one hardware mapping.
I will raise a patch to update that.
Signature · 2 lines
Regards, Nihal Kumar Gupta
Re: (subset) [PATCH v2 0/7] media: qcom: camss: Add SM8450 CAMSS support
In reply to Vladimir ZapolskiyQuoted 11 lines · Vladimir Zapolskiy
This series adds support of Qualcomm SM8450 Camera Subsystem.
The CSIPHYs are described as separate CSIPHY devices compatible with X1E80100 ones, there is no legacy CSIPHY resource description in the CAMSS driver, and this option is not intended to be supported.
The change can be immediately tested on any SM8450 powered board by running an image stream from TPG to CSIDs, CSIPHY IPs are equal to the ones found on Hamoa platform, and were tested on a private board.
[...]
Applied, thanks!
[1/7] dt-bindings: phy: qcom,x1e80100-csi2-phy: Add SM8450 compatible
commit: 069e05f3dfd76b1ee4d0500056c983a469f58b87
Best regards,
Signature · 1 line
~Vinod