Skip to contentSkip to conversation

arm64: dts: ti: Enable camera for SK-AM62P

PATCH Applied Jai Luthra 2 participants 6 messages Feb 20, 2024 – Feb 22, 2024

Subsystems (2)
lore
Share & tools
lore

Jai Luthra

author
#0 lore raw

v2 cover arm64: dts: ti: Enable camera for SK-AM62P

This series enables support for camera sensors using CSI-RX ports on AM62P family of SoCs.

Particularly, it enables OV5640 and IMX219 sensors via the 22-pin FFC CSI-RX connector on SK-AM62P [1] using the existing common overlays for SK-AM62* family of boards.

Capture test:
https://gist.github.com/jailuthra/11f3383ccc0902b9db90d806222597a3

[1]: https://www.ti.com/tool/SK-AM62P-LP

---
Changes in v2:
- Rebase on top of ti-k3-dts-next
- Fix commit description of PATCH 3/4 to specify we are keeping the nodes disabled
- Link to v1: https://lore.kernel.org/r/[email protected]

Range-diff from v1:

1: 646c0b26cee4 ! 1: 61c395edcfd3 arm64: dts: ti: k3-am62p: Fix memory ranges for DMSS
@@ Commit message
to enable programming the interrupts correctly.

Fixes 29075cc09f43 ("arm64: dts: ti: Introduce AM62P5 family of SoCs")

+ Reviewed-by: Vaishnav Achath <[email protected]>

## arch/arm64/boot/dts/ti/k3-am62p.dtsi ##
2: 5d6c41db44e3 ! 2: 2720ce668bf9 arm64: dts: ti: k3-am62p: Add DMASS1 for CSI
@@ Commit message
On AM62P, CSI-RX uses a dedicated BCDMA instance (DMASS1) for transferring captured camera frames to DDR, so enable it.

+ Reviewed-by: Vaishnav Achath <[email protected]>

## arch/arm64/boot/dts/ti/k3-am62p-main.dtsi ##
3: 2896237c1ad1 ! 3: 9853acf0bc6f arm64: dts: ti: k3-am62p: Add nodes for CSI-RX
@@ Commit message

AM62P supports image capture via the MIPI CSI-2 protocol, it uses three IPs to achieve this: Cadence DPHY, Cadence CSI-RX, and TI's pixelgrabber
- wrapper on top. Enable all of these IPs in the devicetree.
+ wrapper on top. Add nodes for these IPs in the devicetree, and keep them
+ disabled here, so these may be enabled by the sensor overlays.

+ Reviewed-by: Vaishnav Achath <[email protected]>

## arch/arm64/boot/dts/ti/k3-am62p-main.dtsi ##

4:  7a82f73e345d < -:  ------------ arm64: dts: ti: Enable overlays for SK-AM62P
-:  ------------ > 4:  1a5e859dec12 arm64: dts: ti: Enable overlays for SK-AM62P

---
Jai Luthra (4):
arm64: dts: ti: k3-am62p: Fix memory ranges for DMSS
arm64: dts: ti: k3-am62p: Add DMASS1 for CSI
arm64: dts: ti: k3-am62p: Add nodes for CSI-RX
arm64: dts: ti: Enable overlays for SK-AM62P

 arch/arm64/boot/dts/ti/Makefile           | 10 ++++
 arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 98 +++++++++++++++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am62p.dtsi      |  2 +-
 3 files changed, 109 insertions(+), 1 deletion(-)

---
base-commit: 0f9eb43f009091501dd0c68232aa6530ba0e0185
change-id: 20240201-am62p_csi-b69d172406ca

Best regards,

Signature · 1 line
Jai Luthra <[email protected]>
author
#1 lore raw

PATCH v2 1/4 arm64: dts: ti: k3-am62p: Fix memory ranges for DMSS

The INTR module for DMASS1 (CSI specific DMASS) is outside the currently available ranges, as it starts at 0x4e400000. So fix the ranges property to enable programming the interrupts correctly.

Fixes 29075cc09f43 ("arm64: dts: ti: Introduce AM62P5 family of SoCs")
---
 arch/arm64/boot/dts/ti/k3-am62p.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am62p.dtsi +1 -1
