how to add a new panel with imx8mm evk ? I got some problem

Showing results for 
Search instead for 
Did you mean: 

how to add a new panel with imx8mm evk ? I got some problem

Contributor II


   I got a imx8mm evk board and a panel (MX8_DSI_OLED1).

   I have test the demo images , it works well.

   And I want to test my own lcd with the panel driver st7701s.And i made a connector board for it.


   1. creat a driver file in kernel_imx\drivers\gpu\drm\panel, panel-sitronix-st7701s.c

    2. and add     obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701S) += panel-sitronix-st7701s.o   

   in Makefile under kernel_imx\drivers\gpu\drm\panel

    3. then add : in Kconfig ,also under kernel_imx\drivers\gpu\drm\panel

               config DRM_PANEL_SITRONIX_ST7701S
                     tristate "Sitronix ST7701S panel"
                     depends on OF
                     depends on DRM_MIPI_DSI
                     depends on BACKLIGHT_CLASS_DEVICE
                        Say Y here if you want to enable support for Sitronix ST7701S
                        (480x640) DSI panel.

      4.add : in kernel_imx\arch\arm64\configs\android_defconfig


      5. modify: line 131  in android_build\device\fsl\imx8m\evk_8mm\

old :

            TARGET_BOARD_DTS_CONFIG ?= imx8mm:fsl-imx8mm-evk.dtb imx8mm-mipi-panel:fsl-imx8mm-evk-rm67191.dtb imx8mm-dsd:fsl-imx8mm-evk-ak4497.dtb imx8mm-m4:fsl-imx8mm-evk-m4.dtb


 TARGET_BOARD_DTS_CONFIG ?= imx8mm:fsl-imx8mm-evk.dtb imx8mm-mipi-panel:fsl-imx8mm-evk-st7701s.dtb imx8mm-dsd:fsl-imx8mm-evk-ak4497.dtb imx8mm-m4:fsl-imx8mm-evk-m4.dtb

   6. creat a dts file for st7701s


make with no error ,but no display on the panel.

the driver file below may:

//dsi->mode_flags |= MIPI_DSI_MODE_LPM;

when I test it is set as LP Mode, and I can get the MIPI-D0+/-  signal well .But the signal is not correct,it is incomplete, even short writes.

I don't know why.


Then I test the rm67191(MX8_DSI_OLED1),and I find almost all the cmds is 2 bytes short write. 

why ?

would you pls send me the panel driver file of rm67191?(not the datasheet for the panel,I have got it)

there is some error while with more the 2 bytes .

As below it is 3 bytes(in file panel-raydium-rm67191.c),and the data really sent is all 0.

