diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makefile index d474ee530bbf..8dfb46af79b0 100644 --- a/arch/arm64/boot/dts/ti/Makefile +++ b/arch/arm64/boot/dts/ti/Makefile @@ -200,6 +200,10 @@ dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-adapter-panel-cap-touch-10inch-dsi.dtbo dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-adapter-panel-cap-touch-7inch-dsi.dtbo dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-clover-panel-cap-touch-10inch-dsi.dtb dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-clover.dtb +dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-csi1-ov5640-24mhz.dtbo +dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-csi1-ov5640.dtbo +dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-csi2-ov5640-24mhz.dtbo +dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-csi2-ov5640.dtbo dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-dev.dtb dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-dev-dsi-to-hdmi.dtb dtb-$(CONFIG_ARCH_K3) += k3-am69-aquila-dsi-to-hdmi.dtbo @@ -329,6 +333,14 @@ k3-am69-aquila-dev-adapter-panel-cap-touch-10inch-dsi-dtbs := \ k3-am69-aquila-dev-adapter-panel-cap-touch-7inch-dsi-dtbs := \ k3-am69-aquila-dev.dtb \ k3-am69-aquila-adapter-panel-cap-touch-7inch-dsi.dtbo +k3-am69-aquila-dev-csi-ov5640-24mhz-dtbs := \ + k3-am69-aquila-dev.dtb \ + k3-am69-aquila-csi1-ov5640-24mhz.dtbo \ + k3-am69-aquila-csi2-ov5640-24mhz.dtbo +k3-am69-aquila-dev-csi-ov5640-dtbs := \ + k3-am69-aquila-dev.dtb \ + k3-am69-aquila-csi1-ov5640.dtbo \ + k3-am69-aquila-csi2-ov5640.dtbo k3-am69-aquila-dev-dsi-to-lvds-panel-cap-touch-10inch-dtbs := \ k3-am69-aquila-dev.dtb \ k3-am69-aquila-dsi-to-lvds-panel-cap-touch-10inch.dtbo @@ -418,6 +430,8 @@ dtb- += k3-am625-beagleplay-csi2-ov5640.dtb \ k3-am69-aquila-clover-panel-cap-touch-7inch-dsi.dtb \ k3-am69-aquila-dev-adapter-panel-cap-touch-10inch-dsi.dtb \ k3-am69-aquila-dev-adapter-panel-cap-touch-7inch-dsi.dtb \ + k3-am69-aquila-dev-csi-ov5640-24mhz.dtb \ + k3-am69-aquila-dev-csi-ov5640.dtb \ k3-am69-aquila-dev-dsi-to-lvds-panel-cap-touch-10inch.dtb \ k3-am69-sk-csi2-dual-imx219.dtb \ k3-am69-sk-pcie0-ep.dtb \ diff --git a/arch/arm64/boot/dts/ti/k3-am69-aquila-csi1-ov5640-24mhz.dtso b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi1-ov5640-24mhz.dtso new file mode 100644 index 000000000000..e7d238da8bef --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi1-ov5640-24mhz.dtso @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (c) Toradex + * + * Toradex CSI Camera Module 5MP OV5640 on Aquila CSI_1. + * Used on Development Board (J70). Uses a 24 MHz oscillator. + * + * https://developer.toradex.com/hardware/legacy-products/other/csi-camera-module-5mp-ov5640/ + */ + +/dts-v1/; +/plugin/; + +#include "k3-am69-aquila-csi1-ov5640.dtsi" + +&clock_camera_csi_1 { + clock-frequency = <24000000>; +}; diff --git a/arch/arm64/boot/dts/ti/k3-am69-aquila-csi1-ov5640.dtsi b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi1-ov5640.dtsi new file mode 100644 index 000000000000..668658d32111 --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi1-ov5640.dtsi @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (c) Toradex + * + * Common device tree include for Toradex OV5640 CSI Camera on Aquila CSI_1. + * Used on Development Board (J70). + */ + +#include + +&{/} { + clock_camera_csi_1: clock-camera-csi-1 { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + + regulator_camera_csi_1: regulator-camera-csi-1 { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_12_csi_1>; + /* Aquila GPIO_12_CSI_1 - Camera Connector 24 */ + gpio = <&main_gpio0 48 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-name = "V_CSI_1"; + startup-delay-us = <5000>; + }; +}; + +&csi0_port0 { + status = "okay"; + + csi0_port0_in: endpoint { + remote-endpoint = <&csi0_port0_cam_out>; + bus-type = <4>; /* CSI2 DPHY. */ + clock-lanes = <0>; + data-lanes = <1 2>; + }; +}; + +&dphy0 { + status = "okay"; +}; + +/* Aquila I2C_4_CSI1 */ +&main_i2c1 { + #address-cells = <1>; + #size-cells = <0>; + + camera@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_09_csi_1>, <&pinctrl_gpio_10_csi_1>; + clocks = <&clock_camera_csi_1>; + clock-names = "xclk"; + AVDD-supply = <®ulator_camera_csi_1>; + DOVDD-supply = <®ulator_camera_csi_1>; + DVDD-supply = <®ulator_camera_csi_1>; + /* Aquila GPIO_10_CSI_1 - Camera Connector 22 */ + powerdown-gpios = <&main_gpio0 2 GPIO_ACTIVE_HIGH>; + /* Aquila GPIO_09_CSI_1 - Camera Connector 11 */ + reset-gpios = <&main_gpio0 1 GPIO_ACTIVE_LOW>; + + port { + csi0_port0_cam_out: endpoint { + remote-endpoint = <&csi0_port0_in>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; + }; +}; + +&ti_csi2rx0 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/ti/k3-am69-aquila-csi1-ov5640.dtso b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi1-ov5640.dtso new file mode 100644 index 000000000000..76807176e288 --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi1-ov5640.dtso @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (c) Toradex + * + * Toradex CSI Camera Set 5MP OV5640 on Aquila CSI_1. + * Used on Development Board (J70). Uses a 27 MHz oscillator. + * + * https://developer.toradex.com/hardware/accessories/cameras/csi-camera-module-5mp-ov5640-arducam + * https://www.toradex.com/accessories/csi-camera-ov5640 + */ + +/dts-v1/; +/plugin/; + +#include "k3-am69-aquila-csi1-ov5640.dtsi" + +&clock_camera_csi_1 { + clock-frequency = <27000000>; +}; diff --git a/arch/arm64/boot/dts/ti/k3-am69-aquila-csi2-ov5640-24mhz.dtso b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi2-ov5640-24mhz.dtso new file mode 100644 index 000000000000..607e1c76c86d --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi2-ov5640-24mhz.dtso @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (c) Toradex + * + * Toradex CSI Camera Module 5MP OV5640 on Aquila CSI_2. + * Used on Development Board (J71). Uses a 24 MHz oscillator. + * + * https://developer.toradex.com/hardware/legacy-products/other/csi-camera-module-5mp-ov5640/ + */ + +/dts-v1/; +/plugin/; + +#include "k3-am69-aquila-csi2-ov5640.dtsi" + +&clock_camera_csi_2 { + clock-frequency = <24000000>; +}; diff --git a/arch/arm64/boot/dts/ti/k3-am69-aquila-csi2-ov5640.dtsi b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi2-ov5640.dtsi new file mode 100644 index 000000000000..454ac120337c --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi2-ov5640.dtsi @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (c) Toradex + * + * Common device tree include for Toradex OV5640 CSI Camera on Aquila CSI_2. + * Used on Development Board (J71). + */ + +#include + +&{/} { + clock_camera_csi_2: clock-camera-csi-2 { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + + regulator_camera_csi_2: regulator-camera-csi-2 { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_16_csi_2>; + /* Aquila GPIO_16_CSI_2 - Camera Connector 24 */ + gpio = <&wkup_gpio0 39 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-name = "V_CSI_2"; + startup-delay-us = <5000>; + }; +}; + +&csi1_port0 { + status = "okay"; + + csi1_port0_in: endpoint { + remote-endpoint = <&csi1_port0_cam_out>; + bus-type = <4>; /* CSI2 DPHY. */ + clock-lanes = <0>; + data-lanes = <1 2>; + }; +}; + +&dphy1 { + status = "okay"; +}; + +/* Aquila I2C_5_CSI2 */ +&main_i2c2 { + #address-cells = <1>; + #size-cells = <0>; + + camera@3c { + compatible = "ovti,ov5640"; + reg = <0x3c>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_13_csi_2>, <&pinctrl_gpio_14_csi_2>; + clocks = <&clock_camera_csi_2>; + clock-names = "xclk"; + AVDD-supply = <®ulator_camera_csi_2>; + DOVDD-supply = <®ulator_camera_csi_2>; + DVDD-supply = <®ulator_camera_csi_2>; + /* Aquila GPIO_14_CSI_2 - Camera Connector 22 */ + powerdown-gpios = <&wkup_gpio0 33 GPIO_ACTIVE_HIGH>; + /* Aquila GPIO_13_CSI_2 - Camera Connector 11 */ + reset-gpios = <&wkup_gpio0 32 GPIO_ACTIVE_LOW>; + + port { + csi1_port0_cam_out: endpoint { + remote-endpoint = <&csi1_port0_in>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; + }; +}; + +&ti_csi2rx1 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/ti/k3-am69-aquila-csi2-ov5640.dtso b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi2-ov5640.dtso new file mode 100644 index 000000000000..d3279f373d32 --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am69-aquila-csi2-ov5640.dtso @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (c) Toradex + * + * Toradex CSI Camera Set 5MP OV5640 on Aquila CSI_2. + * Used on Development Board (J71). Uses a 27 MHz oscillator. + * + * https://developer.toradex.com/hardware/accessories/cameras/csi-camera-module-5mp-ov5640-arducam + * https://www.toradex.com/accessories/csi-camera-ov5640 + */ + +/dts-v1/; +/plugin/; + +#include "k3-am69-aquila-csi2-ov5640.dtsi" + +&clock_camera_csi_2 { + clock-frequency = <27000000>; +};