index d111e044bfdf..94babc412575 100644
@@ -71,7 +71,7 @@ cbass_main: bus@f0000 {
 			 <0x00 0x43600000 0x00 0x43600000 0x00 0x00010000>, /* SA3 sproxy data */
 			 <0x00 0x44043000 0x00 0x44043000 0x00 0x00000fe0>, /* TI SCI DEBUG */
 			 <0x00 0x44860000 0x00 0x44860000 0x00 0x00040000>, /* SA3 sproxy config */
-			 <0x00 0x48000000 0x00 0x48000000 0x00 0x06400000>, /* DMSS */
+			 <0x00 0x48000000 0x00 0x48000000 0x00 0x06408000>, /* DMSS */
 			 <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */
 			 <0x00 0x70000000 0x00 0x70000000 0x00 0x00010000>, /* OCSRAM */
 			 <0x01 0x00000000 0x01 0x00000000 0x00 0x00310000>, /* A53 PERIPHBASE */
Signature · 1 line
2.43.0
author
#2 lore raw

PATCH v2 2/4 arm64: dts: ti: k3-am62p: Add DMASS1 for CSI

In reply to Jai Luthra

On AM62P, CSI-RX uses a dedicated BCDMA instance (DMASS1) for transferring captured camera frames to DDR, so enable it.

---
 arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 37 +++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/ti/k3-am62p-main.dtsi +37 -0
index e43530beb79f..fb328774879c 100644
@@ -158,6 +158,43 @@ main_pktdma: dma-controller@485c0000 {
 		};
 	};
 
+	dmss_csi: bus@4e000000 {
+		compatible = "simple-bus";
+		ranges = <0x00 0x4e000000 0x00 0x4e000000 0x00 0x408000>;
+		#address-cells = <2>;
+		#size-cells = <2>;
+		dma-ranges;
+		ti,sci-dev-id = <198>;
+
+		inta_main_dmss_csi: interrupt-controller@4e400000 {
+			compatible = "ti,sci-inta";
+			reg = <0x00 0x4e400000 0x00 0x8000>;
+			#interrupt-cells = <0>;
+			interrupt-controller;
+			interrupt-parent = <&gic500>;
+			msi-controller;
+			power-domains = <&k3_pds 182 TI_SCI_PD_EXCLUSIVE>;
+			ti,sci = <&dmsc>;
+			ti,sci-dev-id = <200>;
+			ti,interrupt-ranges = <0 237 8>;
+			ti,unmapped-event-sources = <&main_bcdma_csi>;
+		};
+
+		main_bcdma_csi: dma-controller@4e230000 {
+			compatible = "ti,am62a-dmss-bcdma-csirx";
+			reg = <0x00 0x4e230000 0x00 0x100>,
+			      <0x00 0x4e180000 0x00 0x8000>,
+			      <0x00 0x4e100000 0x00 0x10000>;
+			reg-names = "gcfg", "rchanrt", "ringrt";
+			#dma-cells = <3>;
+			msi-parent = <&inta_main_dmss_csi>;
+			power-domains = <&k3_pds 182 TI_SCI_PD_EXCLUSIVE>;
+			ti,sci = <&dmsc>;
+			ti,sci-dev-id = <199>;
+			ti,sci-rm-range-rchan = <0x21>;
+		};
+	};
+
 	dmsc: system-controller@44043000 {
 		compatible = "ti,k2g-sci";
 		ti,host-id = <12>;
Signature · 1 line
2.43.0
author
#3 lore raw

PATCH v2 3/4 arm64: dts: ti: k3-am62p: Add nodes for CSI-RX

In reply to Jai Luthra

AM62P supports image capture via the MIPI CSI-2 protocol, it uses three IPs to achieve this: Cadence DPHY, Cadence CSI-RX, and TI's pixelgrabber wrapper on top. Add nodes for these IPs in the devicetree, and keep them disabled here, so these may be enabled by the sensor overlays.

---
 arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 61 +++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
arch/arm64/boot/dts/ti/k3-am62p-main.dtsi +61 -0
index fb328774879c..3f271e7710d8 100644
@@ -966,4 +966,65 @@ mcasp2: audio-controller@2b20000 {
 		power-domains = <&k3_pds 192 TI_SCI_PD_EXCLUSIVE>;
 		status = "disabled";
 	};
+
+	ti_csi2rx0: ticsi2rx@30102000 {
+		compatible = "ti,j721e-csi2rx-shim";
+		reg = <0x00 0x30102000 0x00 0x1000>;
+		ranges;
+		#address-cells = <2>;
+		#size-cells = <2>;
+		dmas = <&main_bcdma_csi 0 0x5000 0>;
+		dma-names = "rx0";
+		power-domains = <&k3_pds 182 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+
+		cdns_csi2rx0: csi-bridge@30101000 {
+			compatible = "ti,j721e-csi2rx", "cdns,csi2rx";
+			reg = <0x00 0x30101000 0x00 0x1000>;
+			clocks = <&k3_clks 182 0>, <&k3_clks 182 3>, <&k3_clks 182 0>,
+				<&k3_clks 182 0>, <&k3_clks 182 4>, <&k3_clks 182 4>;
+			clock-names = "sys_clk", "p_clk", "pixel_if0_clk",
+				"pixel_if1_clk", "pixel_if2_clk", "pixel_if3_clk";
+			phys = <&dphy0>;
+			phy-names = "dphy";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				csi0_port0: port@0 {
+					reg = <0>;
+					status = "disabled";
+				};
+
+				csi0_port1: port@1 {
+					reg = <1>;
+					status = "disabled";
+				};
+
+				csi0_port2: port@2 {
+					reg = <2>;
+					status = "disabled";
+				};
+
+				csi0_port3: port@3 {
+					reg = <3>;
+					status = "disabled";
+				};
+
+				csi0_port4: port@4 {
+					reg = <4>;
+					status = "disabled";
+				};
+			};
+		};
+	};
+
+	dphy0: phy@30110000 {
+		compatible = "cdns,dphy-rx";
+		reg = <0x00 0x30110000 0x00 0x1100>;
+		#phy-cells = <0>;
+		power-domains = <&k3_pds 185 TI_SCI_PD_EXCLUSIVE>;
+		status = "disabled";
+	};
 };
