Hi all,
I can get a stream using the following device-tree settings without an MAX9296 from my camera:
/ {
fragment@7 {
target = <&i2c_mipi_csi0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c_mipi_csi0>;
as0149_mipi_0: as0149_mipi@5d {
compatible = "as0149";
reg = <0x5d>;
clocks = <&xtal24m>;
clock-names = "xclk";
csi_id = <0>;
mclk = <24000000>;
mclk_source = <0>;
mipi_csi;
status = "okay";
port {
as0149_mipi_ep_0: endpoint {
remote-endpoint = <&mipi_csi0_ep>;
data-lanes = <1 2>;
clocks-lanes = <0>;
};
};
};
};
};
fragment@8 {
target = <&i2c_mipi_csi1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c_mipi_csi1>;
as0149_mipi_1: as0149_mipi@5d {
compatible = "as0149";
reg = <0x5d>;
clocks = <&xtal24m>;
clock-names = "xclk";
csi_id = <0>;
mclk = <24000000>;
mclk_source = <0>;
mipi_csi;
status = "okay";
port {
as0149_mipi_ep_1: endpoint {
remote-endpoint = <&mipi_csi1_ep>;
data-lanes = <1 2>;
clocks-lanes = <0>;
};
};
};
};
};
fragment@9 {
target = <&irqsteer_csi0>;
__overlay__ {
status = "okay";
};
};
fragment@10 {
target = <&irqsteer_csi1>;
__overlay__ {
status = "okay";
};
};
fragment@11 {
target = <&mipi_csi_0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
/delete-property/virtual-channel;
status = "okay";
/* Camera 0 MIPI CSI-2 (CSIS0) */
port@0 {
reg = <0>;
mipi_csi0_ep: endpoint {
remote-endpoint = <&as0149_mipi_ep_0>;
data-lanes = <1 2>;
};
};
};
};
fragment@12 {
target = <&isi_0>;
__overlay__ {
status = "okay";
cap_device {
status = "okay";
};
m2m_device {
status = "okay";
};
};
};
fragment@13 {
target = <&mipi_csi_1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
/delete-property/virtual-channel;
status = "okay";
/* Camera 1 MIPI CSI-2 (CSIS1) */
port@1 {
reg = <1>;
mipi_csi1_ep: endpoint {
remote-endpoint = <&as0149_mipi_ep_1>;
data-lanes = <1 2>;
};
};
};
};
fragment@14 {
target = <&isi_4>;
__overlay__ {
status = "okay";
cap_device {
status = "okay";
};
m2m_device {
status = "okay";
};
};
};
};However, when I add max9296 driver inside of my camera driver I get the following output:
I check my max9296 and as0149 status registers, both with no error and both stating they are on stream.
Input and output format also seems correct by looking at the dmesg log below:
[ 884.552763] bypass csc
[ 884.555176] input fmt UYVY
[ 884.557914] output fmt UYVY
Only thing that came to my mind right now is the pixel clock. I set it like below at the momment:
port {
as0149_serdes_ep_0: endpoint {
data-lanes = <1 2>;
clocks-lanes = <0>;
/*clock-noncontinuous;*/
link-frequencies = /bits/ 64 <833333333>;
//max-pixel-frequency = /bits/ 64 <100000000>;
remote-endpoint = <&mipi_csi0_ep_0>;
};
...
port@0 {
reg = <0>;
mipi_csi0_ep_0: endpoint {
remote-endpoint = <&as0149_serdes_ep_0>;
data-lanes = <1 2>;
csis-hs-settle = <18>;
csis-clk-settle = <2>;
csis-wclk;
};
does this correct setting for 833333333 pixel clock ? Or these values does nothing ? Can any of you guide me on this one ?
Thanks.
Hi @joanxie ,
I debug my way to found a solution for this. Please refer to below patch:
diff --git a/drivers/staging/media/imx/imx8-mipi-csi2.c b/drivers/staging/media/imx/imx8-mipi-csi2.c
index 3c628fb1b..9f47bb9ca 100644
--- a/drivers/staging/media/imx/imx8-mipi-csi2.c
+++ b/drivers/staging/media/imx/imx8-mipi-csi2.c
@@ -332,7 +332,7 @@ static struct mxc_hs_info hs_setting[] = {
{1920, 1080, 30, 0x0B},
{1920, 1080, 15, 0x10},
-
+ {1280, 960, 30, 0x6},
{1280, 720, 30, 0x11},
{1280, 720, 15, 0x16},
so basically, ` link-frequencies = /bits/ 64 <833333333>;` have no use on device tree. instead you need to change the hs clock according to the table below:
as you can see by the table 1.5 Gbps, is what I was needed. Once I set the HS timer for my MIPI data rate, it worked like a charm.
Hopefully it will help someone in the future.
could you share the full logfile and dts file? and tell me what bsp version you use