<var id="fnfpo"><source id="fnfpo"></source></var>
<rp id="fnfpo"></rp>

<em id="fnfpo"><object id="fnfpo"><input id="fnfpo"></input></object></em>
<em id="fnfpo"><acronym id="fnfpo"></acronym></em>
  • <th id="fnfpo"><track id="fnfpo"></track></th>
  • <progress id="fnfpo"><track id="fnfpo"></track></progress>
  • <tbody id="fnfpo"><pre id="fnfpo"></pre></tbody>

  • 技術分享 | i.MX8M Mini適配MIPI轉eDP芯片

    發布時間:2024-5-8 10:20    發布者:武漢萬象奧科
    關鍵詞: NXP , i.MX8M Mini , Display , Linux , ARM , Display , Linux , ARM

    1. 方案概述
    此方案使用HD-8MMN-CORE的核心板搭配TI公司的芯片SN65DSI86轉換芯片實現。
    SN65DSI86作為一款MIPI DSIeDP的芯片,支持雙通道DSI輸入,最大四通道顯示輸出,最大支持4K@60fps輸出,WUXGA 1080P。本方案中將采用單通道DSI輸入,雙通道DP輸出到1080p的屏幕。
    HD8MMN-CORE系列工業級核心板基于NXP(Freescale) i.MX8MM系列Cortex-A53高性能處理器設計,支持硬件加密,支持攝像頭接口、USB3.0接口、HDMI/MIPI、PCIe、千兆以太網接口、多路串口等,適用于快速開發一系列最具創新性的應用,如多媒體應用、人機界面、工業4.0、車載終端以及邊緣計算設備等。
    2硬件原理圖
    注:硬件修改REFCLK上需要貼上27M的晶振,TEST2引腳需要通過4.7K電阻上拉到1.8V.
    3軟件實現3.1軟件介紹
    l  內核版本:Linux5.10;
    l  SN65DSI86驅動:drivers/gpu/drm/bridge/ti-sn65dsi86.c
    l Panel驅動:drivers/gpu/drm/panel/panel-simple.c
    3.2驅動移植
    內核配置,需要打開如下兩項
    1. CONFIG_DRM_TI_SN65DSI86=y



    2. CONFIG_DRM_PANEL_SIMPLE=y

    復制代碼

    1)      設備樹配置
    1. / {



    2.         osc_27m: clock-osc-27m {



    3.                 compatible =

    4. "fixed-clock";



    5.                 #clock-cells = <0>;



    6.                 clock-frequency =

    7. <27000000>;



    8.                 clock-output-names =

    9. "osc_27m";



    10.         };





    11.         lcd_backlight: lcd_backlight {



    12.                 compatible =

    13. "pwm-backlight";



    14.                 pwms = <&pwm1 0

    15. 100000>;



    16.                 status = "okay";





    17.                 brightness-levels = < 0  1

    18. 2  3  4
    19. 5  6  7
    20. 8  9



    21.                                      10 11 12

    22. 13 14 15 16 17 18 19



    23.                                      20 21 22

    24. 23 24 25 26 27 28 29



    25.                                      30 31 32

    26. 33 34 35 36 37 38 39



    27.                                      40 41 42

    28. 43 44 45 46 47 48 49



    29.                                      50 51 52

    30. 53 54 55 56 57 58 59



    31.                                      60 61 62

    32. 63 64 65 66 67 68 69



    33.                                      70 71 72

    34. 73 74 75 76 77 78 79



    35.                                      80 81 82

    36. 83 84 85 86 87 88 89



    37.                                      90 91 92

    38. 93 94 95 96 97 98 99



    39.                                     100>;



    40.                 enable-gpios = <&gpio1 1

    41. GPIO_ACTIVE_HIGH>;



    42.                 default-brightness-level =

    43. <80>;



    44.         };



    45.         panel {



    46.                 compatible =

    47. "test,test-edp-1080p";      
    48. //設置自己的屏幕匹配參數組



    49.                 backlight =

    50. <&lcd_backlight>;



    51.                 no-hpd;





    52.                 port {



    53.                         panel1_in: endpoint {



    54.                                 remote-endpoint

    55. = <&sn65_out>;



    56.                         };



    57.                 };



    58.         };



    59. };


    60. &pwm1 {



    61.         pinctrl-names = "default";



    62.         pinctrl-0 = <&pinctrl_pwm1>;



    63.         status = "okay";



    64. };






    65. &i2c4

    66. {



    67.         clock-frequency = <400000>;



    68.         pinctrl-names = "default";



    69.         pinctrl-0 = <&pinctrl_i2c4>;



    70.         status = "okay";



    71.         sn65dsi86@2d {



    72.                …….



    73.                 clock-names =

    74. "refclk";          //默認名字

    75.                               //SN65DSI86僅支持12 MHz, 19.2 MHz, 26 MHz, 27 MHz
    76. or 38.4 MHz.



    77.                 clocks = <&osc_27m>;






    78.                ……



    79.                         port@1 {



    80.                                 reg =

    81. <1>;



    82.                                 sn65_out:

    83. endpoint {



    84.                                        

    85. //data-lanes = <0 1 2 3>;

    86.                                                                         //根據eDP屏的通道數設置,這里為2通道



    87.                                        

    88. data-lanes = <0 1>;



    89. ……

    復制代碼

    2)      驅動修改
    添加顯示屏的顯示參數到驅動中,修改drivers/gpu/drm/panel/panel-simple.c:

    tatic const struct display_timing test_edp_1080p_timing = {

    1.         .pixelclock = { 153000000, 153000000, 153000000 },


    2.         .hactive = { 1920, 1920, 1920 },


    3.         .hfront_porch = { 100, 100, 100 },


    4.         …..


    5.         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,


    6.         .connector_type = DRM_MODE_CONNECTOR_eDP,


    7. };



    8. static const struct of_device_id platform_of_match[] = {


    9.         {


    10.                 .compatible = "test,test-edp-1080p",


    11.                 .data = &test_edp_1080p,


    12.         },

    復制代碼

    修改sn65dsi86驅動以適應我們的板卡,修改drivers/gpu/drm/bridge/ti-sn65dsi86.c,修改DSI正確的模式,防止找不到注冊的panel出現報錯“could notfind any panel node”,開機過程中打印1次是正常的,SN65DSI86的驅動找不到Panel會被多次調用,直到找到panel為止。
    1. static int ti_sn_bridge_attach(struct drm_bridge *bridge,

                                     enum drm_bridge_attach_flags flags)

      {

      ...

              //dsi->mode_flags = MIPI_DSI_MODE_VIDEO;

              dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |

                                MIPI_DSI_MODE_EOT_PACKET | MIPI_DSI_MODE_VIDEO_HSE;

    復制代碼


    3)      調試報錯
    在調試過程中碰到“Link training failed, link is off”的報錯,是因為SN65DSI86默認只支持ASSR模式的eDP屏幕,對于不支持ASSR模式的eDP屏,硬件上則需要將TEST2引腳拉高到1.8V,且修改相關寄存器將芯片從ASSR模式變為支持標準的DP模式,修改如下:
    1. #define SN_ENH_FRAME_REG                        0x5A

      #define  ASSR_CONTROL                           BIT(0)

      ...


    2. static int ti_sn_link_training(struct ti_sn_bridge *pdata, int dp_rate_idx,

                                     const char **last_err_str)

      {

              unsigned int val;

              int ret;

              int i;


    3.         /* set dp clk frequency value */

              regmap_update_bits(pdata->regmap, SN_DATARATE_CONFIG_REG,

                                 DP_DATARATE_MASK, DP_DATARATE(dp_rate_idx));


    4.         regmap_write(pdata->regmap, 0xff, 0x07);

              regmap_write(pdata->regmap, 0x16, 0x01);

              regmap_write(pdata->regmap, 0xff, 0x00);

             /* For DisplayPort, use the standard DP scrambler seed. */

              regmap_update_bits(pdata->regmap, SN_ENH_FRAME_REG,ASSR_CONTROL, 0);

              /* enable DP PLL */

              regmap_write(pdata->regmap, SN_PLL_ENABLE_REG, 1);

      ...

    復制代碼

    如果未接eDP屏幕會出現如下報錯:
    1. [
    2. 2.299284] ti_sn65dsi86 3-002d: [drm:ti_sn_bridge_enable] ERROR Can't read lane
    3. count (-6); assuming 4

    4. [ 2.765851] ti_sn65dsi86 3-002d:
    5. [drm:ti_sn_bridge_enable] ERROR Can't read eDP rev (-6), assuming 1.1
    復制代碼


    本文地址:http://www.portaltwn.com/thread-856560-1-1.html     【打印本頁】

    本站部分文章為轉載或網友發布,目的在于傳遞和分享信息,并不代表本網贊同其觀點和對其真實性負責;文章版權歸原作者及原出處所有,如涉及作品內容、版權和其它問題,我們將根據著作權人的要求,第一時間更正或刪除。
    您需要登錄后才可以發表評論 登錄 | 立即注冊

    廠商推薦

    • Microchip視頻專區
    • Dev Tool Bits——使用MPLAB® Discover瀏覽資源
    • Dev Tool Bits——使用條件軟件斷點宏來節省時間和空間
    • Dev Tool Bits——使用DVRT協議查看項目中的數據
    • Dev Tool Bits——使用MPLAB® Data Visualizer進行功率監視
    • 貿澤電子(Mouser)專區

    相關視頻

    關于我們  -  服務條款  -  使用指南  -  站點地圖  -  友情鏈接  -  聯系我們
    電子工程網 © 版權所有   京ICP備16069177號 | 京公網安備11010502021702
    快速回復 返回頂部 返回列表
    精品一区二区三区自拍图片区_国产成人亚洲精品_亚洲Va欧美va国产综合888_久久亚洲国产精品五月天婷