Signature · 1 line
2.43.0
author
#4 lore raw

PATCH v2 4/4 arm64: dts: ti: Enable overlays for SK-AM62P

In reply to Jai Luthra

Enable symbols so that overlays can be applied on the base DTB for SK-AM62P.

Also compile-test known-to-work camera sensor overlays for OV5640 and IMX219.

---
 arch/arm64/boot/dts/ti/Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/ti/Makefile +10 -0
index d601c52ab181..9843b7656725 100644
@@ -116,6 +116,12 @@ k3-am62a7-sk-csi2-ov5640-dtbs := k3-am62a7-sk.dtb \
 k3-am62a7-sk-csi2-tevi-ov5640-dtbs := k3-am62a7-sk.dtb \
 	k3-am62x-sk-csi2-tevi-ov5640.dtbo
 k3-am62a7-sk-hdmi-audio-dtbs := k3-am62a7-sk.dtb k3-am62x-sk-hdmi-audio.dtbo
+k3-am62p5-sk-csi2-imx219-dtbs := k3-am62p5-sk.dtb \
+	k3-am62x-sk-csi2-imx219.dtbo
+k3-am62p5-sk-csi2-ov5640-dtbs := k3-am62p5-sk.dtb \
+	k3-am62x-sk-csi2-ov5640.dtbo
+k3-am62p5-sk-csi2-tevi-ov5640-dtbs := k3-am62p5-sk.dtb \
+	k3-am62x-sk-csi2-tevi-ov5640.dtbo
 k3-am642-evm-icssg1-dualemac-dtbs := \
 	k3-am642-evm.dtb k3-am642-evm-icssg1-dualemac.dtbo
 k3-am642-tqma64xxl-mbax4xxl-sdcard-dtbs := \
@@ -142,6 +148,9 @@ dtb- += k3-am625-beagleplay-csi2-ov5640.dtb \
 	k3-am62a7-sk-csi2-imx219.dtb \
 	k3-am62a7-sk-csi2-ov5640.dtb \
 	k3-am62a7-sk-hdmi-audio.dtb \
+	k3-am62p5-sk-csi2-imx219.dtb \
+	k3-am62p5-sk-csi2-ov5640.dtb \
+	k3-am62p5-sk-csi2-tevi-ov5640.dtb \
 	k3-am642-evm-icssg1-dualemac.dtb \
 	k3-am642-tqma64xxl-mbax4xxl-sdcard.dtb \
 	k3-am642-tqma64xxl-mbax4xxl-wlan.dtb \
@@ -156,6 +165,7 @@ DTC_FLAGS_k3-am625-beagleplay += -@
 DTC_FLAGS_k3-am625-sk += -@
 DTC_FLAGS_k3-am62-lp-sk += -@
 DTC_FLAGS_k3-am62a7-sk += -@
+DTC_FLAGS_k3-am62p5-sk += -@
 DTC_FLAGS_k3-am642-evm += -@
 DTC_FLAGS_k3-am642-tqma64xxl-mbax4xxl += -@
 DTC_FLAGS_k3-am6548-iot2050-advanced-m2 += -@
Signature · 1 line
2.43.0
maintainer Applied
#5 lore raw
In reply to Jai Luthra

Hi Jai Luthra,

Quoted 8 lines · Jai Luthra

This series enables support for camera sensors using CSI-RX ports on AM62P family of SoCs.

Particularly, it enables OV5640 and IMX219 sensors via the 22-pin FFC CSI-RX connector on SK-AM62P [1] using the existing common overlays for SK-AM62* family of boards.

[...]

I have applied the following to branch ti-k3-dts-next on [1]. Thank you!

[1/4] arm64: dts: ti: k3-am62p: Fix memory ranges for DMSS

      commit: 90a67583171f213711de662fab9f8d24a2d291a9
[2/4] arm64: dts: ti: k3-am62p: Add DMASS1 for CSI
      commit: 091e2e05228fa3fd424b1d775b04fb4734d5275b
[3/4] arm64: dts: ti: k3-am62p: Add nodes for CSI-RX
      commit: a8787f4fd29a43c5351daf3059a6156ff089a441
[4/4] arm64: dts: ti: Enable overlays for SK-AM62P
      commit: 598139b8c7c56cc6fb30ef8b4cf34b53a7fa5d0f

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent up the chain during the next merge window (or sooner if it is a relevant bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
--
Vignesh