Skip to contentSkip to conversation

arm64: dts: qcom: sm8350: Add CCI and camera MCLK pins

PATCH In review Vladimir Zapolskiy 5 participants 11 messages Nov 4 – Nov 19

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

cover arm64: dts: qcom: sm8350: Add CCI and camera MCLK pins

Add Qualcomm SM8350 Camera Control Interface (CCI) controllers and the pin configurations of camera sensor master clock outputs.

The series depends on the SM8350 camera clock controller support:

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

Vladimir Zapolskiy (3):
dt-bindings: i2c: qcom-cci: Document SM8350 compatible
arm64: dts: qcom: sm8350: Add CCI device tree nodes
arm64: dts: qcom: sm8350: Add camera MCLK pinctrl states

 .../devicetree/bindings/i2c/qcom,i2c-cci.yaml |   2 +
 arch/arm64/boot/dts/qcom/sm8350.dtsi          | 231 ++++++++++++++++++
 2 files changed, 233 insertions(+)
Signature · 1 line
2.51.0
#1 lore raw

PATCH 1/3 dt-bindings: i2c: qcom-cci: Document SM8350 compatible

Add Qualcomm SM8350 SoC compatible to the CCI device tree bindings, SM8350 CCI is compatible with CCI v2 found on MSM8996.

---
 Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml +2 -0
index 1e8def25ec0e..63083e0bdd9c 100644
@@ -40,6 +40,7 @@ properties:
               - qcom,sm6150-cci
               - qcom,sm6350-cci
               - qcom,sm8250-cci
+              - qcom,sm8350-cci
               - qcom,sm8450-cci
               - qcom,sm8550-cci
               - qcom,sm8650-cci
@@ -219,6 +220,7 @@ allOf:
             enum:
               - qcom,sc7280-cci
               - qcom,sm8250-cci
+              - qcom,sm8350-cci
               - qcom,sm8450-cci
     then:
       properties:
Signature · 1 line
2.51.0
#5 lore raw

PATCH 2/3 arm64: dts: qcom: sm8350: Add CCI device tree nodes

In reply to Vladimir Zapolskiy

Add Camera Control Interface (CCI) controller device tree nodes and pin configurations of the I2C busses to SM8350 SoC dtsi.

---
 arch/arm64/boot/dts/qcom/sm8350.dtsi | 147 +++++++++++++++++++++++++++
 1 file changed, 147 insertions(+)
arch/arm64/boot/dts/qcom/sm8350.dtsi +147 -0
index a51942c99f8a..41dff3736061 100644
@@ -10,6 +10,7 @@
 #include <dt-bindings/clock/qcom,gcc-sm8350.h>
 #include <dt-bindings/clock/qcom,gpucc-sm8350.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
+#include <dt-bindings/clock/qcom,sm8350-camcc.h>
 #include <dt-bindings/clock/qcom,sm8350-videocc.h>
 #include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/firmware/qcom,scm.h>
@@ -2830,6 +2831,88 @@ videocc: clock-controller@abf0000 {
 			#power-domain-cells = <1>;
 		};
 
