LCD屏幕移植
本文主要使用平台是imx6Q-C,linux 4.1.15操作系统,其他平台也可以参考,不同平台之间会存在差异,需自行修改适应自己的使用。 注:红色部分为需要修改或者是注意的部分 内核部分修改: 修改/drivers/video/fbdev/mxc/mxc_lcdif.c static struct
fb_videomode lcdif_modedb[] = { { /* 800x480 @ 57 Hz , pixel clk @ 27MHz
*/ "CLAA-WVGA", 57, 800, 480,
37037, 40, 60, 10, 10, 20, 10, FB_SYNC_CLK_LAT_FALL, FB_VMODE_NONINTERLACED, 0,}, /* 800x480 @ 60 Hz , pixel clk @ 32MHz
*/ { "SEIKO-WVGA", 60, 800, 480,
29850, 89, 164, 23, 10, 10, 10, FB_SYNC_CLK_LAT_FALL, FB_VMODE_NONINTERLACED, }, { "AT104-WVGA", 60, 800, 600, 25000,
210, 40, 23, 3, 6, 2, FB_SYNC_CLK_LAT_FALL, FB_VMODE_NONINTERLACED, 0,}, }; "AT104-WVGA", 60, 800, 600, 25000, 210, 40, 23, 3, 6, 2,各参数的含义可以自行搜索了解,此处不做阐述。 修改设备树/arch/arm/boot/dts/imx6qdl-sabresd.dtsi mxcfb1:
fb@0 { compatible = "fsl,mxc_sdc_fb"; disp_dev = "lcd"; inte**ce_pix_fmt =
"RGB24"; mode_str ="AT104-WVGA"; default_bpp = <16>; int_clk = <0>; late_init = <0>; status = "disabled"; }; lcd@0{ compatible =
"fsl,lcd"; ipu_id = <0>; disp_id = <0>; default_ifmt = "RGB24"; pinctrl-names =
"default"; pinctrl-0 = <&pinctrl_ipu1>; disp-power-on-supply =
<®_lcdif_pwr_on>; status = "okay"; RGB24:注意一下自己LCD硬件使用的数据是RGB565,RGB24或者是其他,根据实际情况填写 修改kernel/arch/arm/boot/dts/imx6q-c-sabresd.dts &mxcfb1
{ status = "okay"; }; 注意imx6q-c-sabresd.dts设备树中的配置 UBOOT部分修改: 修改uboot/ include/configs/mx6sabre_common.h #define
MXC_FB0
"mxcfb0=video=mxcfb0:dev=lcd,AT104-WVGA,if=RGB24,bpp=16,int_clk\0" 注:AT104-WVGA是和内核中的配置保持一致的。代码中的具体参数需要客户根据自己的屏幕手册自行计算,不知道参数具体含义的可以搜索了解这方面相关的知识。 文件系统处理: 移植完毕可能会出现触摸不准的情况需要修改文件系统中/etc/X11/xorg.conf vi
/etc/X11/xorg.conf Section "Device" Identifier "i.MX Accelerated Framebuffer
Device" Driver "vivante" Option "fbdev" "/dev/fb0" Option "vivante_fbdev"
"/dev/fb0" Option "HWcursor" "false" EndSection
Section "ServerFlags" Option
"BlankTime" "0" Option
"StandbyTime" "0" Option
"SuspendTime" "0" Option
"OffTime" "0" EndSection
Section "InputClass"
Identifier
"calibration" MatchProduct "TSC2007 Touchscreen" Option
"SwapAxes"
"0"
Option "InvertX" "1" EndSection 保存并退出 sync 并重新校准 rm
/etc/pointercal.xinput sync reboot 即可正常使用
|
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-23 04:56
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.