how to add a st7701 panel on linux5.4.70 ?DTS & driver code as below.

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

how to add a st7701 panel on linux5.4.70 ?DTS & driver code as below.

2,397 Views
suvine
Contributor I

I add a new st7701 panel in linux5.4.70. but there are some problems with it,pls  help me

 

error log:

[ 8.640692] [drm:st7701_get_modes] *ERROR* ==suvine=st7701_get_modes=
[ 8.702147] [drm:st7701_prepare] *ERROR* ==suvine1==
[ 8.731847] [drm:st7701_prepare] *ERROR* ==suvine2==
[ 9.151834] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 9.427834] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out

NXP i.MX Release Distro 5.4-zeus OK8MP ttymxc1

OK8MP login: [ 9.895843] imx_sec_dsim_drv 32e60000.mipi_dsi: wait payload tx done time out
[ 10.155855] imx_sec_dsim_drv 32e60000.mipi_dsi: wait payload tx done time out
[ 10.415867] imx_sec_dsim_drv 32e60000.mipi_dsi: wait payload tx done time out
[ 10.675848] imx_sec_dsim_drv 32e60000.mipi_dsi: wait payload tx done time out
[ 10.935836] imx_sec_dsim_drv 32e60000.mipi_dsi: wait payload tx done time out
[ 11.195899] imx_sec_dsim_drv 32e60000.mipi_dsi: wait payload tx done time out
[ 11.455837] imx_sec_dsim_drv 32e60000.mipi_dsi: wait payload tx done time out
[ 11.715831] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 11.975831] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 12.235840] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 12.495823] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 12.755838] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 13.015834] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 13.275838] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 13.535834] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 13.795840] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 13.920843] audit: type=1701 audit(1626184062.832:6): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=978 comm="isp_media_serve" exe="/opt/imx8-isp/bin/isp_media_server" sig=11 res=1
[ 14.055832] imx_sec_dsim_drv 32e60000.mipi_dsi: wait pkthdr tx done time out
[ 14.315836] imx_sec_dsim_drv 32e60000.mipi_dsi: wait payload tx done time out
[ 14.323159] SError Interrupt on CPU3, code 0xbf000002 -- SError
[ 14.323162] CPU: 3 PID: 219 Comm: kworker/u8:2 Tainted: G C O 5.4.70-2.3.0 #19
[ 14.323164] Hardware name: Forlinx OK8MPlus-C board (DT)
[ 14.323166] Workqueue: events_unbound commit_work
[ 14.323168] pstate: 80000005 (Nzcv daif -PAN -UAO)
[ 14.323170] pc : _raw_spin_unlock_irq+0x1c/0x48
[ 14.323171] lr : wait_for_completion_timeout+0x8c/0x110
[ 14.323173] sp : ffff8000239fbb20
[ 14.323174] x29: ffff8000239fbb20 x28: ffff800011a36000
[ 14.323177] x27: 0000000000000000 x26: ffff8000120bbce8
[ 14.323183] x25: 0000000000000000 x24: ffff0000f8e20e00
[ 14.323186] x23: 0000000000000002 x22: ffff0000f8e20e00
[ 14.323189] x21: ffff0000f9647df8 x20: ffff0000f9647df0
[ 14.323192] x19: 000000000000003f x18: 0000000000000010
[ 14.323195] x17: 0000000000000000 x16: 0000000000000000
[ 14.323199] x15: ffff0000f8e21270 x14: 756f20656d697420
[ 14.323203] x13: 656e6f6420787420 x12: 64616f6c79617020
[ 14.323207] x11: 74696177203a6973 x10: 645f6970696d2e30
[ 14.323210] x9 : 3030303665323320 x8 : ffff800011b79000
[ 14.323213] x7 : ffff800010698948 x6 : 000000000000028a
[ 14.323216] x5 : 0000000000000001 x4 : ffff0000f9647e00
[ 14.323219] x3 : ffff0000f8e20e00 x2 : ffff8000239fbb78
[ 14.323223] x1 : ffff0000f8e20e00 x0 : 0000000100000001
[ 14.323227] Kernel panic - not syncing: Asynchronous SError Interrupt
[ 14.323230] CPU: 3 PID: 219 Comm: kworker/u8:2 Tainted: G C O 5.4.70-2.3.0 #19
[ 14.323231] Hardware name: Forlinx OK8MPlus-C board (DT)
[ 14.323233] Workqueue: events_unbound commit_work
[ 14.323235] Call trace:
[ 14.323236] dump_backtrace+0x0/0x140
[ 14.323237] show_stack+0x14/0x20
[ 14.323239] dump_stack+0xb4/0x114
[ 14.323240] panic+0x158/0x324
[ 14.323241] nmi_panic+0x84/0x88
[ 14.323243] arm64_serror_panic+0x74/0x80
[ 14.323244] do_serror+0x80/0x138
[ 14.323246] el1_error+0x84/0xf8
[ 14.323247] _raw_spin_unlock_irq+0x1c/0x48
[ 14.323249] sec_mipi_dsim_host_transfer+0x128/0x428
[ 14.323250] mipi_dsi_device_transfer.isra.0+0x48/0x58
[ 14.323252] mipi_dsi_dcs_write_buffer+0x68/0xa8
[ 14.323253] st7701_init_sequence+0x2a4/0x460
[ 14.323255] st7701_prepare+0x6c/0x80
[ 14.323256] drm_panel_prepare+0x24/0x38
[ 14.323258] sec_mipi_dsim_bridge_enable+0x3c/0x4b8
[ 14.323259] drm_atomic_bridge_enable+0x4c/0x68
[ 14.323261] drm_atomic_helper_commit_modeset_enables+0x11c/0x230
[ 14.323263] lcdifv3_drm_atomic_commit_tail+0x2c/0x68
[ 14.323264] commit_tail+0x9c/0x138
[ 14.323265] commit_work+0x10/0x18
[ 14.323267] process_one_work+0x198/0x320
[ 14.323268] worker_thread+0x48/0x420
[ 14.323269] kthread+0x138/0x158
[ 14.323271] ret_from_fork+0x10/0x1c
[ 14.323285] SMP: stopping secondary CPUs
[ 14.323287] Kernel Offset: disabled
[ 14.323288] CPU features: 0x0002,2000200c
[ 14.323289] Memory Limit: none

 