+		cci0: cci@ac4f000 {
+			compatible = "qcom,sm8350-cci", "qcom,msm8996-cci";
+			reg = <0 0x0ac4f000 0 0x1000>;
+			interrupts = <GIC_SPI 460 IRQ_TYPE_EDGE_RISING>;
+			power-domains = <&camcc TITAN_TOP_GDSC>;
+
+			clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+				 <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+				 <&camcc CAM_CC_CPAS_AHB_CLK>,
+				 <&camcc CAM_CC_CCI_0_CLK>,
+				 <&camcc CAM_CC_CCI_0_CLK_SRC>;
+			clock-names = "camnoc_axi",
+				      "slow_ahb_src",
+				      "cpas_ahb",
+				      "cci",
+				      "cci_src";
+
+			pinctrl-0 = <&cci0_0_default &cci0_1_default>;
+			pinctrl-1 = <&cci0_0_sleep &cci0_1_sleep>;
+			pinctrl-names = "default", "sleep";
+
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			status = "disabled";
+
+			cci0_i2c0: i2c-bus@0 {
+				reg = <0>;
+				clock-frequency = <1000000>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+
+			cci0_i2c1: i2c-bus@1 {
+				reg = <1>;
+				clock-frequency = <1000000>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+		};
+
+		cci1: cci@ac50000 {
+			compatible = "qcom,sm8350-cci", "qcom,msm8996-cci";
+			reg = <0 0x0ac50000 0 0x1000>;
+			interrupts = <GIC_SPI 271 IRQ_TYPE_EDGE_RISING>;
+			power-domains = <&camcc TITAN_TOP_GDSC>;
+
+			clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+				 <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+				 <&camcc CAM_CC_CPAS_AHB_CLK>,
+				 <&camcc CAM_CC_CCI_1_CLK>,
+				 <&camcc CAM_CC_CCI_1_CLK_SRC>;
+			clock-names = "camnoc_axi",
+				      "slow_ahb_src",
+				      "cpas_ahb",
+				      "cci",
+				      "cci_src";
+
+			pinctrl-0 = <&cci1_0_default &cci1_1_default>;
+			pinctrl-1 = <&cci1_0_sleep &cci1_1_sleep>;
+			pinctrl-names = "default", "sleep";
+
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			status = "disabled";
+
+			cci1_i2c0: i2c-bus@0 {
+				reg = <0>;
+				clock-frequency = <1000000>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+
+			cci1_i2c1: i2c-bus@1 {
+				reg = <1>;
+				clock-frequency = <1000000>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+		};
+
 		camcc: clock-controller@ad00000 {
 			compatible = "qcom,sm8350-camcc";
 			reg = <0 0x0ad00000 0 0x10000>;
@@ -3348,6 +3431,70 @@ tlmm: pinctrl@f100000 {
 			gpio-ranges = <&tlmm 0 0 204>;
 			wakeup-parent = <&pdc>;
 
+			cci0_0_default: cci0-0-default-state {
+				/* SDA, SCL */
+				pins = "gpio107", "gpio108";
+				function = "cci_i2c";
+				drive-strength = <2>;
+				bias-pull-up;
+			};
+
+			cci0_0_sleep: cci0-0-sleep-state {
+				/* SDA, SCL */
+				pins = "gpio107", "gpio108";
+				function = "cci_i2c";
+				drive-strength = <2>;
+				bias-pull-down;
+			};
+
+			cci0_1_default: cci0-1-default-state {
+				/* SDA, SCL */
+				pins = "gpio109", "gpio110";
+				function = "cci_i2c";
+				drive-strength = <2>;
+				bias-pull-up;
+			};
+
+			cci0_1_sleep: cci0-1-sleep-state {
+				/* SDA, SCL */
+				pins = "gpio109", "gpio110";
+				function = "cci_i2c";
+				drive-strength = <2>;
+				bias-pull-down;
+			};
+
+			cci1_0_default: cci1-0-default-state {
+				/* SDA, SCL */
+				pins = "gpio111", "gpio112";
+				function = "cci_i2c";
+				drive-strength = <2>;
+				bias-pull-up;
+			};
+
+			cci1_0_sleep: cci1-0-sleep-state {
+				/* SDA, SCL */
+				pins = "gpio111", "gpio112";
+				function = "cci_i2c";
+				drive-strength = <2>;
+				bias-pull-down;
+			};
+
+			cci1_1_default: cci1-1-default-state {
+				/* SDA, SCL */
+				pins = "gpio113", "gpio114";
+				function = "cci_i2c";
+				drive-strength = <2>;
+				bias-pull-up;
+			};
+
+			cci1_1_sleep: cci1-1-sleep-state {
+				/* SDA, SCL */
+				pins = "gpio113", "gpio114";
+				function = "cci_i2c";
+				drive-strength = <2>;
+				bias-pull-down;
+			};
+
 			sdc2_default_state: sdc2-default-state {
 				clk-pins {
 					pins = "sdc2_clk";
Signature · 1 line
2.51.0
#9 lore raw

PATCH 3/3 arm64: dts: qcom: sm8350: Add camera MCLK pinctrl states

In reply to Vladimir Zapolskiy

Add pinctrl states of six camera sensor MCLK output pins found on Qualcomm SM8350 SoC.

---
 arch/arm64/boot/dts/qcom/sm8350.dtsi | 84 ++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
arch/arm64/boot/dts/qcom/sm8350.dtsi +84 -0
index 41dff3736061..437ceaa28fbd 100644
@@ -3431,6 +3431,90 @@ tlmm: pinctrl@f100000 {
 			gpio-ranges = <&tlmm 0 0 204>;
 			wakeup-parent = <&pdc>;
 
+			cam_mclk0_default: cam-mclk0-default-state {
+				pins = "gpio100";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-disable;
+			};
+
+			cam_mclk0_sleep: cam-mclk0-sleep-state {
+				pins = "gpio100";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-pull-down;
+			};
+
+			cam_mclk1_default: cam-mclk1-default-state {
+				pins = "gpio101";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-disable;
+			};
+
+			cam_mclk1_sleep: cam-mclk1-sleep-state {
+				pins = "gpio101";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-pull-down;
+			};
+
+			cam_mclk2_default: cam-mclk2-default-state {
+				pins = "gpio102";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-disable;
+			};
+
+			cam_mclk2_sleep: cam-mclk2-sleep-state {
+				pins = "gpio102";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-pull-down;
+			};
+
+			cam_mclk3_default: cam-mclk3-default-state {
+				pins = "gpio103";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-disable;
+			};
+
+			cam_mclk3_sleep: cam-mclk3-sleep-state {
+				pins = "gpio103";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-pull-down;
+			};
+
+			cam_mclk4_default: cam-mclk4-default-state {
+				pins = "gpio104";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-disable;
+			};
+
+			cam_mclk4_sleep: cam-mclk4-sleep-state {
+				pins = "gpio104";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-pull-down;
+			};
+
+			cam_mclk5_default: cam-mclk5-default-state {
+				pins = "gpio105";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-disable;
+			};
+
+			cam_mclk5_sleep: cam-mclk5-sleep-state {
+				pins = "gpio105";
+				function = "cam_mclk";
+				drive-strength = <2>;
+				bias-pull-down;
+			};
+
 			cci0_0_default: cci0-0-default-state {
 				/* SDA, SCL */
 				pins = "gpio107", "gpio108";
Signature · 1 line
2.51.0
maintainer
#6 lore raw

Re: [PATCH 2/3] arm64: dts: qcom: sm8350: Add CCI device tree nodes

In reply to Vladimir Zapolskiy
Quoted 111 lines · Vladimir Zapolskiy

Add Camera Control Interface (CCI) controller device tree nodes and pin configurations of the I2C busses to SM8350 SoC dtsi.

---
 arch/arm64/boot/dts/qcom/sm8350.dtsi | 147 +++++++++++++++++++++++++++
 1 file changed, 147 insertions(+)
arch/arm64/boot/dts/qcom/sm8350.dtsi +83 -0
index a51942c99f8a..41dff3736061 100644
@@ -10,6 +10,7 @@
 #include <dt-bindings/clock/qcom,gcc-sm8350.h>
 #include <dt-bindings/clock/qcom,gpucc-sm8350.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
+#include <dt-bindings/clock/qcom,sm8350-camcc.h>
 #include <dt-bindings/clock/qcom,sm8350-videocc.h>
 #include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/firmware/qcom,scm.h>
@@ -2830,6 +2831,88 @@ videocc: clock-controller@abf0000 {
                        #power-domain-cells = <1>;
                };
 
+               cci0: cci@ac4f000 {
+                       compatible = "qcom,sm8350-cci", "qcom,msm8996-cci";
+                       reg = <0 0x0ac4f000 0 0x1000>;
+                       interrupts = <GIC_SPI 460 IRQ_TYPE_EDGE_RISING>;
+                       power-domains = <&camcc TITAN_TOP_GDSC>;
+
+                       clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+                                <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+                                <&camcc CAM_CC_CPAS_AHB_CLK>,
+                                <&camcc CAM_CC_CCI_0_CLK>,
+                                <&camcc CAM_CC_CCI_0_CLK_SRC>;
+                       clock-names = "camnoc_axi",
+                                     "slow_ahb_src",
+                                     "cpas_ahb",
+                                     "cci",
+                                     "cci_src";
+
+                       pinctrl-0 = <&cci0_0_default &cci0_1_default>;
+                       pinctrl-1 = <&cci0_0_sleep &cci0_1_sleep>;
+                       pinctrl-names = "default", "sleep";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+
+                       cci0_i2c0: i2c-bus@0 {
+                               reg = <0>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+
+                       cci0_i2c1: i2c-bus@1 {
+                               reg = <1>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+
+               cci1: cci@ac50000 {
+                       compatible = "qcom,sm8350-cci", "qcom,msm8996-cci";
+                       reg = <0 0x0ac50000 0 0x1000>;
+                       interrupts = <GIC_SPI 271 IRQ_TYPE_EDGE_RISING>;
+                       power-domains = <&camcc TITAN_TOP_GDSC>;
+
+                       clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+                                <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+                                <&camcc CAM_CC_CPAS_AHB_CLK>,
+                                <&camcc CAM_CC_CCI_1_CLK>,
+                                <&camcc CAM_CC_CCI_1_CLK_SRC>;
+                       clock-names = "camnoc_axi",
+                                     "slow_ahb_src",
+                                     "cpas_ahb",
+                                     "cci",
+                                     "cci_src";
+
+                       pinctrl-0 = <&cci1_0_default &cci1_1_default>;
+                       pinctrl-1 = <&cci1_0_sleep &cci1_1_sleep>;
+                       pinctrl-names = "default", "sleep";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+
+                       cci1_i2c0: i2c-bus@0 {
+                               reg = <0>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+
+                       cci1_i2c1: i2c-bus@1 {
+                               reg = <1>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+
                camcc: clock-controller@ad00000 {
                        compatible = "qcom,sm8350-camcc";
                        reg = <0 0x0ad00000 0 0x10000>;

arch/arm64/boot/dts/qcom/sm8350.dtsi tlmm: pinctrl@f100000 { · line 3439

Quoted 9 lines
arch/arm64/boot/dts/qcom/sm8350.dtsi +6 -0
@@ -3348,6 +3431,70 @@ tlmm: pinctrl@f100000 {
                        gpio-ranges = <&tlmm 0 0 204>;
                        wakeup-parent = <&pdc>;
 
+                       cci0_0_default: cci0-0-default-state {
+                               /* SDA, SCL */
+                               pins = "gpio107", "gpio108";
+                               function = "cci_i2c";
+                               drive-strength = <2>;
+                               bias-pull-up;

I had similar comments on a different platform, but why pull-up here (for SCL/SDA)? Do we expect boards to lack the external pull-ups required by I2C? If not, enabling the internal pull-ups seems unnecessary. Also, what is their effective resistance on these platforms? Aren't they typically too weak to meet the rise-time requirements of most I2C modes anyway?

Quoted 64 lines
arch/arm64/boot/dts/qcom/sm8350.dtsi +58 -1
+                       };
+
+                       cci0_0_sleep: cci0-0-sleep-state {
+                               /* SDA, SCL */
+                               pins = "gpio107", "gpio108";
+                               function = "cci_i2c";
+                               drive-strength = <2>;
+                               bias-pull-down;
+                       };
+
+                       cci0_1_default: cci0-1-default-state {
+                               /* SDA, SCL */
+                               pins = "gpio109", "gpio110";
+                               function = "cci_i2c";
+                               drive-strength = <2>;
+                               bias-pull-up;
+                       };
+
+                       cci0_1_sleep: cci0-1-sleep-state {
+                               /* SDA, SCL */
+                               pins = "gpio109", "gpio110";
+                               function = "cci_i2c";
+                               drive-strength = <2>;
+                               bias-pull-down;
+                       };
+
+                       cci1_0_default: cci1-0-default-state {
+                               /* SDA, SCL */
+                               pins = "gpio111", "gpio112";
+                               function = "cci_i2c";
+                               drive-strength = <2>;
+                               bias-pull-up;
+                       };
+
+                       cci1_0_sleep: cci1-0-sleep-state {
+                               /* SDA, SCL */
+                               pins = "gpio111", "gpio112";
+                               function = "cci_i2c";
+                               drive-strength = <2>;
+                               bias-pull-down;
+                       };
+
+                       cci1_1_default: cci1-1-default-state {
+                               /* SDA, SCL */
+                               pins = "gpio113", "gpio114";
+                               function = "cci_i2c";
+                               drive-strength = <2>;
+                               bias-pull-up;
+                       };
+
+                       cci1_1_sleep: cci1-1-sleep-state {
+                               /* SDA, SCL */
+                               pins = "gpio113", "gpio114";
+                               function = "cci_i2c";
+                               drive-strength = <2>;
+                               bias-pull-down;
+                       };
+
                        sdc2_default_state: sdc2-default-state {
                                clk-pins {
                                        pins = "sdc2_clk";
--

2.51.0

maintainer Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] dt-bindings: i2c: qcom-cci: Document SM8350 compatible

In reply to Vladimir Zapolskiy
Quoted 5 lines · Vladimir Zapolskiy

Add Qualcomm SM8350 SoC compatible to the CCI device tree bindings, SM8350 CCI is compatible with CCI v2 found on MSM8996.

Quoted 27 lines
---
 Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml +2 -1
index 1e8def25ec0e..63083e0bdd9c 100644
@@ -40,6 +40,7 @@ properties:
               - qcom,sm6150-cci
               - qcom,sm6350-cci
               - qcom,sm8250-cci
+              - qcom,sm8350-cci
               - qcom,sm8450-cci
               - qcom,sm8550-cci
               - qcom,sm8650-cci
@@ -219,6 +220,7 @@ allOf:
             enum:
               - qcom,sc7280-cci
               - qcom,sm8250-cci
+              - qcom,sm8350-cci
               - qcom,sm8450-cci
     then:
       properties:
--

2.51.0

Acked-by on v1 1/3
#3 lore raw

Re: [PATCH 1/3] dt-bindings: i2c: qcom-cci: Document SM8350 compatible

In reply to Vladimir Zapolskiy
Quoted 5 lines · Vladimir Zapolskiy

Add Qualcomm SM8350 SoC compatible to the CCI device tree bindings, SM8350 CCI is compatible with CCI v2 found on MSM8996.

Probably qcom tree here as well...

#7 lore raw

Re: [PATCH 2/3] arm64: dts: qcom: sm8350: Add CCI device tree nodes

In reply to Loic Poulain

Hi Loic.

Quoted 115 lines · Loic Poulain
Quoted 114 lines · Vladimir Zapolskiy

Add Camera Control Interface (CCI) controller device tree nodes and pin configurations of the I2C busses to SM8350 SoC dtsi.

---
  arch/arm64/boot/dts/qcom/sm8350.dtsi | 147 +++++++++++++++++++++++++++
  1 file changed, 147 insertions(+)
arch/arm64/boot/dts/qcom/sm8350.dtsi +83 -0
index a51942c99f8a..41dff3736061 100644
@@ -10,6 +10,7 @@
  #include <dt-bindings/clock/qcom,gcc-sm8350.h>
  #include <dt-bindings/clock/qcom,gpucc-sm8350.h>
  #include <dt-bindings/clock/qcom,rpmh.h>
+#include <dt-bindings/clock/qcom,sm8350-camcc.h>
  #include <dt-bindings/clock/qcom,sm8350-videocc.h>
  #include <dt-bindings/dma/qcom-gpi.h>
  #include <dt-bindings/firmware/qcom,scm.h>
@@ -2830,6 +2831,88 @@ videocc: clock-controller@abf0000 {
                         #power-domain-cells = <1>;
                 };
 
+               cci0: cci@ac4f000 {
+                       compatible = "qcom,sm8350-cci", "qcom,msm8996-cci";
+                       reg = <0 0x0ac4f000 0 0x1000>;
+                       interrupts = <GIC_SPI 460 IRQ_TYPE_EDGE_RISING>;
+                       power-domains = <&camcc TITAN_TOP_GDSC>;
+
+                       clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+                                <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+                                <&camcc CAM_CC_CPAS_AHB_CLK>,
+                                <&camcc CAM_CC_CCI_0_CLK>,
+                                <&camcc CAM_CC_CCI_0_CLK_SRC>;
+                       clock-names = "camnoc_axi",
+                                     "slow_ahb_src",
+                                     "cpas_ahb",
+                                     "cci",
+                                     "cci_src";
+
+                       pinctrl-0 = <&cci0_0_default &cci0_1_default>;
+                       pinctrl-1 = <&cci0_0_sleep &cci0_1_sleep>;
+                       pinctrl-names = "default", "sleep";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+
+                       cci0_i2c0: i2c-bus@0 {
+                               reg = <0>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+
+                       cci0_i2c1: i2c-bus@1 {
+                               reg = <1>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+
+               cci1: cci@ac50000 {
+                       compatible = "qcom,sm8350-cci", "qcom,msm8996-cci";
+                       reg = <0 0x0ac50000 0 0x1000>;
+                       interrupts = <GIC_SPI 271 IRQ_TYPE_EDGE_RISING>;
+                       power-domains = <&camcc TITAN_TOP_GDSC>;
+
+                       clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+                                <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+                                <&camcc CAM_CC_CPAS_AHB_CLK>,
+                                <&camcc CAM_CC_CCI_1_CLK>,
+                                <&camcc CAM_CC_CCI_1_CLK_SRC>;
+                       clock-names = "camnoc_axi",
+                                     "slow_ahb_src",
+                                     "cpas_ahb",
+                                     "cci",
+                                     "cci_src";
+
+                       pinctrl-0 = <&cci1_0_default &cci1_1_default>;
+                       pinctrl-1 = <&cci1_0_sleep &cci1_1_sleep>;
+                       pinctrl-names = "default", "sleep";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+
+                       cci1_i2c0: i2c-bus@0 {
+                               reg = <0>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+
+                       cci1_i2c1: i2c-bus@1 {
+                               reg = <1>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+
                 camcc: clock-controller@ad00000 {
                         compatible = "qcom,sm8350-camcc";
                         reg = <0 0x0ad00000 0 0x10000>;
@@ -3348,6 +3431,70 @@ tlmm: pinctrl@f100000 {
                         gpio-ranges = <&tlmm 0 0 204>;
                         wakeup-parent = <&pdc>;
 
Quoted 9 lines

arch/arm64/boot/dts/qcom/sm8350.dtsi tlmm: pinctrl@f100000 { · line 3439

Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8350.dtsi +6 -0
+                       cci0_0_default: cci0-0-default-state {
+                               /* SDA, SCL */
+                               pins = "gpio107", "gpio108";
+                               function = "cci_i2c";
+                               drive-strength = <2>;
+                               bias-pull-up;

I had similar comments on a different platform, but why pull-up here (for SCL/SDA)?

Here the setting was literally copied from the downstream pad configuration of CCI SDA/SCL lines, likely the same has been done for other platforms too.

Quoted 2 lines

Do we expect boards to lack the external pull-ups
required by I2C?

The I2C spec requires pull-ups, but I believe it does not require external pull-ups explicitly, so there should be no contradiction with the spec.

Quoted 4 lines

If not, enabling the internal pull-ups seems unnecessary. Also, what is their effective resistance on these platforms? Aren't they typically too weak to meet the rise-time requirements of most I2C modes anyway?

Likely you are right that the internal pull-ups alone are too weak to get the I2C bus functional on higher bus speeds.

What's your preference on this subject, do you wish to see 'bias-disabled' instead? I won't have objections against it.

Signature · 2 lines
Best wishes,
Vladimir
maintainer
#8 lore raw

Re: [PATCH 2/3] arm64: dts: qcom: sm8350: Add CCI device tree nodes

Hi Vlad,

Quoted 143 lines · Vladimir Zapolskiy

Hi Loic.

Quoted 115 lines · Loic Poulain
Quoted 114 lines · Vladimir Zapolskiy

Add Camera Control Interface (CCI) controller device tree nodes and pin configurations of the I2C busses to SM8350 SoC dtsi.

---
  arch/arm64/boot/dts/qcom/sm8350.dtsi | 147 +++++++++++++++++++++++++++
  1 file changed, 147 insertions(+)
arch/arm64/boot/dts/qcom/sm8350.dtsi +83 -0
index a51942c99f8a..41dff3736061 100644
@@ -10,6 +10,7 @@
  #include <dt-bindings/clock/qcom,gcc-sm8350.h>
  #include <dt-bindings/clock/qcom,gpucc-sm8350.h>
  #include <dt-bindings/clock/qcom,rpmh.h>
+#include <dt-bindings/clock/qcom,sm8350-camcc.h>
  #include <dt-bindings/clock/qcom,sm8350-videocc.h>
  #include <dt-bindings/dma/qcom-gpi.h>
  #include <dt-bindings/firmware/qcom,scm.h>
@@ -2830,6 +2831,88 @@ videocc: clock-controller@abf0000 {
                         #power-domain-cells = <1>;
                 };
 
+               cci0: cci@ac4f000 {
+                       compatible = "qcom,sm8350-cci", "qcom,msm8996-cci";
+                       reg = <0 0x0ac4f000 0 0x1000>;
+                       interrupts = <GIC_SPI 460 IRQ_TYPE_EDGE_RISING>;
+                       power-domains = <&camcc TITAN_TOP_GDSC>;
+
+                       clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+                                <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+                                <&camcc CAM_CC_CPAS_AHB_CLK>,
+                                <&camcc CAM_CC_CCI_0_CLK>,
+                                <&camcc CAM_CC_CCI_0_CLK_SRC>;
+                       clock-names = "camnoc_axi",
+                                     "slow_ahb_src",
+                                     "cpas_ahb",
+                                     "cci",
+                                     "cci_src";
+
+                       pinctrl-0 = <&cci0_0_default &cci0_1_default>;
+                       pinctrl-1 = <&cci0_0_sleep &cci0_1_sleep>;
+                       pinctrl-names = "default", "sleep";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+
+                       cci0_i2c0: i2c-bus@0 {
+                               reg = <0>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+
+                       cci0_i2c1: i2c-bus@1 {
+                               reg = <1>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+
+               cci1: cci@ac50000 {
+                       compatible = "qcom,sm8350-cci", "qcom,msm8996-cci";
+                       reg = <0 0x0ac50000 0 0x1000>;
+                       interrupts = <GIC_SPI 271 IRQ_TYPE_EDGE_RISING>;
+                       power-domains = <&camcc TITAN_TOP_GDSC>;
+
+                       clocks = <&camcc CAM_CC_CAMNOC_AXI_CLK>,
+                                <&camcc CAM_CC_SLOW_AHB_CLK_SRC>,
+                                <&camcc CAM_CC_CPAS_AHB_CLK>,
+                                <&camcc CAM_CC_CCI_1_CLK>,
+                                <&camcc CAM_CC_CCI_1_CLK_SRC>;
+                       clock-names = "camnoc_axi",
+                                     "slow_ahb_src",
+                                     "cpas_ahb",
+                                     "cci",
+                                     "cci_src";
+
+                       pinctrl-0 = <&cci1_0_default &cci1_1_default>;
+                       pinctrl-1 = <&cci1_0_sleep &cci1_1_sleep>;
+                       pinctrl-names = "default", "sleep";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+
+                       cci1_i2c0: i2c-bus@0 {
+                               reg = <0>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+
+                       cci1_i2c1: i2c-bus@1 {
+                               reg = <1>;
+                               clock-frequency = <1000000>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+
                 camcc: clock-controller@ad00000 {
                         compatible = "qcom,sm8350-camcc";
                         reg = <0 0x0ad00000 0 0x10000>;
@@ -3348,6 +3431,70 @@ tlmm: pinctrl@f100000 {
                         gpio-ranges = <&tlmm 0 0 204>;
                         wakeup-parent = <&pdc>;
 
Quoted 9 lines

arch/arm64/boot/dts/qcom/sm8350.dtsi tlmm: pinctrl@f100000 { · line 3439

Quoted 6 lines
arch/arm64/boot/dts/qcom/sm8350.dtsi +6 -0
+                       cci0_0_default: cci0-0-default-state {
+                               /* SDA, SCL */
+                               pins = "gpio107", "gpio108";
+                               function = "cci_i2c";
+                               drive-strength = <2>;
+                               bias-pull-up;

I had similar comments on a different platform, but why pull-up here (for SCL/SDA)?

Here the setting was literally copied from the downstream pad configuration of CCI SDA/SCL lines, likely the same has been done for other platforms too.

Quoted 2 lines

Do we expect boards to lack the external pull-ups
required by I2C?

The I2C spec requires pull-ups, but I believe it does not require external pull-ups explicitly, so there should be no contradiction with the spec.

Quoted 4 lines

If not, enabling the internal pull-ups seems unnecessary. Also, what is their effective resistance on these platforms? Aren't they typically too weak to meet the rise-time requirements of most I2C modes anyway?

Quoted 5 lines

Likely you are right that the internal pull-ups alone are too weak to get the I2C bus functional on higher bus speeds.

What's your preference on this subject, do you wish to see 'bias-disabled' instead? I won't have objections against it.

Yes, I would prefer bias-disable. I think the pull-up configuration is an unfortunate setting that we've been carrying forward for quite some time. It would be better to use bias-disable in the default pinctrl configuration so that the baseline setup supports proper board designs with external pull-ups, while avoiding unnecessary internal pull-up 'interference'.

Regards,
Loic

maintainer Acked-by on v1 1/3
#4 lore raw

Re: [PATCH 1/3] dt-bindings: i2c: qcom-cci: Document SM8350 compatible

In reply to Vladimir Zapolskiy
Quoted 8 lines · Vladimir Zapolskiy

Add Qualcomm SM8350 SoC compatible to the CCI device tree bindings, SM8350 CCI is compatible with CCI v2 found on MSM8996.

---
 Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml | 2 ++
 1 file changed, 2 insertions(+)