* [PATCH V2 1/3] arm64: dts: imx8mn: Add CSI and ISI Nodes
@ 2023-05-07 15:15 Adam Ford
2023-05-07 15:15 ` [PATCH V2 2/3] arm64: defconfig: Enable video capture drivers on imx8mm/imx8mn Adam Ford
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Adam Ford @ 2023-05-07 15:15 UTC (permalink / raw)
To: linux-arm-kernel
Cc: aford, Adam Ford, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
NXP Linux Team, Catalin Marinas, Will Deacon,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
The CSI in the imx8mn is the same as what is used in the imx8mm,
but it's routed to the ISI on the Nano. Add both the ISI and CSI
nodes, and pointing them to each other. Since the CSI capture is
dependent on an attached camera, mark both ISI and CSI as
disabled by default.
Signed-off-by: Adam Ford <aford173@gmail.com>
---
V2: Change from a singular 'port' to 'ports' per feedback from Laurent Pinchart
"When a single port is present using a "port" node directly
is fine from an OF graph point of view, but to avoid too much complexity
in the ISI binding the consensus was to always require a "ports" node
for the ISI."
This is also consistent with the binding YAML file.
Change the size allocated to the ISI to 32k. The datasheet indicates it should
be 64K, but the disp_blk_ctrl sits at 32e28000.
Change the subject from 'Enable' to 'Add' since the ISI and CSI nodes are both
technically disabled.
diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
index 8be8f090e8b8..9869fe7652fc 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
@@ -1104,6 +1104,30 @@ dsim_from_lcdif: endpoint {
};
};
+ isi: isi@32e20000 {
+ compatible = "fsl,imx8mn-isi";
+ reg = <0x32e20000 0x8000>;
+ interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clk IMX8MN_CLK_DISP_AXI_ROOT>,
+ <&clk IMX8MN_CLK_DISP_APB_ROOT>;
+ clock-names = "axi", "apb";
+ fsl,blk-ctrl = <&disp_blk_ctrl>;
+ power-domains = <&disp_blk_ctrl IMX8MN_DISPBLK_PD_ISI>;
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ isi_in: endpoint {
+ remote-endpoint = <&mipi_csi_out>;
+ };
+ };
+ };
+ };
+
disp_blk_ctrl: blk-ctrl@32e28000 {
compatible = "fsl,imx8mn-disp-blk-ctrl", "syscon";
reg = <0x32e28000 0x100>;
@@ -1147,6 +1171,42 @@ disp_blk_ctrl: blk-ctrl@32e28000 {
#power-domain-cells = <1>;
};
+ mipi_csi: mipi-csi@32e30000 {
+ compatible = "fsl,imx8mm-mipi-csi2";
+ reg = <0x32e30000 0x1000>;
+ interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+ assigned-clocks = <&clk IMX8MN_CLK_CAMERA_PIXEL>,
+ <&clk IMX8MN_CLK_CSI1_PHY_REF>;
+ assigned-clock-parents = <&clk IMX8MN_SYS_PLL2_1000M>,
+ <&clk IMX8MN_SYS_PLL2_1000M>;
+ assigned-clock-rates = <333000000>;
+ clock-frequency = <333000000>;
+ clocks = <&clk IMX8MN_CLK_DISP_APB_ROOT>,
+ <&clk IMX8MN_CLK_CAMERA_PIXEL>,
+ <&clk IMX8MN_CLK_CSI1_PHY_REF>,
+ <&clk IMX8MN_CLK_DISP_AXI_ROOT>;
+ clock-names = "pclk", "wrap", "phy", "axi";
+ power-domains = <&disp_blk_ctrl IMX8MN_DISPBLK_PD_MIPI_CSI>;
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ };
+
+ port@1 {
+ reg = <1>;
+
+ mipi_csi_out: endpoint {
+ remote-endpoint = <&isi_in>;
+ };
+ };
+ };
+ };
+
usbotg1: usb@32e40000 {
compatible = "fsl,imx8mn-usb", "fsl,imx7d-usb", "fsl,imx27-usb";
reg = <0x32e40000 0x200>;
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH V2 2/3] arm64: defconfig: Enable video capture drivers on imx8mm/imx8mn
2023-05-07 15:15 [PATCH V2 1/3] arm64: dts: imx8mn: Add CSI and ISI Nodes Adam Ford
@ 2023-05-07 15:15 ` Adam Ford
2023-05-07 15:15 ` [PATCH V2 3/3] arm64: dts: imx8mn-beacon: Add support for OV5640 Camera Adam Ford
2023-05-15 1:26 ` [PATCH V2 1/3] arm64: dts: imx8mn: Add CSI and ISI Nodes Shawn Guo
2 siblings, 0 replies; 4+ messages in thread
From: Adam Ford @ 2023-05-07 15:15 UTC (permalink / raw)
To: linux-arm-kernel
Cc: aford, Adam Ford, Laurent Pinchart, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
Catalin Marinas, Will Deacon,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
The imx8m Mini and imx8m Nano both use the same CSIS driver for
interfacing with sensors and cameras. The Mini routes the CSIS
output to the imx7-CSI driver, and the Nano routes the CSIS
through the imx8-isi driver like the one used on the imx8mp.
Enable the drivers necessary to facilitate capture on both of
these two platforms.
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
V2: No Change
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index a24609e14d50..7005640fbb8e 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -743,6 +743,10 @@ CONFIG_SDR_PLATFORM_DRIVERS=y
CONFIG_V4L_MEM2MEM_DRIVERS=y
CONFIG_VIDEO_MEDIATEK_JPEG=m
CONFIG_VIDEO_MEDIATEK_VCODEC=m
+CONFIG_VIDEO_IMX7_CSI=m
+CONFIG_VIDEO_IMX_MIPI_CSIS=m
+CONFIG_VIDEO_IMX8_ISI=m
+CONFIG_VIDEO_IMX8_ISI_M2M=y
CONFIG_VIDEO_QCOM_CAMSS=m
CONFIG_VIDEO_QCOM_VENUS=m
CONFIG_VIDEO_RCAR_ISP=m
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH V2 3/3] arm64: dts: imx8mn-beacon: Add support for OV5640 Camera
2023-05-07 15:15 [PATCH V2 1/3] arm64: dts: imx8mn: Add CSI and ISI Nodes Adam Ford
2023-05-07 15:15 ` [PATCH V2 2/3] arm64: defconfig: Enable video capture drivers on imx8mm/imx8mn Adam Ford
@ 2023-05-07 15:15 ` Adam Ford
2023-05-15 1:26 ` [PATCH V2 1/3] arm64: dts: imx8mn: Add CSI and ISI Nodes Shawn Guo
2 siblings, 0 replies; 4+ messages in thread
From: Adam Ford @ 2023-05-07 15:15 UTC (permalink / raw)
To: linux-arm-kernel
Cc: aford, Adam Ford, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
NXP Linux Team, Catalin Marinas, Will Deacon,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
The baseboard has a very specific pinout for the TD Next 5640
camera which uses an OV5640 sensor. Enable it as part of the
deveopment kit baseboard instead of an overlay.
Enable the camera with the following
media-ctl -l "'ov5640 1-0010':0 -> 'csis-32e30000.mipi-csi':0 [1]"
media-ctl -v -V "'ov5640 1-0010':0 [fmt:UYVY8_1X16/640x480 field:none]"
media-ctl -v -V "'crossbar':0 [fmt:UYVY8_1X16/640x480 field:none]"
media-ctl -v -V "'mxc_isi.0':0 [fmt:UYVY8_1X16/640x480 field:none]"
Signed-off-by: Adam Ford <aford173@gmail.com>
---
V2: New to series, since Laurent asked me to add a board which supports
the previous two commits.
diff --git a/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
index 9e82069c941f..6dce77a6114c 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
@@ -43,6 +43,17 @@ reg_audio: regulator-audio {
enable-active-high;
};
+ reg_camera: regulator-camera {
+ compatible = "regulator-fixed";
+ regulator-name = "mipi_pwr";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ gpio = <&pca6416_1 0 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ startup-delay-us = <100000>;
+ regulator-always-on;
+ };
+
reg_usdhc2_vmmc: regulator-usdhc2 {
compatible = "regulator-fixed";
regulator-name = "vsd_3v3";
@@ -96,6 +107,36 @@ eeprom@0 {
};
};
+&i2c2 {
+ clock-frequency = <384000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c2>;
+ status = "okay";
+
+ camera@10 {
+ compatible = "ovti,ov5640";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_ov5640>;
+ reg = <0x10>;
+ clocks = <&clk IMX8MN_CLK_CLKO1>;
+ clock-names = "xclk";
+ assigned-clocks = <&clk IMX8MN_CLK_CLKO1>;
+ assigned-clock-parents = <&clk IMX8MN_CLK_24M>;
+ assigned-clock-rates = <24000000>;
+ AVDD-supply = <®_camera>; /* 2.8v */
+ powerdown-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
+
+ port {
+ /* MIPI CSI-2 bus endpoint */
+ ov5640_to_mipi_csi2: endpoint {
+ remote-endpoint = <&mipi_csi_in>;
+ clock-lanes = <0>;
+ data-lanes = <1 2>;
+ };
+ };
+ };
+};
&i2c4 {
clock-frequency = <400000>;
pinctrl-names = "default";
@@ -145,11 +186,28 @@ wm8962: audio-codec@1a {
};
};
+&isi {
+ status = "okay";
+};
+
&easrc {
fsl,asrc-rate = <48000>;
status = "okay";
};
+&mipi_csi {
+ status = "okay";
+
+ ports {
+ port@0 {
+ mipi_csi_in: endpoint {
+ remote-endpoint = <&ov5640_to_mipi_csi2>;
+ data-lanes = <1 2>;
+ };
+ };
+ };
+};
+
&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
@@ -226,6 +284,14 @@ MX8MN_IOMUXC_SAI3_RXFS_GPIO4_IO28 0x41
>;
};
+ pinctrl_ov5640: ov5640grp {
+ fsl,pins = <
+ MX8MN_IOMUXC_GPIO1_IO07_GPIO1_IO7 0x19
+ MX8MN_IOMUXC_GPIO1_IO06_GPIO1_IO6 0x19
+ MX8MN_IOMUXC_GPIO1_IO14_CCMSRCGPCMIX_CLKO1 0x59
+ >;
+ };
+
pinctrl_pcal6414: pcal6414-gpiogrp {
fsl,pins = <
MX8MN_IOMUXC_SAI2_MCLK_GPIO4_IO27 0x19
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH V2 1/3] arm64: dts: imx8mn: Add CSI and ISI Nodes
2023-05-07 15:15 [PATCH V2 1/3] arm64: dts: imx8mn: Add CSI and ISI Nodes Adam Ford
2023-05-07 15:15 ` [PATCH V2 2/3] arm64: defconfig: Enable video capture drivers on imx8mm/imx8mn Adam Ford
2023-05-07 15:15 ` [PATCH V2 3/3] arm64: dts: imx8mn-beacon: Add support for OV5640 Camera Adam Ford
@ 2023-05-15 1:26 ` Shawn Guo
2 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2023-05-15 1:26 UTC (permalink / raw)
To: Adam Ford
Cc: linux-arm-kernel, aford, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, NXP Linux Team, Catalin Marinas, Will Deacon,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
open list
On Sun, May 07, 2023 at 10:15:46AM -0500, Adam Ford wrote:
> The CSI in the imx8mn is the same as what is used in the imx8mm,
> but it's routed to the ISI on the Nano. Add both the ISI and CSI
> nodes, and pointing them to each other. Since the CSI capture is
> dependent on an attached camera, mark both ISI and CSI as
> disabled by default.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
Applied all, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-15 1:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-07 15:15 [PATCH V2 1/3] arm64: dts: imx8mn: Add CSI and ISI Nodes Adam Ford
2023-05-07 15:15 ` [PATCH V2 2/3] arm64: defconfig: Enable video capture drivers on imx8mm/imx8mn Adam Ford
2023-05-07 15:15 ` [PATCH V2 3/3] arm64: dts: imx8mn-beacon: Add support for OV5640 Camera Adam Ford
2023-05-15 1:26 ` [PATCH V2 1/3] arm64: dts: imx8mn: Add CSI and ISI Nodes Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).