dts:

 

....

&mipi_dsi {
status = "okay";
//pmsreg = <0x8644>; //uboot
//timing = <0x203>; //uboot
//timing1 = <0x20d0803>; //uboot
//timing2 = <0x030305>; //uboot

mipi_panel@0 {
compatible = "techstar,ts8550b", "sitronix,st7701";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_st7701_reset_io>;
reset-gpios = <&gpio5 9 GPIO_ACTIVE_HIGH>; /* LCD-RST: */
reg = <0>;
dsi-lanes = <2>;
video-mode = <2>;/* 0: burst mode
* 1: non-burst mode with sync event
* 2: non-burst mode with sync pulse
*/
panel-width-mm = <69>;
panel-height-mm = <139>;
VCC-supply = <&ldo2_reg>;
IOVCC-supply = <&ldo2_reg>;
backlight = <&lm3509>;
status = "okay";
};

....

Tags (1)
0 Kudos
Reply
4 Replies

2,384 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @suvine 

Please print more information in st7701_get_modes

0 Kudos
Reply

2,378 Views
suvine
Contributor I

static const u32 rad_bus_formats[] = {
MEDIA_BUS_FMT_RGB888_1X24,
MEDIA_BUS_FMT_RGB666_1X18,
MEDIA_BUS_FMT_RGB565_1X16,
};

static const u32 rad_bus_flags = DRM_BUS_FLAG_DE_LOW |
DRM_BUS_FLAG_PIXDATA_NEGEDGE;

 

static int st7701_get_modes(struct drm_panel *panel)
{
struct st7701 *st7701 = panel_to_st7701(panel);
const struct drm_display_mode *desc_mode = st7701->desc->mode;
struct drm_display_mode *mode;

DRM_ERROR("==suvine=st7701_get_modes=\n");
mode = drm_mode_duplicate(panel->drm, desc_mode);
if (!mode) {
DRM_DEV_ERROR(&st7701->dsi->dev,
"failed to add mode %ux%ux@%u\n",
desc_mode->hdisplay, desc_mode->vdisplay,
desc_mode->vrefresh);
return -ENOMEM;
}

drm_mode_set_name(mode);
drm_mode_probed_add(panel->connector, mode);

panel->connector->display_info.width_mm = desc_mode->width_mm;
panel->connector->display_info.height_mm = desc_mode->height_mm;
panel->connector->display_info.bus_flags = rad_bus_flags;
drm_display_info_set_bus_formats(&panel->connector->display_info,
rad_bus_formats,
ARRAY_SIZE(rad_bus_formats));

return 1;
}

0 Kudos
Reply

1,972 Views
Farpoint
Contributor I

@suvine Did you ever get this to work?  I am having real problems getting the ST7701 to work on the iMX8MM platform so would appreciate any help you can offer

0 Kudos
Reply

1,555 Views
H_Grobben
Contributor I

I also ran into this, and found this topic:
https://community.nxp.com/t5/i-MX-Processors/iMX8MP-MIPI-DSI-Commands-Timing-Out/m-p/1703214

By moving the init from the prepare to enable function solved the timeout, and I do get an image, but still not correct: seems like the vertial line count is off for me.

By the way: I also removed the 'mandatory' IOVCC and VCC lines in the device tree.

 

0 Kudos
Reply