SN65DSI83 DRM bridge attach fail on imx8mp

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SN65DSI83 DRM bridge attach fail on imx8mp

415 Views
dkprashant
Contributor II
Hi,
 
I have a linux kernel which is ported from 5.4 to 6.6 (yocto nanbield). Now trying to bringup MIPI-DSI using SN65DSI83 on the ported 6.6 kernel. Processor used in imx8mp.
But it is failing with encoder attach failure. The same dts works all fine in 5.4 kernel. Can you pls help me here.
 
Pls inform if you need more info.
 
[   14.484323] [drm:drm_bridge_attach] *ERROR* failed to attach bridge /soc@0/bus@32c00000/mipi_dsi@32e60000 to encoder DSI-37: -517
[   14.496016] imx_sec_dsim_drv 32e60000.mipi_dsi: Failed to attach bridge: 32e60000.mipi_dsi
[   14.504301] Failed to attach bridge: 32e60000.mipi_dsi
[   14.509465] imx_sec_dsim_drv 32e60000.mipi_dsi: failed to bind sec dsim bridge: -517
 
 
Below is dts file changes
 
/dts-v1/;
 
#include <dt-bindings/phy/phy-imx8-pcie.h>
#include <dt-bindings/usb/pd.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/gpio-keys.h>
#include "imx8mp.dtsi"
 
/ {
    model = "NXP i.MX8MPlus GX2 board";
    compatible = "fsl,imx8mp-evk", "fsl,imx8mp";
    
    chosen {
        stdout-path = &uart2;
    };
    
    lvds_backlight: lvds_backlight {
        compatible = "pwm-backlight";
        pwms = <&pwm2 0 100000>;
        status = "okay";
        
        brightness-levels = < 0  1  2  3  4  5  6  7  8  9
             10 11 12 13 14 15 16 17 18 19
             20 21 22 23 24 25 26 27 28 29
             30 31 32 33 34 35 36 37 38 39
             40 41 42 43 44 45 46 47 48 49
             50 51 52 53 54 55 56 57 58 59
             60 61 62 63 64 65 66 67 68 69
             70 71 72 73 74 75 76 77 78 79
             80 81 82 83 84 85 86 87 88 89
             90 91 92 93 94 95 96 97 98 99
            100>;
        default-brightness-level = <80>;
    };
    
    lvds0_panel {
        compatible = "ampire,am-1280720l2tzqw-00h";
        backlight = <&lvds_backlight>;
        power-supply = <&reg_panel_shlr>;
        
        port {
            panel_lvds_in: endpoint {
                remote-endpoint = <&lvds_out>;
            };
        };
    };
};
 
