Post Go back to editing

Facing problem while bringing up the ADV7535 driver on my platform

Category: Software
Product Number: ADV7535
Software Version: Linux kernel 5.10.72

My custom board setup is like this. iMX8QXP SOC is connected ADv7535 via i2c bus.
I am using iMX based Linux kernel 5.10.72 with ADV7535 Linux driver enabled.

kernel defconfig contents related to ADV7535:
CONFIG_MEDIA_SUPPORT=y
CONFIG_DRM=y
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
CONFIG_DRM_IMX=y
CONFIG_DRM_IMX_PARALLEL_DISPLAY=y
CONFIG_DRM_IMX_SEC_DSIM=y
CONFIG_DRM_BRIDGE=y
CONFIG_FB_MXC_ADV7535=y

My dts node related to adv7535:
pinctrl_i2c0_mipi_dsi0: mipi0_lpi2c0grp {
    fsl,pins = <
        IMX8QXP_MIPI_DSI0_I2C0_SCL_MIPI_DSI0_I2C0_SCL          0xc6000020
        IMX8QXP_MIPI_DSI0_I2C0_SDA_MIPI_DSI0_I2C0_SDA         0xc6000020
        IMX8QXP_MIPI_DSI0_GPIO0_00_LSIO_GPIO1_IO27             0x20000020
        IMX8QXP_MIPI_DSI0_GPIO0_01_LSIO_GPIO1_IO28             0x20000020
    >;
};

&i2c0 {
    #address-cells = <1>;
    #size-cells = <0>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_i2c0_mipi_dsi0>;
    clock-frequency = <400000>;
    status = "okay";
    
    adv_bridge0: adv7535@72 {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "adi,adv7535";
        reg = <0x72>;
        csi_id = <0>;
        adi,addr-cec = <0x3b>;
        adi,dsi-lanes = <4>;
        adi,dsi-channel = <1>;
        video-mode = <34>;    /* 1920x1080@30HZ */
        bpp = <24>;
        pd-gpios = <&lsio_gpio1 27 GPIO_ACTIVE_HIGH>;
        interrupt-parent = <&lsio_gpio1>;
        interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
        status = "okay";

        port {
            adv7535_0_in: endpoint {
                remote-endpoint = <&mipi_dsi_bridge0_out>;
            };
        };
    };
};

&mipi0_dphy {
    status = "okay";
};

&mipi0_dsi_host {
    status = "okay";

    ports {
        port@1 {
            reg = <1>;
            mipi_dsi_bridge0_out: endpoint {
                remote-endpoint = <&adv7535_0_in>;
            };
        };
    };
};

I am not able to probe the driver, getting this error "i2c i2c-0: ADV7535 not found".

root@imx8dxccu:~# dmesg | grep i2c
[    1.853342] i2c /dev entries driver
[    2.327908] imx-lpi2c 5a800000.i2c: can't get the TX DMA channel, error -19!
[    2.334994] imx-lpi2c 5a800000.i2c: error -ENODEV: dma setup error -19, use pio
[    5.681370] i2c i2c-0: ADV7535 not found
[    6.745181] i2c i2c-0: LPI2C adapter registered

But, i2c slave is detected using i2cdetect tool.
root@imx8dxccu:~# i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x08-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 UU 73 74 75 76 77
root@imx8dxccu:~#


