imx6LCD参数配置(lvds为例)

imx6LCD参数配置(lvds为例)
⽬前imx6的BSP开发中,lvds的参数配置⼀般在两个地⽅:
1. uboot的CMDLINE的参数设置,形如:
video=mxcfb0:dev=ldb,bpp=32
2. uboot板级代码中对struct display_info_t的配置,形如:
static struct display_info_t const displays[] = {{
.bus    = -1,
.addr  = 0,
.pixfmt = IPU_PIX_FMT_LVDS666,
.detect = NULL,
.enable = NULL,
.
mode  = {
.name          = "wvga-lvds",
.refresh        = 60,
.xres          = 800,
.yres          = 480,
.pixclock      = 30066,
.left_margin    = 88,//HBPD
.right_margin  = 140,//HFPD
.upper_margin  = 31,//VBPD
.lower_margin  = 10, //VFBD
.hsync_len      = 28,//HSPW
.
vsync_len      = 4,//VSPW
.sync          = FB_SYNC_EXT,
.vmode          = FB_VMODE_NONINTERLACED
}
}};
3.kernel中设备树对ldb的配置,形如:
&ldb {
减温减压装置撬装重心lvds-channel@0 {
fsl,data-mapping = "spwg";
fsl,data-width = <24>;
primary;
status = "okay";
display-timings {
native-mode = <&timing0>;
timing0: claa080na23 {相框制作设备
clock-frequency = <33260000>;
hactive = <800>;
vactive = <480>;
hback-porch = <88>;
hfront-porch = <140>;
vback-porch = <31>;
vfront-porch = <10>;
hsync-len = <28>;
vsync-len = <4>;
};
};
};
};
下⾯⼏篇博客对lcd基础以及imx6相关⽅⾯的内容讲的都⼗分详细:
1.
2.
高频磁芯3.
4. Kernel源码中⽂档:
Documentation/devicetree/bindings/video/
Documentation/devicetree/bindings/fb/fsl_
Documentation/devicetree/bindings/
我这⾥对以上内容进⾏总结,并结合开发经验,对我们需要进⾏的配置项进⾏下归纳说明:⼀. lcd相关参数说明:
下图必不可少:
具体参数(不同datasheet中定义名称略有差别):
1. VBP(vertical back porch):
表⽰在⼀帧图像开始时,垂直同步信号以后的⽆效的⾏数,
对应驱动/设备树中的upper_margin/vback-porch;
2. VFP(vertical front porch):
表⽰在⼀帧图像结束后,垂直同步信号以前的⽆效的⾏数,
对应驱动/设备树中的lower_margin/vfront-porch;
笔式数字万用表3. VSPW(vertical sync pulse width):
表⽰垂直同步脉冲的宽度,⽤⾏数计算,
对应驱动/设备树中的vsync_len/vsync-len;
4. HBP(horizontal back porch):
表⽰从⽔平同步信号开始到⼀⾏的有效数据开始之间的VCLK的个数,
对应驱动/设备树中的left_margin/hback-porch;
5. HFP(horizontal front porth):
表⽰⼀⾏的有效数据结束到下⼀个⽔平同步信号开始之间的VCLK的个数, 对应驱动/设备树中的right_margin/hfront-porch;
6. HSPW(horizontal sync pulse width):
表⽰⽔平同步信号的宽度,⽤VCLK计算,
对应驱动/设备树中的hsync_len/hsync-len;
以上都是⽆效显⽰区域,下⾯两个是我们lcd正真有效的显⽰区域,即分辨率:
7. VDP(vertical display period):
表⽰垂直显⽰有效区域,对应驱动/设备树中的对应yres/hactive
8. HDP(horizontal display period):
表⽰⽔平显⽰有效区域,对应驱动/设备树中的对应xres/vactive
此外还有两个时钟相关参数:
DOTCLK frequency(设备树中的clock-frequency)和驱动中的pixclock
DOTCLK在datasheet中能查阅到,它与pixclock的关系是:
pixclock = 1000000 / DOTCLK ,启动DOTCLK单位是MHz,pixclock单位是⽪秒,例如:
若DOTCLK为33.26MHz,pixclock即为30066ps = 30.066ns
关于以上6个⽆效显⽰区域的配置,是根据datasheet中的Video Signal Timing来设置的,datasheet中还有两个参数VP和HP,即⽔平⽅向总长和垂直⽅向总长,他们与上述8个参数关系是:
VP = VBP + VDP + VFP + VSPW
HP = HBP + HDP + HFP + HSPW
若datasheet中没有这些参数的type值,⽽且根据时序图也⽆法计算出来,
就只能在min和max值之间进⾏选择尝试,注意:这8个值都⾮0,并且⼀定遵循上述2个公式
还有⼀点需要注意(不是很确定,看到有⼀个datasheet是这么定义的):
VSPW(min) < VSPW < VBP
HSPW(min) < HSPW < HBP
⼆. 设备树中的配置:
1. display-timings中的参数例如clock-frequency ,hactive ,vactive,hback-porch 等等在上⾯已经描述过了,经过查阅
datasheet和调试,即可完成
2. fsl,data-mapping和fsl,data-width的配置:
fsl,data-mapping: Should be “spwg” or “jeida”.
This describes how the color bits are laid out in the serialized LVDS signal.
fsl,data-width: Should be <18> or <24>
data-mapping具体也要根据datasheet来设置,”spwg” 和 “jeida”遵循下图规则:
黑导电布
/*
*    "ldb=spl0/1"      --      split mode on DI0/1
*    "ldb=dul0/1"      --      dual mode on DI0/1
*    "ldb=sin0/1"      --      single mode on LVDS0/1
*    "ldb=sep0/1"      --      separate mode begin from LVDS0/1
*
*    there are two LVDS channels(LVDS0 and LVDS1) which can transfer video
*    datas, there two channels can be used as split/dual/single/separate mode.
*
*    split mode means display data from DI0 or DI1 will send to both channels
*    LVDS0+LVDS1.
*    dual mode means display data from DI0 or DI1 will be duplicated on LVDS0
*    and LVDS1, it said, LVDS0 and LVDS1 has the same content.
*    single mode means only work for DI0/DI1->LVDS0 or DI0/DI1->LVDS1.
胡纯玉
*    separate mode means you can make DI0/DI1->LVDS0 and DI0/DI1->LVDS1 work
*    at the same time.
*/
根据如上说明,uboot参数中可以配置ldb的这四种模式,并且在设备树中,对于单通道和双通道也有以下配置: - split-mode: Provide this bool property if your board uses LDB split
mode to drive a high resolution display, say 1080P@60. In this
mode, two LVDS channels will drive one display.
- dual-mode: Provide this bool property if your board uses LDB dual
mode to drive two displays. In this mode, one display engine will
drive two displays which have the same timings and display content.
对于⼤分辨率双通道lvds来说,需要配置设备树中:
lvds属性split-mode,
并且clock-frequency为datasheet中DCLK×2
还需要在uboot参数中添加:
ldb=spl0/1
我们项⽬中即将使⽤分辨率为1920*720的双通道lvds,待我验证完成以后,会对此博客进⾏详细说明和补充

本文发布于:2024-09-22 12:39:00,感谢您对本站的认可!

本文链接:https://www.17tex.com/tex/1/275391.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

下一篇:dpms
标签:参数   设备   垂直   对应   驱动   注意   相关
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议