基於飛思卡爾imxsolosabresd開發板Linux-3.10.53 lvds螢幕除錯
BSP是Linux-3.10.53,在這個版本中引入了devicetree,所以一些關於硬體的配置都被剝離到dts中了,與3.0的版本有較大的改變,下面我們具體來看一下:
imxsolo燒寫的時候,需要的是imx6dl-sabresd.dtb檔案,對應的原始碼是imx6dl-sabresd.dts,關於一些硬體的設定都在imx6qdl-sabresd.dtsi中,我們直接看這個:
在linux-imx/arch/arm/boot/dts/imx6qdl-sabresd.dtsi中,關於lvds的程式碼片段如下:
&ldb { 516 status = "okay"; 517 split-mode; 518 519
[email protected] { 520 fsl,data-mapping = "spwg"; 521 fsl,data-width = <24>; 522 status = "okay"; 523 524 display-timings { 525 native-mode = <&timing0>; 526 timing0: hsd100pxn1 { 527 clock-frequency = <65000000>; 528 hactive = <1024>; 529 vactive = <768>; 530 hback-porch = <220>; 531 hfront-porch = <40>; 532 vback-porch = <21>; 533 vfront-porch = <7>; 534 hsync-len = <60>; 535 vsync-len = <10>; 536 }; 537 }; 538 }; 539 540[email protected] { 541 fsl,data-mapping = "spwg"; 542 fsl,data-width = <24>; 543 primary; 544 status = "okay"; 545 546 display-timings { 547 native-mode = <&timing1>; 548 timing1: hsd100pxn1 { 549 clock-frequency = <65000000>; 550 hactive = <1024>; 551 vactive = <768>; 552 hback-porch = <220>; 553 hfront-porch = <40>; 554 vback-porch = <21>; 555 vfront-porch = <7>; 556 hsync-len = <60>; 557 vsync-len = <10>; 558 }; 559 }; 560 }; 561 };
每一項的具體含義,參考:
linux-imx/Document/devicetree/bindings/video/fsl,ldb.txt
linux-imx/Document/devicetree/bindings/video/display-timing.txt
屏的datasheetdisplay-timings {
native-mode = <&timing0>;
timing0: hsd100pxn1 {
clock-frequency = <71100000>;
hactive = <1280>;
vactive = <800>;
hback-porch = <100>;
hfront-porch = <40>;
vback-porch = <12>;
vfront-porch = <4>;
hsync-len = <20>;
vsync-len = <7>;
};
};
與屏的廠家確認過,HS Width、Back Poch、Front Porch這三項的值任意,只要最後的和為160即可,VS Width同理。
編譯dts:
因為只修改了dts,所以只需要重新編譯dts並把相應的dtb燒寫到板子上即可。
進入linux-imx目錄:
make ARCH=arm CROSS_COMPILE=/編譯器路徑/arm-poky-linux-gnueabi- dtbs
生成的dtb在arch/arm/boot/dts下面。
將生成的dtb拷貝到MFG-TOOL中,並替換其中的zImage-imx6dl-sabresd.dtb,重新命名為相同的檔名,然後開始燒寫。
***注意:
上面lvds是單通道的,[email protected]有訊號。
如果你下載編譯的是core-image-minimal,修改之後沒有效果,至少下載core-image-base。
上述方法是在linux 3.10.53上修改的,不需要uboot引數,mfgtool要用3.10.53版的,不然燒寫有問題。