Can you please help me here.

  • Hi,

    It looks like the I2C DMA is not correctly working and because of that errors can appear in I2C communication. Also, the i2cdetect output does not look fine.

    It behaves like you would have slaves on a lot of addresses so I'm suspecting that the I2C bus is not working properly. On a correct set-up you would have numbers only on addresses that have a device acknowledging and -- for others.

    You said is a custom board. If you have the possiblity please check the I2C bus with a logic analyzer and check for common problems like missing pull-up resistors or lines stuck in some state.

    Also being a I2C related problem you can also ask for support on NXP forum.

    Regards,

    Bogdan

  • Hi,

    Now i am able to probe the adv7535 successfully and slave address also detected.

    root@imx8dxccu:~# dmesg | grep adv
    [    2.467670] adv7535 probing phase
    [    2.470990] adv7535 16-003d: main addr = 0x3d
    [    2.480692] adv7535 16-003d: dsi cec addr = 0x78
    [    2.506906] adv7535 16-003d: adv7535 probe finished
    root@imx8dxccu:~#
    root@imx8dxccu:~#
    root@imx8dxccu:~#
    root@imx8dxccu:~# i2cdetect 16
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will probe file /dev/i2c-16.
    I will probe address range 0x08-0x77.
    Continue? [Y/n] y
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- 38 -- -- -- UU UU -- 3f
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    But my one doubt, there are two drivers in Linux source code

    1. drivers/video/fbdev/mxc/adv7535.c

    2. drivers/gpu/drm/bridge/adv7511/adv7511_drv.c --> This will also support adv7535

    Which one should i use ? currently i am using "drivers/video/fbdev/mxc/adv7535.c"

    am i using the correct one ? Please guide.

  • Hi,

    Glad to hear that you sorted out the I2C problem and you can probe the driver fine now. 

    I agree that the output of i2cdetect looks as expected.

    Regarding the driver, if you ask us we recommend and suggest the upstream version from drivers/gpu/drm/bridge/adv7511/adv7511_drv.c.

    That's the driver we support and is a generic DRM driver that is compatible with a lot of platforms.

    The driver from drivers/video/fbdev/mxc/adv7535.c is a driver created by NXP and I don't know why it was created.

    It depends on your use-case but I think the best advice is to ask NXP why the drivers/video/fbdev/mxc/adv7535.c driver was created and why they didn't used the generic DRM driver?

  • Hi,

    Now i am facing a strange behavior. It is like this :

    When I connect the HDMI cable from MIPI DSI to HDMI converter port to HDMI display, the DSI i2c slaves are disappearing like shown below :

    But, When I disconnect the HDMI cable from MIPI DSI to HDMI converter port to HDMI display, the DSI i2c slaves are appearing like shown below :

    What may be the issue? Can you please help us here.

  • This looks like a HW problem. Can you please have your schematic reviewed with the ADI FAE?

  • Hi,

    Now i have resolved the above issue and moving forward. Now i2c slave address are appearing even though the HDMI display is connected which was not happening in earlier.

    But, i am facing a new issue. That is, HDMI display is not coming. It is shown no signal.

    I verified the ADV7535 driver got probed properly. Attached the logs for your reference :

    [    2.956247] imx-drm display-subsystem: bound imx-drm-dpu-bliteng.2 (ops dpu_bliteng_ops)
    [    2.964992] imx-drm display-subsystem: bound imx-dpu-crtc.0 (ops dpu_crtc_ops)
    [    2.972793] imx-drm display-subsystem: bound imx-dpu-crtc.1 (ops dpu_crtc_ops)
    [    3.200207] imx-drm display-subsystem: bound imx-drm-dpu-bliteng.2 (ops dpu_bliteng_ops)
    [    3.208615] imx-drm display-subsystem: bound imx-dpu-crtc.0 (ops dpu_crtc_ops)
    [    3.216109] imx-drm display-subsystem: bound imx-dpu-crtc.1 (ops dpu_crtc_ops)
    [    3.224049] nwl-dsi 56228000.dsi_host: [drm:nwl_dsi_host_attach] lanes=4, format=0x0 flags=0x215
    [    3.233199] imx-drm display-subsystem: bound 56228000.dsi_host (ops nwl_dsi_component_ops)
    [    3.242066] [drm] Initialized imx-drm 1.0.0 20120507 for display-subsystem on minor 0
    [    3.250836] imx-drm display-subsystem: [drm] Cannot find any crtc or sizes
    [    3.268367] imx-drm display-subsystem: [drm] Cannot find any crtc or sizes
    [    4.743656] systemd[1]: Starting Load Kernel Module drm...
    [ 2856.799980] imx-drm display-subsystem: [drm] fb0: imx-drmdrmfb frame buffer device

    [    3.224049] nwl-dsi 56228000.dsi_host: [drm:nwl_dsi_host_attach] lanes=4, format=0x0 flags=0x215
    [    3.233199] imx-drm display-subsystem: bound 56228000.dsi_host (ops nwl_dsi_component_ops)

    My DTS looks like this :

    Can you please help me here.

  • Hi,

    Yes, the driver looks ok now and also the DMESG logs look good, with the exception of that "Cannot find any crtc or sizes".

    Can you please check if you have renderer and card-HDMI device in /sys/class/drm/

    Also can you please check the output of modetest command?

    I was looking over the devicetree and there is one propery not present in the upstream driver "adi,dsi-channel". After further investigation I saw that the driver NXP have in their tree is different from the mainline one we support and it has a lot of patches applied by NXP.

    I think at this step it is recommended to post a question regarding DRM to the NXP community forum too because a large part of the DSI-HDMI output is handled by their drivers.

  • Hi,

    renderer and card-HDMI are present in /sys/class/drm/ like shown below

    I have removed this entry from my dts "adi,dsi-channel" and tried, still not working.

  • That looks perfect.

    So EDID is read, so the supported display resolutions are available.

    Also status connected is perfect.

    Can you please check the modetest tool?

    And also I'm not saying that "adi,dsi-channel" property is wrong and needs to be removed from devicetree.

    I'm saying that the version of the driver using it is NXP specific and is different form the mainline one we're supporting.

    This is NXP only: https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/adv7511/adv7533.c?h=lf-5.10.y#n203

    This is the mainline and what we support:

    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/bridge/adv7511/adv7533.c?h=v6.2-rc5#n179

    So maybe it would make sense to check with NXP why they implemented those changes, and if the changes are NXP specific and if not why they did not sent them upstream for review?