TechNexion / tn-imx-yocto-manifest

TechNexion i.MX Yocto manifests
28 stars 10 forks source link

pico-imx7d + adv7533 mipi_dsi-to_hdmi-bridge #12

Closed geoffrey-vl closed 3 years ago

geoffrey-vl commented 3 years ago

Hi, We're testing with pico-imx7D using Rocko branch. We want to use the IMX7D's MIPI-DSI output with a ADV7533 MIPI-DSI to HDMI bridge chip. I've noticed there is no documentation on how this can be done using the Technexion BSP, as this DISPLAY variable isn't described. However, technically the IMX7D can output MIPI-DSI. What must be done to use that feature?

For now I've added the following to the device tree:

&lcdif {
    disp-dev = "mipi_dsi_samsung";
    disp-videomode = "TRUULY-WVGA-SYNC-LOW";

    pinctrl-0 = <>;
};

&mipi_dsi {
    status = "okay";
    lcd_panel = "TRULY-WVGA-TFT3P5581E";

    port {
        mipi_dsi_out: endpoint {
            remote-endpoint = <&adv7533_in>;
        };
    };
};

&i2c1 {
    status = "okay";   

    adv_bridge: adv7533@3d {
        compatible = "adi,adv7533";
        reg = <0x3d>;
        adi,dsi-lanes = <2>;
        status = "okay";

        port {
            adv7533_in: endpoint {
                remote-endpoint = <&mipi_dsi_out>;
            };
        };
    };
};

However, I've noticed that I'm missing the /dev/fb0 device. During boot I've noticed following error:

[    0.367474] 30760000.mipi-dsi supply disp-power-on not found, using dummy regulator
[    0.367537] mxc_mipi_dsi_samsung 30760000.mipi-dsi: i.MX MIPI DSI driver probed
[    0.368826] mxc_sdc_fb fb@0: NO mxc display driver found!
[    0.438003] mxsfb 30730000.lcdif: Defer fb probe due to dispdrv not ready

Using i2cdetect I can detect the I2C addresses used by the ADV7533 bridge chip:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- UU -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- 38 -- -- -- UU UU -- UU
40: -- -- 42 -- -- -- -- -- UU -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- 65 -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- UU
richard-hu commented 3 years ago

Hello, @geoffrey-vl :

Thanks for your feedback. To be honest, we haven't enable MIPI-DSI with ADV7535 on PICO-IMX7D before.

From the information you provide, it looks the ADV7535 is probed without problem. So i suspect the problem might be on the timing settings for MPI-DSI contoller.

I check Linux 4.14.98 kernel. (used by Yocto Rocko.) It looks ADV7535 is supported on i.mx7ulp instead of i.mx7d.

arch/arm/boot/dts/imx7ulp-evk.dts

i.mx7ulp uses different MIPI-DSI controller than i.mx7d. (i.mx7ulp uses MIPI-DSI controller from Northwest:drivers/video/fbdev/mxc/mipi_dsi_northwest.c) (i.mx7d uses MIPI-DSI controller from Samsung:drivers/video/fbdev/mxc/mipi_dsi_samsung.c)

Theoretically, in most cases, it would need to tweak MIPI DSI controller driver to adapt to different panel. (Usually, it needs to add a profile to add timing parameter(resolution, pixel clock...) to let MIPI DSI controller can output correct PLL clock for the panel.)

i.mx8mm also uses the MIPI DSI contoller driver from Samsung. But the driver is based on DRM instead FB. (drivers/gpu/drm/bridge/sec-dsim.c) We have enabled ADV7535 for PICO-IMX8MM before.(Both HDMI display and audio work fine.) (PICO-IMX8MM comes with MIPI-DSI 4 lanes and PICO-IMX7D just has 2 lanes. So the pixel clock on PICO-IMX7D should be double than the clock on PICO-IMX8MM. )

BTW, could i know what baseboard you use to validate ADV7535 on PICO-IMX7D?

BR,

Richard

geoffrey-vl commented 3 years ago

hi Richard, thanks for your reply.

We're using the ST B-LCDAD-HDMI1 board for now. Later on we will make our own PCB using the ADV7533 chip.

Regarding:

I check Linux 4.14.98 kernel. (used by Yocto Rocko.)

We're still on 4.9.88 from meta-edm-bsp-release, but I doubt if that makes a big difference.

Ragarding:

i.mx8mm also uses the MIPI DSI contoller driver from Samsung. But the driver is based on DRM instead FB. (drivers/gpu/drm/bridge/sec-dsim.c)

