【问题标题】:1920x720 support in mxc_edid.c, Embedded Linuxmxc_edid.c 中的 1920x720 支持,嵌入式 Linux
【发布时间】:2020-01-26 01:32:41
【问题描述】:

我正在使用 Apalis Imx6 开发嵌入式 Linux 板,我正在使用分辨率为 1920x720p 的屏幕。

我的设备支持其他分辨率,但未提及,我请求支持,以下是我得到的答案。

您需要编辑“fb_videomode mxc_cea_mode[64]”构造函数。您可能需要参考显示器数据表将刷新率、分辨率等输入到文件中。

http://git.toradex.com/cgit/linux-toradex.git/tree/drivers/video/fbdev/mxc/mxc_edid.c?h=toradex_4.9-2.3.x-imx

我有显示器数据表和所有东西,我的显示器也支持所需的分辨率。

我只需要知道如何编辑 mxc_edid.c 并保存它,然后重新编译内核以使我的屏幕正常工作。

非常感谢任何帮助。

谢谢..

【问题讨论】:

    标签: linux u-boot imx6


    【解决方案1】:

    在 Toradex 模块上重新编译 Linux 内核的一般指南在以下来自 Toradex developer website 的文章中描述: Build U-Boot and Linux Kernel From Source Code

    首先你必须安装交叉编译工具链,如Build U-Boot and Linux Kernel From Source Code - Toolchain中所述

    具体到您的用例,您必须克隆Build U-Boot and Linux Kernel From Source Code - Source Code - i.MX 6 Based Modules (Apalis/Colibri iMX6) 表中提供的正确 iMX6 内核分支。从您在问题中提供的链接来看,它似乎是toradex_4.9-2.3.x-imx。然后获取内核源代码关注Build U-Boot and Linux Kernel From Source Code - Kernel Source

    之后,您必须使用 apalis_imx6_defconfig 为 Apalis iMX6 配置内核,如 Build U-Boot and Linux Kernel From Source Code - Kernel Configuration - i.MX 6 based modules 中所述

    现在是您对源代码文件 drivers/video/fbdev/mxc/mxc_edid.c 进行更改的时候了。

    完成后,是时候编译内核了,在Build U-Boot and Linux Kernel From Source Code - Kernel Compilation - i.MX 6 Based Kernel (Apalis/Colibri iMX6) 中有描述。您可能还需要按照Build U-Boot and Linux Kernel From Source Code - Kernel Module Compilation, all Modules 中的说明重新编译内核模块。

    最后按照Build U-Boot and Linux Kernel From Source Code - Kernel Update 中的说明将内核更新到板上。

    迭代edit source code的过程 --> re-build the kernel --> re-deploy the kernel --> test changes直到你确定为止。


    或者,您可以编辑设备树来添加您的显示配置。

    这样做的主要参考是Device Tree Customization。设备树源码基本上是内核源码自带的,Build U-Boot and Linux Kernel From Source Code也提供了如何编译设备树的信息。

    这是一个代码 sn-p 突出显示相关更改:

    timing_wide: 1920x720 {
    +                clock-frequency = <104600000>;
    +                hactive = <1920>;
    +                vactive = <720>;
    +                hback-porch = <24>;
    +                hfront-porch = <24>;
    +                vback-porch = <8>;
    +                vfront-porch = <57>;
    +                hsync-len = <32>;
    +                vsync-len = <5>;
    +                hsync-active = <0>;
    +                vsync-active = <0>;
    +                pixelclk-active = <0>;
    +            };
    

    将其调整为适合您的显示器后,按照Build U-Boot and Linux Kernel From Source Code 中的说明构建并部署到设备。

    将设备树部署到模块后,您只需在 U-Boot 中设置正确的 vidargs:

    env set vidargs video=mxcfb0:dev=ldb,1920x720M@60,if=RGB666 ldb=sin0 fbmem=32M
    env save
    reset
    

    请注意,您不需要重建 U-Boot。您必须通过以下方式访问模块终端:

    1) 调试 UART,即串行控制台或; 2) 连接到模块的显示器和 USB 键盘。

    重启或重启时,您必须按任意键(如果使用 1,则从计算机中的串行终端仿真器应用程序)或直接在模块上(如果使用 2))访问 U-Boot 环境,您可以在其中执行上述命令。


    有关设备树自定义的参考,以下是支持自定义 LVDS 显示的相关设备树文件的差异(不是您的显示,但可以用作示例):

    diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
    index cfaaa571c158..b3c92314367b 100644
    --- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi
    +++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
    @@ -89,8 +89,8 @@
        mxcfb1: fb@0 {
            compatible = "fsl,mxc_sdc_fb";
            disp_dev = "ldb";
    -       interface_pix_fmt = "RGB666";
    -       default_bpp = <16>;
    +       interface_pix_fmt = "RGB24";
    +       default_bpp = <24>;
            int_clk = <0>;
            late_init = <0>;
            status = "disabled";
    @@ -507,123 +507,135 @@
     };
    
     &ldb {
    -   status = "okay";
    -// split-mode;
    -// dual-mode;
    -
    -   lvds-channel@0 {
    -       reg = <0>;
    -       fsl,data-mapping = "spwg"; /* "jeida"; */
    -       fsl,data-width = <18>;
    -       crtc = "ipu2-di1";
    -       primary;
    -       status = "okay";
    -
    -       display-timings {
    -           native-mode = <&timing_xga>;
    -           /* LDB-AM-800600LTNQW-A0H */
    -           timing_svga: 800x600 {
    -               clock-frequency = <55000000>;
    -               hactive = <800>;
    -               vactive = <600>;
    -               hback-porch = <112>;
    -               hfront-porch = <32>;
    -               vback-porch = <3>;
    -               vfront-porch = <17>;
    -               hsync-len = <80>;
    -               vsync-len = <4>;
    -               hsync-active = <0>;
    -               vsync-active = <0>;
    -               pixelclk-active = <0>;
    -           };
    -           /* Standard XGA timing */
    -           timing_xga: 1024x768 {
    -               clock-frequency = <65000000>;
    -               hactive = <1024>;
    -               vactive = <768>;
    -               hback-porch = <160>;
    -               hfront-porch = <24>;
    -               vback-porch = <29>;
    -               vfront-porch = <3>;
    -               hsync-len = <136>;
    -               vsync-len = <6>;
    -               hsync-active = <0>;
    -               vsync-active = <0>;
    -               pixelclk-active = <0>;
    -           };
    -           timing_wxga: 1280x800 {
    -               clock-frequency = <68930000>;
    -               hactive = <1280>;
    -               vactive = <800>;
    -               hback-porch = <64>;
    -               hfront-porch = <64>;
    -               vback-porch = <5>;
    -               vfront-porch = <5>;
    -               hsync-len = <40>;
    -               vsync-len = <6>;
    -               hsync-active = <0>;
    -               vsync-active = <0>;
    -               pixelclk-active = <0>;
    -           };
    -           /* LTTD1280800101-L4WH-CT1, note that it needs
    -              fsl,data-mapping = "spwg"; fsl,data-width = <24>; */
    -           timing_wxga1: 1280x800-1 {
    -               clock-frequency = <71100000>;
    -               hactive = <1280>;
    -               vactive = <800>;
    -               hback-porch = <60>;
    -               hfront-porch = <60>;
    -               vback-porch = <7>;
    -               vfront-porch = <7>;
    -               hsync-len = <40>;
    -               vsync-len = <9>;
    -               hsync-active = <0>;
    -               vsync-active = <0>;
    -               pixelclk-active = <0>;
    -           };
    -           timing_fullhd: 1920x1080 {
    -               clock-frequency = <138500000>;
    -               hactive = <1920>;
    -               vactive = <1080>;
    -               hback-porch = <80>;
    -               hfront-porch = <48>;
    -               vback-porch = <23>;
    -               vfront-porch = <3>;
    -               hsync-len = <32>;
    -               vsync-len = <5>;
    -               hsync-active = <0>;
    -               vsync-active = <0>;
    -               pixelclk-active = <0>;
    -           };
    -       };
    -   };
    -
    -   lvds-channel@1 {
    -       reg = <1>;
    -       fsl,data-mapping = "spwg";
    -       fsl,data-width = <18>;
    -       crtc = "ipu1-di0";
    -       status = "okay";
    -
    -       display-timings {
    -/*         native-mode = <&timing_svga_ch2>;*/
    -           /* LDB-AM-800600LTNQW-A0H */
    -           timing_svga_ch2: 800x600 {
    -               clock-frequency = <55000000>;
    -               hactive = <800>;
    -               vactive = <600>;
    -               hback-porch = <112>;
    -               hfront-porch = <32>;
    -               vback-porch = <3>;
    -               vfront-porch = <17>;
    -               hsync-len = <80>;
    -               vsync-len = <4>;
    -               hsync-active = <0>;
    -               vsync-active = <0>;
    -               pixelclk-active = <0>;
    -           };
    -       };
    -   };
    +    status = "okay";
    +     split-mode; // split mode on
    +//    dual-mode;
    +
    +    lvds-channel@0 {
    +        reg = <0>;
    +        fsl,data-mapping = "spwg"; /* "jeida"; */
    +        fsl,data-width = <24>;
    +        crtc = "ipu2-di1";
    +        primary;
    +        status = "okay";
    +
    +        display-timings {
    +            native-mode = <&timing_wide>;
    +            /* LDB-AM-800600LTNQW-A0H */
    +            timing_svga: 800x600 {
    +                clock-frequency = <55000000>;
    +                hactive = <800>;
    +                vactive = <600>;
    +                hback-porch = <112>;
    +                hfront-porch = <32>;
    +                vback-porch = <3>;
    +                vfront-porch = <17>;
    +                hsync-len = <80>;
    +                vsync-len = <4>;
    +                hsync-active = <0>;
    +                vsync-active = <0>;
    +                pixelclk-active = <0>;
    +            };
    +            /* Standard XGA timing */
    +            timing_xga: 1024x768 {
    +                clock-frequency = <65000000>;
    +                hactive = <1024>;
    +                vactive = <768>;
    +                hback-porch = <160>;
    +                hfront-porch = <24>;
    +                vback-porch = <29>;
    +                vfront-porch = <3>;
    +                hsync-len = <136>;
    +                vsync-len = <6>;
    +                hsync-active = <0>;
    +                vsync-active = <0>;
    +                pixelclk-active = <0>;
    +            };
    +            timing_wxga: 1280x800 {
    +                clock-frequency = <68930000>;
    +                hactive = <1280>;
    +                vactive = <800>;
    +                hback-porch = <64>;
    +                hfront-porch = <64>;
    +                vback-porch = <5>;
    +                vfront-porch = <5>;
    +                hsync-len = <40>;
    +                vsync-len = <6>;
    +                hsync-active = <0>;
    +                vsync-active = <0>;
    +                pixelclk-active = <0>;
    +            };
    +            timing_fullhd: 1920x1080 {
    +                clock-frequency = <138500000>;
    +                hactive = <1920>;
    +                vactive = <1080>;
    +                hback-porch = <80>;
    +                hfront-porch = <48>;
    +                vback-porch = <23>;
    +                vfront-porch = <3>;
    +                hsync-len = <32>;
    +                vsync-len = <5>;
    +                hsync-active = <0>;
    +                vsync-active = <0>;
    +                pixelclk-active = <0>;
    +            };
    +            timing_wide: 1920x720 {
    +                clock-frequency = <104600000>;
    +                hactive = <1920>;
    +                vactive = <720>;
    +                hback-porch = <24>;
    +                hfront-porch = <24>;
    +                vback-porch = <8>;
    +                vfront-porch = <57>;
    +                hsync-len = <32>;
    +                vsync-len = <5>;
    +                hsync-active = <0>;
    +                vsync-active = <0>;
    +                pixelclk-active = <0>;
    +            };
    +        };
    +    };
    +
    +    lvds-channel@1 {
    +        reg = <1>;
    +        fsl,data-mapping = "spwg";
    +        fsl,data-width = <18>;
    +        crtc = "ipu1-di0";
    +        status = "okay";
    +
    +        display-timings {
    +            native-mode = <&timing_wide_ch2>;
    +            /* LDB-AM-800600LTNQW-A0H */
    +            timing_svga_ch2: 800x600 {
    +                clock-frequency = <55000000>;
    +                hactive = <800>;
    +                vactive = <600>;
    +                hback-porch = <112>;
    +                hfront-porch = <32>;
    +                vback-porch = <3>;
    +                vfront-porch = <17>;
    +                hsync-len = <80>;
    +                vsync-len = <4>;
    +                hsync-active = <0>;
    +                vsync-active = <0>;
    +                pixelclk-active = <0>;
    +            };
    +            timing_wide_ch2: 1920x720 {
    +                clock-frequency = <104600000>;
    +                hactive = <1920>;
    +                vactive = <720>;
    +                hback-porch = <24>;
    +                hfront-porch = <24>;
    +                vback-porch = <8>;
    +                vfront-porch = <57>;
    +                hsync-len = <32>;
    +                vsync-len = <5>;
    +                hsync-active = <0>;
    +                vsync-active = <0>;
    +                pixelclk-active = <0>;
    +            };
    +        };
    +    };
     };
    

    【讨论】:

    • 非常感谢您的全面回答.. 替代方式是 Toradex 支持人员建议的首选方式,我只是想知道我需要遵循哪些步骤来编辑设备树以添加我的显示配置然后按照建议构建uboot。
    • 你不需要重建 U-Boot。您只需要重新编译设备树。它附带内核源代码,答案第一部分中使用的文章提供了如何重新编译设备树并将其部署到模块的说明。还有一篇专门讲设备树定制的文章:developer.toradex.com/device-tree-customization
    • 附注@MoatazFarrag 我已经编辑了答案以使其更全面,请检查它是否对您有帮助。
    • 非常感谢您的大力帮助和支持!我确实可以通过串行控制台通过另一台 Linux pc 访问我的主板,我可以访问 uboot 并读取所有设备信息,我现在已经从显示数据表中显示数据以添加到设备树中。我的问题是。我可以从 uboot 编辑设备树并添加我的显示数据然后保存并重新编译然后修改视频参数以使一切正常吗?
    • 在阅读 Toradex 的设备树自定义页面时等待您的友好回答,但我没有显示要使用的命令。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-23
    • 2014-11-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多