&i2c3 {
    clock-frequency = <100000>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_i2c3>;
    status = "okay";
    
    dsi_lvds_bridge: sn65dsi83@2d {
    compatible = "ti,sn65dsi83";
    reg = <0x2d>;
    ti,dsi-lanes = <4>;
    ti,lvds-format = <1>;
    ti,lvds-bpp = <24>;
    ti,width-mm = <177>;
    ti,height-mm = <100>;
    enable-gpios = <&gpio5 27 GPIO_ACTIVE_HIGH>;
    interrupt-parent = <&gpio2>;
    interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
    status = "okay";
        
    display-timings {
    lvds {
        //clock-frequency = <62500000>;
        clock-frequency = <71150000>;
        hactive = <1280>;
        vactive = <720>;
        hback-porch = <120>;
        hfront-porch = <120>;
        vback-porch = <25>;
        vfront-porch = <25>;
        //hsync-len = <30>;
    hsync-len = <2>;
    //vsync-len = <5>;
    vsync-len = <1>;
    hsync-active = <0>; 
    vsync-active = <0>;
    de-active = <1>;
    pixelclk-active = <0>;
    };
       };
 
port {
dsi_lvds_bridge_in: endpoint {
remote-endpoint = <&mipi_dsi_out>;
    };
    };
};
 
 
&lcdif1 {
    status = "okay";
};
 
&lcdif2 {
    status = "okay";
};
 
&ldb {
    status = "okay";
    
    lvds-channel@0 {
        fsl,data-mapping = "jeida";
        fsl,data-width = <24>;
        status = "okay";
        
        port@1 {
            reg = <1>;
            lvds_out: endpoint {
                remote-endpoint = <&panel_lvds_in>;
            };
        };
    };
};
 
&ldb_phy {
    status = "okay";
};
 
&mipi_dsi {
    status = "okay";
    
    port@1 {
        mipi_dsi_out: endpoint {
            remote-endpoint = <&dsi_lvds_bridge_in>;
            attach-bridge;
        };
    };
};
 
 
Below config is enabled in defconfig
CONFIG_DRM_TI_SN65DSI83=y
0 Kudos
8 Replies

153 Views
dkprashant
Contributor II

For info. Below patch fixed the issue. 

Patch for LT9211 bridge on i.MX - NXP Community

240 Views
dkprashant
Contributor II

Adding some more info on the issue seen.

Observation is if the port node (dsi_lvds_bridge_in) is added under i2c3/sn65dsi83@2d node, then bridge-attach fails and device is not seen with i2cdetect.
Without port node, device is seen with i2cdetect and communication works.
port {
    dsi_lvds_bridge_in: endpoint {
    remote-endpoint = <&mipi_dsi_out>;
};

We also tried by testing adv7535 bridge on same linux 6.6 and it works fine.
So not sure, what is making sn65dsi83 bridge to fail.

        adv_bridge: adv7535@3d {
                compatible = "adi,adv7535";
                reg = <0x3d>;
                adi,addr-cec = <0x3b>;
                adi,dsi-lanes = <4>;
                status = "okay";

 

                port {
                        adv7535_from_dsim: endpoint {
                                remote-endpoint = <&dsim_to_adv7535>;
                        };
                };

0 Kudos

176 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Thank you for sharing more information, please share your updated device tree so I can take a look.
Also, I found the exact commit for the enablement of the same bridge on a similar platform, please have a look:
https://github.com/nxp-imx/linux-imx/commit/3f89845698b7deecb3ea1e25a21d92b376796873

Best regards/Saludos,
Aldo.

0 Kudos

385 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Could you try with the patch mentioned here:
https://community.nxp.com/t5/i-MX-Processors/Problems-with-SN65DSI83-driver-integration-on-i-MX8-Min...

Best regards/Saludos,
Aldo.

0 Kudos

360 Views
dkprashant
Contributor II

Hi Aldo,

Thanks for the reply. The changes suggested in patch are already part of Kernel 6.6.

Some more debug, it is observed that SN65DSI83 probe is getting failed due to remote node not available. Not sure, what is causing  for remote not being detected.

0 Kudos

355 Views
dkprashant
Contributor II

here are print

[ 2.771955] i2c 2-002d: Fixed dependency cycle(s) with /soc@0/bus@32c00000/mipi_dsi@32e60000/port@0/endpoint
[ 2.782041] sn65dsi83_probe ++
[ 2.796731] sn65dsi83_parse_dt ++
[ 2.800582] drm_of_find_panel_or_bridge
[ 2.804955] no remote node
[ 2.808184] Parse dt fail

0 Kudos

351 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

This information does help a lot, thank you for sharing, if it is failing while parsing the device tree then it may be some changes on the bindings with respect to the driver, I would suggest to refer to the foloowing device tree and try with a similar configuration:
https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/arch/arm64/boot/dts/freescale/imx8mm-phg.dts

Best regards/Saludos,
Aldo.

0 Kudos

310 Views
dkprashant
Contributor II

Thank you. I followed the dts as suggested in the link. But further seeing synchronization issue between DSI and bridge. Bridge start and does other initialization. But fails on not finding host. On other hand, DSI starts and does initialzation. But fails during bridge attach. Any info here would be of great help.

 

Sharing log snippet below.

 

[ 21.985787] sn65dsi83_probe ++
[ 22.000762] sn65dsi83_parse_dt ++
[ 22.008915] dev node name bridge full_name bridge@2d
[ 22.014417] devm_drm_of_get_bridge
[ 22.018363] drm_of_find_panel_or_bridge ++
[ 22.022999] of_graph_get_remote_node ++
[ 22.027369] of_graph_get_endpoint_by_regs ++
[ 22.032173] parent name bridge full_name bridge@2d
[ 22.037499] of_graph_parse_endpoint ++
[ 22.041786] of_graph_parse_endpoint --
[ 22.046069] port_reg 2 endpoint.port 0
[ 22.050350] reg 0 endpoint.id 0
[ 22.054034] of_graph_get_remote_node return remote --
[ 22.059617] remote name mipi_dsi
[ 22.063379] of_drm_find_panel ++
[ 22.067141] Node mipi_dsi
[ 22.073193] panel found
[ 22.079488] drm_of_find_panel_or_bridge ret 0 --
[ 22.084638] devm_drm_panel_bridge_add ++--
[ 22.088746] devm_drm_panel_bridge_add_typed ++
[ 22.093209] drm_bridge_add ++
[ 22.096700] bridge to add name panel full_name panel
[ 22.102201] drm_bridge_add --
[ 22.105709] devm_drm_panel_bridge_add_typed --
[ 22.121088] drm_bridge_add ++
[ 22.124584] bridge to add name bridge full_name bridge@2d
[ 22.130532] drm_bridge_add --
[ 22.134035] sn65dsi83_host_attach ++
[ 22.138143] of_graph_get_endpoint_by_regs ++
[ 22.142950] parent name bridge full_name bridge@2d
[ 22.148277] of_graph_parse_endpoint ++
[ 22.152564] of_graph_parse_endpoint --
[ 22.156849] port_reg 0 endpoint.port 0
[ 22.161133] reg -1 endpoint.id 0
[ 22.164894] of_find_mipi_dsi_host_by_node ++
[ 22.169180] Node mipi_dsi
[ 22.172327] of_find_mipi_dsi_host_by_node --
[ 22.176613] no host
[ 22.179262] failed to attach DSI host
[ 22.182941] drm_bridge_remove ++
[ 22.186187] drm_bridge_remove --
[ 22.189624] drm_bridge_remove ++
[ 22.192860] drm_bridge_remove --
[ 22.117154] sn65dsi83_parse_dt --

[ 22.196836] imx_sec_dsim_probe
[ 22.200536] adding component (ops imx_sec_dsim_ops)
[ 22.206007] try_to_bring_up_aggregate_device
[ 22.217896] found component 32e60000.mipi_dsi, duplicate 0
[ 22.223836] imx-drm display-subsystem: bound imx-lcdifv3-crtc.0 (ops lcdifv3_crtc_ops)
[ 22.231801] imx_sec_dsim_bind: dsim bind begin
[ 22.236264] imx_drm_encoder_parse_of
[ 22.240375] drm_of_find_possible_crtcsi ++
[ 22.244493] port name mipi_dsi fullname mipi_dsi@32e60000 ep name endpoint fullname endpoint
[ 22.253471] remoteport name port fullname port@0
[ 22.258622] drm_of_crtc_port_mask ++
[ 22.262208] tmp->port name port tmp->full_name port tmp->port 7f47b5e8
[ 22.268835] port name port full_name port@0
[ 22.274248] index 0
[ 22.276350] drm_of_find_possible_crtcsi -possible_crtcs 2 --
[ 22.282029] sec-dsim bridge bind begin sec_mipi_dsim_bind
[ 22.332472] imx_sec_dsim_drv 32e60000.mipi_dsi: version number is 0x1060200
[ 22.339466] version number is 0x1060200
[ 22.343359] mipi_dsi_host_register ++
[ 22.347558] Add node mipi_dsi
[ 22.351062] in loop add host node mipi_dsi full_name mipi_dsi@32e60000 node port full_name port@2
[ 22.360470] continue
[ 22.363191] in loop add host node mipi_dsi full_name mipi_dsi@32e60000 node ports full_name ports
[ 22.372606] continue
[ 22.375328] mipi_dsi_host_register --
[ 22.379525] drm_bridge_attach
[ 22.382505] sec_mipi_dsim_bridge_attach
[ 22.386877] endpoint node name endpoint full_name endpoint
[ 22.392382] of_drm_find_bridge ++
[ 22.396232] Node name bridge full_name bridge@2d
[ 22.401384] of_drm_find_bridge return NULL
[ 22.405498] probe defer
[ 22.408467] [drm:drm_bridge_attach] *ERROR* failed to attach bridge /soc@0/bus@32c00000/mipi_dsi@32e60000 to encoder DSI-34: -517
[ 22.420163] imx_sec_dsim_drv 32e60000.mipi_dsi: Failed to attach bridge: 32e60000.mipi_dsi
[ 22.428444] Failed to attach bridge: 32e60000.mipi_dsi
[ 22.433600] imx_sec_dsim_drv 32e60000.mipi_dsi: failed to bind sec dsim bridge: -517
[ 22.441360] failed to bind sec dsim bridge: -517
[ 22.446527] bind ret -517
[ 22.449179] sec_dsim_of_put_resets
[ 22.453119] Failed to add component
[ 22.457277] i2c 2-002d: deferred probe pending
[ 22.461798] platform 32e60000.mipi_dsi: deferred probe pending

0 Kudos