I'm not very comfortable for now with the entire linux graphics stack, but I'll try my best. So for I'm using a console image. Do I need at least X11, or would the console image for now be good enough to get the display "working"? Technically I suppose the console image is good enough, and can be tested using fbset? At least, I've added following to the kernel defconfig:

CONFIG_DRM_MIPI_DSI=y
CONFIG_FB_MXC_MIPI_DSI=y
CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y
CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y
CONFIG_DRM_I2C_ADV7511=y
CONFIG_DRM_I2C_ADV7533=y

Can IMX7D work through DRM this way? When DRM is enabled, can the framebuffer still be accessed directly (for testing purposes)?

Regarding:

Theoretically, in most cases, it would need to tweak MIPI DSI controller driver to adapt to different panel. (Usually, it needs to add a profile to add timing parameter(resolution, pixel clock...) to let MIPI DSI controller can output correct PLL clock for the panel.)

I' haven't touched the display0 configuration yet within imx7d-pico.dtsi. It is still set to the following:

    display0: display {
        bits-per-pixel = <32>;
        bus-width = <24>;

        display-timings {
            native-mode = <&timing0>;
            timing0: timing0 {
                clock-frequency = <33260000>;
                hactive = <800>;
                vactive = <480>;
                hback-porch = <11>;
                hfront-porch = <11>;
                vback-porch = <12>;
                vfront-porch = <11>;
                hsync-len = <46>;
                vsync-len = <210>;
                hsync-active = <0>;
                vsync-active = <0>;
                de-active = <1>;
                pixelclk-active = <1>;
                interlaced =  <0>;
            };
        };
    };
johnweber commented 3 years ago

Hi Geoffrey,

We can understand the requirement to provide an HDMI interface, but the amount of work here could be significant. Because i.MX7 has an RGB TTL interface, most of our customers use this instead of MIPI-DSI. We don't have plans at present to test and develop with DSI on i.MX7D (I know of one customer using DSI on i.MX7D).

One other option is to consider a different platform to take advantage of HDMI. We have options for i.MX8M Mini and now i.MX8M Plus (which has a native HDMI interface). We have performed a great deal of software integration and testing with DSI on i.MX8M Mini, and have a DSI to HDMI adapter card available for the PICO-WIZARD development kit that uses the ADV7535 (as Richard mentioned in his earlier reply).

If you want further support for HDMI on PICO-IMX7D via the MIPI-DSI interface, please contact our sales department (sales@technexion.com).

Best regards, John

MantajSingh commented 2 years ago

Hi Geoffrey,

How to enable ADV7535 for PICO-IMX8MM using the Technexion BSP

Thanks

johnweber commented 2 years ago

Hi Mantaj,

You can enable it using the device tree overlay with Yocto versions Zeus or later. We have a device tree overlay.

In U-boot:

> setenv dtoverlay mipi2hdmi-adv7535
> saveenv

This works with PICO-WIZARD-IMX8M-MINI with the MIPI-to-HDMI adapter.

See also: https://github.com/TechNexion/linux-tn-imx/blob/tn-imx_5.4.70_2.3.0-stable/arch/arm64/boot/dts/freescale/overlays/imx8mm-pico-wizard-mipi2hdmi-adv7535-overlay.dts

MantajSingh commented 2 years ago

Hi johnweber,

Thanks for your reply. I am working on PICO-PI-IMX8MM. U-boot=> setenv dtoverlay mipi2hdmi-adv7535, gave an error on the terminal screen (Failed to start wester) and there is no output throw onboard HDMI. Is it possible to enable the HDMI on PICO-PI-IMX8MM

Regards, Mantaj

johnweber commented 2 years ago

Sorry - the HDMI connector on the PICO-PI-8M baseboard is inactive when used with the PICO-IMX8M-MINI. It is only active if used with PICO-IMX8M (different module).

MantajSingh commented 2 years ago

Thanks, I was fighting with hdmi from last 1 months. And Is there any option to change the mipi display I don’t want to use 5 inch size display, Or can I reduce the screen resolution.

johnweber commented 2 years ago

Sorry - the 5" MIPI display is the only one we support on PICO-PI-IMX8M-MINI due to its connectors and cables. We can support other displays via adapters on the PICO-WIZARD-IMX8M-MINI.

MantajSingh commented 2 years ago

Thanks johnweber, Will buy PICO-WIZARD-IMX8M-MINI then :)