[v2,5/9] arm64: dts: ti: k3-am62x-sk: Enable camera peripherals

Message ID 20231117-csi_dts-v2-5-bf4312194a6b@ti.com
State New
Headers
Series arm64: dts: ti: Enable CSI cameras for AM62 family |

Commit Message

Jai Luthra Nov. 17, 2023, 9:28 a.m. UTC
  CSI cameras are controlled using I2C, on SK-AM62 and derivative boards
this is routed to I2C-2, so enable that bus. Also enable the nodes for
CSI-RX and DPHY-RX IPs.

Specific sensor connected to this bus will be described in the DT
overlay for each sensor.

Tested-by: Martyn Welch <martyn.welch@collabora.com>
Signed-off-by: Jai Luthra <j-luthra@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
  

Comments

Andrew Davis Nov. 20, 2023, 7:32 p.m. UTC | #1
On 11/17/23 3:28 AM, Jai Luthra wrote:
> CSI cameras are controlled using I2C, on SK-AM62 and derivative boards
> this is routed to I2C-2, so enable that bus. Also enable the nodes for
> CSI-RX and DPHY-RX IPs.
> 
> Specific sensor connected to this bus will be described in the DT
> overlay for each sensor.
> 
> Tested-by: Martyn Welch <martyn.welch@collabora.com>
> Signed-off-by: Jai Luthra <j-luthra@ti.com>
> ---
>   arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> index 19f57ead4ebd..21658f811307 100644
> --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> @@ -399,6 +399,13 @@ sii9022_out: endpoint {
>   	};
>   };
>   
> +&main_i2c2 {
> +	status = "okay";
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&main_i2c2_pins_default>;
> +	clock-frequency = <400000>;
> +};
> +
>   &sdhci0 {
>   	bootph-all;
>   	status = "okay";
> @@ -517,3 +524,11 @@ dpi1_out: endpoint {
>   		};
>   	};
>   };
> +
> +&ti_csi2rx0 {
> +	status = "okay";
> +};
> +
> +&dphy0 {
> +	status = "okay";
> +};
> 

Why do this in the common file? These should go in the overlays
that actually make use of these nodes, same as you did for BeaglePlay
in patch [4/9].

Andrew
  
Jai Luthra Nov. 28, 2023, 9:06 a.m. UTC | #2
Hi Andrew,

Thanks for the comments.

On Nov 20, 2023 at 13:32:33 -0600, Andrew Davis wrote:
> On 11/17/23 3:28 AM, Jai Luthra wrote:
> > CSI cameras are controlled using I2C, on SK-AM62 and derivative boards
> > this is routed to I2C-2, so enable that bus. Also enable the nodes for
> > CSI-RX and DPHY-RX IPs.
> > 
> > Specific sensor connected to this bus will be described in the DT
> > overlay for each sensor.
> > 
> > Tested-by: Martyn Welch <martyn.welch@collabora.com>
> > Signed-off-by: Jai Luthra <j-luthra@ti.com>
> > ---
> >   arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 15 +++++++++++++++
> >   1 file changed, 15 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > index 19f57ead4ebd..21658f811307 100644
> > --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
> > @@ -399,6 +399,13 @@ sii9022_out: endpoint {
> >   	};
> >   };
> > +&main_i2c2 {
> > +	status = "okay";
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&main_i2c2_pins_default>;
> > +	clock-frequency = <400000>;
> > +};
> > +
> >   &sdhci0 {
> >   	bootph-all;
> >   	status = "okay";
> > @@ -517,3 +524,11 @@ dpi1_out: endpoint {
> >   		};
> >   	};
> >   };
> > +
> > +&ti_csi2rx0 {
> > +	status = "okay";
> > +};
> > +
> > +&dphy0 {
> > +	status = "okay";
> > +};
> > 
> 
> Why do this in the common file? These should go in the overlays
> that actually make use of these nodes, same as you did for BeaglePlay
> in patch [4/9].

Makes sense for the csi2rx nodes, will move it to the overlay in v3.

For the i2c node (and also gpio expander on sk-am62a) I think it is 
better to enable them in the base DTB here, as it helps in 
detecting/debugging new sensors using userspace utilities like 
i2c-detect without actually having a functional overlay.

> 
> Andrew
  

Patch

diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
index 19f57ead4ebd..21658f811307 100644
--- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
@@ -399,6 +399,13 @@  sii9022_out: endpoint {
 	};
 };
 
+&main_i2c2 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_i2c2_pins_default>;
+	clock-frequency = <400000>;
+};
+
 &sdhci0 {
 	bootph-all;
 	status = "okay";
@@ -517,3 +524,11 @@  dpi1_out: endpoint {
 		};
 	};
 };
+
+&ti_csi2rx0 {
+	status = "okay";
+};
+
+&dphy0 {
+	status = "okay";
+};