imx6 LCD 参数配置(lvds为例)
目前imx6的BSP開發中,lvds的參數配置一般在兩個地方:?
1. uboot的CMDLINE的參數設置,形如:?
video=mxcfb0:dev=ldb,bpp=32?
2. uboot板級代碼中對struct display_info_t的配置,形如:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
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>;};};}; };- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
下面幾篇博客對lcd基礎以及imx6相關方面的內容講的都十分詳細:?
1.?LCD參數解釋及計算?
2.?LCD驅動中pixclock的計算?
3.?imx6 android4.3 bsp開發實錄之一lvds、HDMMI輸出顯示?
4. Kernel源碼中文檔:?
Documentation/devicetree/bindings/video/fsl,ldb.txt?
Documentation/devicetree/bindings/fb/fsl_ipuv3_fb.txt?
Documentation/devicetree/bindings/video/display-timing.txt
我這里對以上內容進行總結,并結合開發經驗,對我們需要進行的配置項進行下歸納說明:
一. 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
二. 設備樹中的配置:
display-timings中的參數例如clock-frequency ,hactive ,vactive,hback-porch 等等在上面已經描述過了,經過查閱datasheet和調試,即可完成
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”遵循下圖規則:?
3.mode的選擇:
/** "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.*/- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
根據如上說明,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,待我驗證完成以后,會對此博客進行詳細說明和補充
總結
以上是生活随笔為你收集整理的imx6 LCD 参数配置(lvds为例)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux 内核引导选项简介 *****
- 下一篇: LCD 进入休眠的操作解决方式