/* Set tear scanline */
ret = mipi_dsi_dcs_set_tear_scanline(dsi, 0x380);
if (ret < 0) {
DRM_DEV_ERROR(dev, "Failed to set tear scanline (%d)\n", ret);
goto fail;

would u please tell me ,the total steps of proting a new panel for imx8mm (android)?



Labels (1)
9 Replies

Contributor III

Hello fangkai, thanks for your post and all the detailed information that you put in it, it is very helpful to me.

I'm facing the same situation you did, I have to write my own drm driver for a custom MIPI DSI panel for our board based on the imx8 mini processor. The problem is that I don't have a clue about how the panel driver (e.g. panel-sitronix-st7701s.c in your case) communicates with the uppers layers, which header file I should include, which functions and/or structures I must declare in it, etc.. Can you give a piece of advice about it or at least where to find information regards this?

Our MIPI panel has a Himax HX8394-A01 controller inside.

best regards, 


0 Kudos

Contributor II

Hi Fangkai, thank you for publishing your files and experience here.  I am in the same position, trying to get an ST7701S panel to work with i.MX8M (actually, Coral SoM board).  I am very interested to know if you had success...



0 Kudos

Contributor II

Thanks for your work, you did already.

I added a new display (the ORIC ORC03003N-40) using the Sitronix ST7701 driver chip  to the iMX8MM EVK.

I patched the Raydium rm67191 driver by only changing the init sequence to the manufacturer command set of the new display, adjusted the pixel clock, and corrected the number of lanes in the corresponding dts and I immediately got colored stripes shown on the display.

One important observation is that the raydium driver uses

mipi_dsi_generic_write() to send mipi commands, which is working, while mipi_dsi_dcs_write_buffer() failed with "wait payload tx done time out" or ""wait pkthdr tx done time out" errors (in kernel log) after about four successful writes.

Find patches for i.MX8MM Android 10 sources below.

Apply with

cd imx-android-10/android_build/vendor/nxp-opensource/kernel_imx

git apply 0001-add-st7701-driver-shows-stripes-not-finished.patch

cd imx-android-10/android_build/device/fsl

git apply 0001-change-mipi-display-to-st7701.patch

Contributor III

hello:did you solve this problem

i think you used rn67191 default manufacturer_cmd,which is diffrent of you lcd module.

0 Kudos

Contributor II

Hi igor,

         I'm very glad to receive your reply.

I have tried to modify the manufacturer_cmd_set[],and add some prints to show it works.


the cmds I need to send:

unsigned char ST7701S_CMD_TABLE_BK0[]={0xFF,0x77,0x01,0x00,0x00,0x10};
unsigned char ST7701S_CMD_LNESET[]={0xC0,0x4F,0x00};




                     Enter rad_panel_enable ...
[ 1.508806] Send cmd exit slp in rad_panel_enable.
[ 1.518847] Enter rad_panel_push_cmd_list.
[ 1.518850] current cmd lenth 6.
[ 1.518852] send 0xff 0x77.
[ 1.518872] send 0x1 0x0.
[ 1.518891] send 0x0 0x10.
[ 1.518909] current cmd lenth 3.
[ 1.518911] send 0xc0 0x4f.
[ 1.518929] send 0x0.


becaues the data length more than 2 ,it will be an error(I don't know why).

so all the cmds is send 2 by 2,

I don't know it works or not to the panel.

and 1st ,I should sent the cmds.

but the signals on data lane 0 is not correct,while the log seems no error.


and the right one on panle rm67191 is as below:  (CMD: SLP_OUT)


I really need some help on how to modify the driver files.

Thank u 

0 Kudos

Contributor II


I modified it,

static const struct display_timing rad_default_timing = {
#if 0
.pixelclock = { 66000000, 132000000, 132000000 },
.hactive = { 1080, 1080, 1080 },
.hfront_porch = { 20, 20, 20 },
.hsync_len = { 2, 2, 2 },
.hback_porch = { 34, 34, 34 },
.vactive = { 1920, 1920, 1920 },
.vfront_porch = { 10, 10, 10 },
.vsync_len = { 2, 2, 2 },
.vback_porch = { 4, 4, 4 },
.pixelclock = { 24000000, 24000000, 24000000 },//Hz : htotal*vtotal*60 = 23 908 800 Hz
.hactive = { 480, 480, 480 },
.hfront_porch = { 50, 50, 50 },
.hsync_len = { 10, 10, 10 },
.hback_porch = { 46, 46, 46 },
.vactive = { 640, 640, 640 },
.vfront_porch = { 15, 15, 15 },
.vsync_len = { 10, 10, 10 },
.vback_porch = { 15, 15, 15 },

and the dts file of rm67191 :

   change the lanes,width,height



   &mipi_dsi {
            panel@0 {
                     compatible = "raydium,rm67191";
                     reg = <0>;
                     pinctrl-0 = <&pinctrl_mipi_dsi_en>;
                     reset-gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
                     dsi-lanes = <2>;//4,2
                     video-mode = <2>; /* 0: burst mode
                                                      * 1: non-burst mode with sync event
                                                      * 2: non-burst mode with sync pulse
                      panel-width-mm = <37>;//68,37
                      panel-height-mm = <65>;//121,65
                      status = "okay";

but there is something wrong:

[1.710043] imx_sec_dsim_drv 32e10000.mipi_dsi: wait pkthdr tx done time out
[ 1.710051] panel-raydium-rm67191 32e10000.mipi_dsi.0: [drm:rad_panel_enable] *ERROR* Failed to send init cmds (-16)
[ 1.710056] imx_sec_dsim_drv 32e10000.mipi_dsi: panel enable failed: -16

Anywhere I need to modify?


Contributor III

Hi, I got the same problem "wait pkthdr tx done time out" with MIPI DSI LCD based on NT35596 Panel Driver. Do you have any idea to solve it? Thank you.

0 Kudos

NXP TechSupport
NXP TechSupport

probably your custom panel needs different that radium initialization

(check cmd_set_table manufacturer_cmd_set[]), it can be found in panel datasheet.

Best regards

0 Kudos

NXP TechSupport
NXP TechSupport

Hi 凯 方

custom lcd timings can be adjusted in display_timing rad_default_timing() in


panel-raydium-rm67191.c\panel\drm\gpu\drivers - linux-imx - i.MX Linux kernel 

Best regards
Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos