This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Regarding Mipi DSI on pandaboard ES

Other Parts Discussed in Thread: TFP410

Hello,

 

Could you kindly advise us with regards to operating the MIPI DSI video connector?

 

We are using release 4AI.1.7  for PandaBoard.

The TAAL LCD display is very much like what we need (the only example for MIPI DSI command mode). How can we enable a driver for it?

Currently the 2 drivers available are:

Display 0 running DVI with driver "generic_dpi_panel".

Display 1 running HDMI with driver "hdmi_panel".

There are 3 video overlays and 3 managers, but only 2 displays (HDMI and DVI). We need the TAAL display to appear as the third one, so it can be used.

 

I will appreciate your reply,

Thanks,

Rafi

  • Hello Rafi,

    There is a pretty extensive guide regarding display drivers in omappedia. Here are the links:

    http://omappedia.org/wiki/Bootargs_for_enabling_display

    http://omappedia.org/wiki/Display_Drivers_Domain_Wiki

    For enabling primary and secondary LCDs there are the following commands:

    echo "1" > /sys/devices/platform/omapdss/display0/enabled

    echo "1" > /sys/devices/platform/omapdss/display1/enabled

    Hope this helps.

    Best Regards,

    Yordan

  • Dear Yorden,

    Thanks for your reply.

    We have built the release and selected the DSI and Taal panel using the MenuConfig during build. We hoped that this will create the Display2 folder which will contain the panel-taal driver. It is still not contained, so the only drivers which can be linked to a manager/overlay are:

    1. display0 running driver "generic_dpi_panel" from "panel-generic-dpi.c"

    2. display1 running driver "hdmi_panel" from "hdmi_panel.c"

    We need display which can running driver from "panel-taal.c".

    Thanks,

    Rafi

  • Sorry I may have misunderstood your question. 

    Have you modified the board-omap4panda.c?

    By default there are the following two structures:
    static struct omap_dss_device  omap4_panda_hdmi_device = {
        .name = "hdmi",
        .driver_name = "hdmi_panel",
        .type = OMAP_DISPLAY_TYPE_HDMI,
        .clocks    = {
            .dispc    = {
                .dispc_fclk_src    = OMAP_DSS_CLK_SRC_FCK,
            },
            .hdmi    = {
                .regn    = 15,
                .regm2    = 1,
            },
        },
        .hpd_gpio = HDMI_GPIO_HPD,
        .channel = OMAP_DSS_CHANNEL_DIGIT,
    };

    AND: 

    struct omap_dss_device omap4_panda_dvi_device = {
        .type            = OMAP_DISPLAY_TYPE_DPI,
        .name            = "dvi",
        .driver_name        = "generic_dpi_panel",
        .data            = &omap4_dvi_panel,
        .phy.dpi.data_lines    = 24,
        .reset_gpio        = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
        .channel        = OMAP_DSS_CHANNEL_LCD2,
    };

    You need to add similar structure which uses: .name = "lcd",    .driver_name  = "taal",  .type = OMAP_DISPLAY_TYPE_DSI, .data = &dsi1_panel

    See board-4430sdp.c for reference. Both files are located in /kernel/android-3.0/arch/arm/mach-omap2.

    Best Regards,

    Yordan

  • Hi Yordan,

    Thank you for reply, now we have display that run the taal driver, but we can't enable it. we tried to run this follow commands:

    root@android:/ # cat /sys/devices/platform/omapdss/display0/name
    lcd

    root@android:/ # echo "1" > /sys/devices/platform/omapdss/display0/enabled    

    but, it is not switching:

    1|root@android:/ # cat /sys/devices/platform/omapdss/display0/enabled 

    0

    We get this massage from the kernel:

    <3>[ 1332.318572] omapdss DSI error: failed to set complexio power state to 1
    <3>[ 1332.325927] taal display0: failed to enable DSI

    Our display use the following signals on the DSI connector: lane0 for clock, lane 1 for data0, and lane 2 for data1. The polarity should be crossed.

    Hence, the structure is as follows:

    -board-omap4panda.c-

    static struct omap_dss_device sdp4430_lcd_device = {
        .name            = "lcd",
        .driver_name        = "taal",
        .type            = OMAP_DISPLAY_TYPE_DSI,
        .data            = &dsi1_panel,
        .phy.dsi        = {
            .clk_lane    = 1,//should we start from 0 or 1?
            .clk_pol    = 1,  //1 for crossed wires, 0 for normal ?
            .data1_lane    = 2,
            .data1_pol    = 1, //1 for crossed wires, 0 for normal ?
            .data2_lane    = 3,
            .data2_pol    = 1, //1 for crossed wires, 0 for normal ?
        },

        .panel = {
            .timings = {
                .x_res = 854,
                .y_res = 480,
            },
            .width_in_um = 98637,
            .height_in_um = 55440,
        },

        .clocks = {
            .dispc = {
                .channel = {
                    .lck_div    = 1,    /* Logic Clock = 172.8 MHz */
                    .pck_div    = 5,    /* Pixel Clock = 34.56 MHz */
                    .lcd_clk_src    = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC,
                },
                .dispc_fclk_src    = OMAP_DSS_CLK_SRC_FCK,
            },



            .dsi = {
                .regn        = 16,    /* Fint = 2.4 MHz */
                .regm        = 180,    /* DDR Clock = 216 MHz */
                .regm_dispc    = 5,    /* PLL1_CLK1 = 172.8 MHz */
                .regm_dsi    = 5,    /* PLL1_CLK2 = 172.8 MHz */

                .lp_clk_div    = 10,    /* LP Clock = 8.64 MHz */
                .dsi_fclk_src    = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI,
                .tlpx    = 12,
                .tclk = {
                    .zero     = 57,
                    .prepare = 15,
                    .trail     = 15,
                },
                .ths = {
                    .zero     = 22,
                    .prepare = 18,
                    .exit     = 32,
                    .trail     = 18,
                },
            },
        },
        .channel = OMAP_DSS_CHANNEL_LCD,
        .skip_init = false,
    };



    In addition, we think it is related to that:

    root@android:/ # cat /d/omapdss/clk                                           
    - DSS -
    dpll4_ck 1536000000
    DSS_FCK (DSS_FCLK) = 1536000000 / 9  = 170666666
    - DISPC -
    dispc fclk source = DSS_FCK (DSS_FCLK)
    fck        170666666      
    - DISPC-CORE-CLK -
    lck        170666666       lck div    1
    - LCD1 -
    lcd1_clk source = DSI_PLL_HSDIV_DISPC (PLL1_CLK1)
    lck        172800000       lck div    1
    pck        34560000        pck div    5
    - LCD2 -
    lcd2_clk source = DSS_FCK (DSS_FCLK)
    lck        42666666        lck div    4
    pck        42666666        pck div    1
    - DSI1 PLL -
    dsi pll source = dss_sys_clk
    Fint        2400000         regn 16
    CLKIN4DDR    864000000       regm 180
    DSS_FCK (DSS_FCLK)    172800000       regm_dispc 5    (off)
    DSS_FCK (DSS_FCLK)    172800000       regm_dsi 5    (off)
    - DSI1 -
    dsi fclk source = DSS_FCK (DSS_FCLK)
    DSI_FCLK    170666666
    DDR_CLK        216000000
    TxByteClkHS    54000000
    LP_CLK        0

    Rafi

  • Have you added your display in the following structures (all of them are located in the board-omap4panda.c file):

    static struct omap_dss_device *omap4_panda_dss_devices[] = {
        &omap4_panda_dvi_device,
        &omap4_panda_hdmi_device,
    };

    static struct omap_dss_board_info omap4_panda_dss_data = {
        .num_devices    = ARRAY_SIZE(omap4_panda_dss_devices),
        .devices    = omap4_panda_dss_devices,
        .default_device    = &omap4_panda_dvi_device,
    };

    The display init function uses data from these structures:

    void __init omap4_panda_display_init(void)
    {
        int status;

        status = gpio_request_array(panda_dvi_gpios_phy,
                                        ARRAY_SIZE(panda_dvi_gpios_phy));

        omap_display_init(&omap4_panda_dss_data);

        /*
         * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
         * later have external pull up on the HDMI I2C lines
         */
        if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2)
            omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP);
        else
            omap_hdmi_init(0);

        omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
        omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
        omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
    }

  • You may also need to enable your interface in the kernel config, if it's not already enabled.

  • Hi Yordan,

    We use "menu config" to enable in the kernel config, like the link below:

    http://omappedia.org/wiki/DSS_CONFIG_options

    Did you mean it?

    In addition, we add initialization function of the LCD that was taken from "board-4430sdp", as you wrote in previous comment, but we get another error:

    <3>[  853.115356] omapdss DSI error: DSI VC(0) error, vc irqstatus 25
    <7>[  853.121765] DSI VC(0) IRQ 0x25: CS BTA
    <3>[  853.126159] omapdss DSI error: DSI VC(0) error, vc irqstatus 25
    <7>[  853.132507] DSI VC(0) IRQ 0x25: CS BTA
    <3>[  853.136840] omapdss DSI error: DSI VC(0) error, vc irqstatus 25
    <7>[  853.143310] DSI VC(0) IRQ 0x25: CS BTA
    <3>[  853.147766] omapdss DSI error: DSI VC(0) error, vc irqstatus 25
    <7>[  853.154083] DSI VC(0) IRQ 0x25: CS BTA

    <6>[    4.519256] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-ehci-omap.0-1.1, smsc95xx USB 2.0 Ethernet, da:0f:47:06:8b:d7
    <6>[    4.532135] sr_class1p5_calib_work: mpu: Calibration complete: Voltage Nominal=1025000Calib=840000 margin=10000
    <6>[    4.545013] taal display0: taal panel revision 00.80.00
    <3>[    4.550933] omapdss DSI error: rx fifo not empty after write, dumping data:
    <3>[    4.558837] omapdss DSI error:     rawval 0x39020002
    <3>[    4.564208] omapdss DSI error:     ACK with ERROR (0x200):
    <3>[    4.570404] omapdss DSI error:         ECC Error, multi-bit (not corrected)
    <3>[    4.577514] omapdss DSI error: dsi_vc_dcs_write(ch 0, cmd 0x35, len 2) failed
    <6>[    4.632171] usb 1-1.3: new low speed USB device number 4 using ehci-omap
    <3>[    4.693481] omapfb omapfb: Failed to set TE
    <3>[    4.698181] omapfb omapfb: failed to initialize default display
    <3>[    4.705963] omapdss DSI error: rx fifo not empty after write, dumping data:
    <3>[    4.713714] omapdss DSI error:     rawval 0x39020002
    <3>[    4.719146] omapdss DSI error:     ACK with ERROR (0x200):
    <3>[    4.725219] omapdss DSI error:         ECC Error, multi-bit (not corrected)
    <3>[    4.732391] omapdss DSI error: dsi_vc_dcs_write(ch 0, cmd 0x28, len 1) failed
    <3>[    4.740142] taal display0: error disabling panel, issuing HW reset

    How can we fix it?

    Thanks for the help,

    rafi

  • Hello,

    I think this is caused because some wrong synchronization/timings in your system.

    I noticed that when modifying the board file you've included some additional parameters in the structures describing your lcd device, which uses the panel-taal.c driver. I think you just have to port the taal structures from board-omap4430sdp.c to board-omap4panda.c. The additional information may be redefined in some other file in the kernel; I've found that ".timigs = {..." is also defined with different x_res & y_res in kerenl/android-3.4/drivers/video/omap2/displays/panel-taal.c.

    try removing these fragments:

        .panel = {
            .timings = {
                .x_res = 854,
                .y_res = 480,
            },
            .width_in_um = 98637,
            .height_in_um = 55440,
         }

    =====================================

            .tlpx    = 12,
            .tclk = {
            .zero     = 57,
            .prepare = 15,
            .trail     = 15,
            },
            .ths = {
               .zero     = 22,
               .prepare = 18,
               .exit     = 32,
               .trail     = 18,
                },

    =====================================

                .tlpx    = 12,
                .tclk = {
                    .zero     = 57,
                    .prepare = 15,
                    .trail     = 15,
                },
                .ths = {
                    .zero     = 22,
                    .prepare = 18,
                    .exit     = 32,
                    .trail     = 18,
                },
            },
        },

    ======================================

        .skip_init = false,

    ======================================

    You can verify your timings and register settings for the corresponding mode (video/command) your dsi is running. These are described in OMAP4460 TRM Section 10.3.4 DSI Functional Specification.

    Also the following e2e posts might be useful to you:
    http://e2e.ti.com/support/omap/f/849/p/195580/705821.aspx
    http://e2e.ti.com/support/omap/f/849/p/205463/729381.aspx#729381

    http://e2e.ti.com/support/omap/f/849/p/199677/712484.aspx#712484

    http://e2e.ti.com/support/omap/f/849/t/226642.aspx

    Regards,

    Yordan

  • Hi Yordan,

    We suspect that our clock settings are incorrect.

    We are using:

        .clocks = {
            .dispc = {
                .channel = {
                    .lck_div    = 1,    /* Logic Clock = 172.8 MHz */
                    .pck_div    = 5,    /* Pixel Clock = 34.56 MHz */
                    .lcd_clk_src    = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC,
                },
                .dispc_fclk_src    = OMAP_DSS_CLK_SRC_FCK,
            },

            .dsi = {
                .regn        = 16,    /* Fint = 2.4 MHz */
                .regm        = 180,    /* DDR Clock = 216 MHz */
                .regm_dispc    = 5,    /* PLL1_CLK1 = 172.8 MHz */
                .regm_dsi    = 5,    /* PLL1_CLK2 = 172.8 MHz */

                .lp_clk_div    = 10,    /* LP Clock = 8.64 MHz */
                .dsi_fclk_src    = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI,

    What is the clock rate of the source clock OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC on the PandaBoard?

    (our example fits the blaze board...).

    Can you suggest values which will fit the PandaBoard?

    It seems we are getting many errors related to tearing. how can we disable tearing by default?

    Is there a way or an example of working in Video mode instead of command mode? It seems that all working examples are in video mode.

    Thanks for you time and effort,

    Rafi

  • Hi Rafi,

    Regarding your questions:

    "What is the clock rate of the source clock OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC on the PandaBoard" 

    - This is not the name of the source clock. This is a handle defined in the enum omap_dss_clk_source (defined in kernel-ubuntu/include/video/omapdss.h) and use to set the lck_div and pck_div values in the appropriate PLL (see kernel-ubuntu/drivers/video/omap2/dss/dsi.c). For pandaboard and all other omap4 devices dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK (which is defined as 0 in enum omap_dss_clk) which means that the dispc_fclk is taken directly from PRCM => it is 172.8 MHz. I think the above settings for .lclk_div =1 and pck_div = 5 are OK for padaboard.

    dsi timings (regn, regm, etc. )  depend on your panel resolution. The settings in your post correspond to the following panel resolution x_res = 864; y_res = 480 (defined in the taal driver).

    "It seems we are getting may errors related to tearing. How can we disable tearing by default?"

    According to OMAP4 TRM tearing is present only in command mode.  Ways to avoid tearing in command mode are described in 10.2.4.12.6 Synchronized Buffer Update and 10.3.4.4.9.2 Tearing Effect in OMAP4 TRM.

    "Is there a way or an example of working in Video mode instead of command mode?"

    I have no access to examples of working in Video mode. But the sequence to enable video mode is the following:
    1. Set up long packet header:  DSI_VC_LONG_PACKET_HEADER_i[31:0]

    2. Enable Video mode in the desired Video Channel: DSI_VC_CTRL_i[4] MODE = 0x1

    3. Enable desired VC: DSI_VC_CTRL_i[1] VC_EN = 0x1

    4. Enable DSI module DSI_CTRL[0] IF_EN = 0x1

    5. Wait until IF_EN = 1? DSI_CTRL[0] IF_EN = 1

    Best Regards,

    Yordan