Kevin Lee
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: Android BSP Development --- # Qucomm MIPI DSI LCD Bring Up ## MIPI DSI介紹 **MIPI**是**Mobile Industry Processor Interface**的縮寫。MIPI是MIPI聯盟發起的為手機處理器制定的開放標準。 已經完成和正在計畫的規範如下: ![](https://i.imgur.com/nXvwjja.png) ##### 名詞解釋 - DCS (DisplayCommandSet):DCS是一個標準化的命令集,用於命令模式的顯示模組 - DSI (DisplaySerialInterface) : DSI 定義一個介於處理器和顯示模组間的高速串行接口 - CSI (CameraSerialInterface) : CSI 定義一個介於處理器和攝像模组間的高速串行接口 - D-PHY:提供DSI和CSI的物理層定義 ##### DSI分層結構 DSI分四層 - PHY層定義了傳輸媒介,輸入/輸出電路和和時鐘和信號機制。 - Lane Management層:發送和收集數據流到每條lane。 - Low Level Protocol層:定義了如何组帧和解析以及錯誤檢測等。 - Application層:描述高層編碼和解析數據流。 ![](https://i.imgur.com/l2hn74G.png) ##### Command和Video模式 - DSI兼容的外設支持Command或Video操作模式,用哪個模式由外設的架構决定 - Command模式是指採用發送命令和數據到具有顯示缓存的控制器。主机通過命令間接的控制外設。Command模式採用雙向接口 - Video模式是指從主机傳輸到外設採用时实象素流。這種模式只能以**高速傳輸**。為减少複雜性和節約成本,只採用Video模式的系统可能只有一個單項數據路徑 ## 使用Qcomm工具Bring up LCD ### Display Driver Development Procedure 1. Install the library by the command below. ``` $ sudo apt-get install libxml-libxml-perl libxml-perl ``` 2. Enter the tools directory *$ cd device/qcom/common/display/tools* which will show information as below: ``` device/qcom/common/display/tools$ ls panel_hx8394f_720p_video.xml panel_ili9881c_720p_video.xml panel_nt35590_720p_cmd.xml panel_nt35596_1080p_video.xml parser.pl platform-msm8610.xml README.txt ``` 3. Copy the panel_nt35596_1080p_video.xml to a new <oem_panel_input_file>.xml, if the LCD is in video mode. In my case, LCD use vedio mode. ``` $ cp panel_nt35596_1080p_video.xml panel_mydemo_1080p_video.xml ``` ### Edit the new XML to configure the display parameters. (According my LCD spec) #### Panel Information ``` 32 <GCDB> 33 <Version>"1.0"</Version> 34 <PanelId>mydemo-1080p-video</PanelId> 35 <PanelH>mydemo_1080p_video</PanelH> 36 <PanelEntry> ``` | XML Tag | Description | | ------- | ----------------------------------------------- | | Version | Each version is bind to be a set of panel tags. | | PanelId | Name used to generate the .dtsi file for kernel | | PanelH | Name used to generate the header file for LK | #### Panel configuration ``` 38 <!-- Panel configuration --> 39 <PanelName>"my demo 1080p video mode dsi panel"</PanelName> 40 <PanelController>"mdss_dsi0"</PanelController> 41 <PanelInterface>10</PanelInterface> 42 <PanelType>0</PanelType> 43 <PanelDestination>"DISPLAY_1"</PanelDestination> 44 <PanelOrientation>0</PanelOrientation> 45 <PanelFrameRate>60</PanelFrameRate> 46 <PanelChannelId>0</PanelChannelId> 47 <DSIVirtualChannelId>0</DSIVirtualChannelId> 48 <PanelBroadcastMode>0</PanelBroadcastMode> 49 <!-- Optional Panel configuration --> 50 <!--BitClockFrequency>0</BitClockFrequency --> 51 <DSIStream>0</DSIStream> 52 <PanelCompatible>"qcom,mdss-dsi-panel"</PanelCompatible> 53 <InterleaveMode>0</InterleaveMode> ``` | XML Tag | Description | Value | | --------------------------------------- | ------------------------------------------------------- | ------------------------------------ | | PanelName | PanelName | Name/label value | | PanelType | Panel is in video mode or command mode | 0 = VIDEO_MODE<br />1 = COMMAND_MODE | | PanelOrientation<br />(Only used in LK) | Panel rotation value. | 1 = 0 degree<br />2 = 180 degree | | PanelFrameRate | An integer to define the panel refresh rate per second. | For example: 60 for 60fps panel. | #### Panel Resolution ``` 55 <!-- Panel Resolution --> 56 <PanelWidth>1200</PanelWidth> 57 <PanelHeight>1920</PanelHeight> 58 <HFrontPorch>60</HFrontPorch> 59 <HBackPorch>32</HBackPorch> 60 <HPulseWidth>1</HPulseWidth> 61 <HSyncSkew>0</HSyncSkew> 62 <VBackPorch>25</VBackPorch> 63 <VFrontPorch>35</VFrontPorch> 64 <VPulseWidth>1</VPulseWidth> 65 <HLeftBorder>0</HLeftBorder> 66 <HRightBorder>0</HRightBorder> 67 <VTopBorder>0</VTopBorder> 68 <VBottomBorder>0</VBottomBorder> 69 <!-- Optional Panel resolution configuration --> 70 <!--HActiveRes>0</HActiveRes> 71 <VActiveRes>100</VActiveRes> 72 <InvertDataPolarity>0</InvertDataPolarity> 73 <InvertVsyncPolarity>0</InvertVsyncPolarity> 74 <InvertHsyncPolarity>0</InvertHsyncPolarity --> ``` ![](https://i.imgur.com/yppziHp.png) ##### Panel Color Information ``` 76 <!-- Panel Color Information --> 77 <ColorFormat>24</ColorFormat> 78 <ColorOrder>0</ColorOrder> 79 <UnderFlowColor>0xff</UnderFlowColor> 80 <BorderColor>0</BorderColor> ``` | XML Tag | Description | Value | | ----------- | ---------------------------------------------------------- | ------------------------------------------------------------ | | ColorFormat | Defines the bits per pixel. | 24 = 888_RGB<br />18 = 666_RGB<br />16 = 565_RGB<br />12 = 444_RGB<br />8 = 332_RGB<br />3 = 111_RGB | | ColorOrder | Defines pixel component color order between MSM and panel. | 0 = DSI_RGB_SWAP_RGB<br />1 = DSI_RGB_SWAP_RBG<br />2 = DSI_RGB_SWAP_BGR<br />3 = DSI_RGB_SWAP_BRG<br />4 = DSI_RGB_SWAP_GRB<br />5 = DSI_RGB_SWAP_GBR | #### Video mode panel information ``` 608 <!-- Video mode panel information --> 609 <HSyncPulse>1</HSyncPulse> 610 <HFPPowerMode>0</HFPPowerMode> 611 <HBPPowerMode>0</HBPPowerMode> 612 <HSAPowerMode>0</HSAPowerMode> 613 <BLLPEOFPowerMode>1</BLLPEOFPowerMode> 614 <BLLPPowerMode>1</BLLPPowerMode> 615 <TrafficMode>2</TrafficMode> 616 <DMADelayAfterVsync>0</DMADelayAfterVsync> 617 <BLLPEOFPower>0x9</BLLPEOFPower> ``` | XML Tag | Description | Value | | ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ | | HSyncPulse | Horizontal sync pulses. <br />It determines whether the hardware <br />should send horizontal sync pulses<br />during the vertical blanking period. | 0 = Sync pulse disable<br />1 = Sync pulse enable | | TrafficMode | Panel traffic mode type | 0 = non burst with sync pulses<br />1 = non burst with sync start event<br />2 = burst mode | Usually these parameters do not need to be modified. The user may need to note the parameter <TrafficMode> which may vary with the LCD chip. #### Lane Configuration ``` 619 <!-- Lane Configuration --> 620 <DSILanes>4</DSILanes> 621 <DSILaneMap>0</DSILaneMap> 622 <Lane0State>1</Lane0State> 623 <Lane1State>1</Lane1State> 624 <Lane2State>1</Lane2State> 625 <Lane3State>1</Lane3State> ``` ![](https://i.imgur.com/3qT6sHk.png) #### Backlight Configuration ``` 634 <!-- Backlight --> 635 <BLInterfaceType>1</BLInterfaceType> 636 <BLMinLevel>100</BLMinLevel> 637 <BLMaxLevel>4095</BLMaxLevel> 638 <BLStep>100</BLStep> 639 <BLPMICModel>"PMIC_8941"</BLPMICModel> 640 <BLPMICControlType>0</BLPMICControlType> ``` | XML Tag | Description | Value | | ----------------- | -------------------------------------- | ------------------------------------------------------------ | | BLMinLevel | Minimum value of backlight. | | | BLMaxLevel | Maximum value of backlight. | | | BLPMICControlType | PMIC controller for current backlight. | 0 = PWM GPIO<br />1 = WLED<br />2 = DCS COMMANDS<br />3 = LPG | #### Panel Timing | XML Tag | Description | | ------------ | ------------------------------------------------------------ | | PanelTimings | An array of length 12 that specifies the physical timing settings for the panel | | TClkPost | DSI timing control clock post value | | TClkPre | DSI timing control clock pre value | Generate PanelTimings Value ![](https://i.imgur.com/6acqNkH.png) ![](https://i.imgur.com/2HbE9R1.png) ``` 627 <!-- Panel Timing --> 628 <PanelTimings>"0xf7, 0x3a, 0x28, 0x00, 0x6e, 0x72, 0x2c, 0x3e, 0x31, 0x03, 0x04, 0x00"</PanelTimings> 629 <DSIMDPTrigger>0</DSIMDPTrigger> 630 <DSIDMATrigger>4</DSIDMATrigger> 631 <TClkPost>0x2</TClkPost> 632 <TClkPre>0x2d</TClkPre> ``` #### Panel Command information ``` 82 <!-- Panel Command information --> 83 <OnCommand>"0x05, 0x01, 0x00, 0x00, 0x96, 0x00, 0x02, 0x28, 0x00, 84 0x05, 0x01, 0x00, 0x00, 0x32, 0x00, 0x02, 0x10, 0x00, 85 0x05, 0x01, 0x00, 0x00, 0x96, 0x00, 0x02, 0x11, 0x00, 86 0x05, 0x01, 0x00, 0x00, 0x32, 0x00, 0x02, 0x29, 0x00"</OnCommand> 87 <OffCommand>"0x05, 0x01, 0x00, 0x00, 0x32, 0x00, 0x02, 0x28, 0x00, 88 0x05, 0x01, 0x00, 0x00, 0x78, 0x00, 0x02, 0x10, 0x00"</OffCommand> 89 <OnCommandState>0</OnCommandState> 90 <OffCommandState>1</OffCommandState> ``` | XML Tag | Description | Value | | --------------- | ------------------------------------------------------------ | ------------------------------------ | | OnCommand | Array of variable length that lists the initialization commands of the panel | | | OffCommand | Array of variable length that lists the deinitialization commands of the panel | | | OnCommandState | Panel state when sending the on command. | 0 = DSI_LP_MODE<br />1 = DSI_HP_MODE | | OffCommandState | Panel state when sending the off command. | | Generally speaking, <OnCommandState> and <OffCommandState> only need to keep the default value. #### Panel Reset Sequence ``` 126 <!-- Panel Reset Sequence --> 127 <ResetSequence> 128 <PinState1>1</PinState1> 129 <PulseWidth1>20</PulseWidth1> 130 <PinState2>0</PinState2> 131 <PulseWidth2>1</PulseWidth2> 132 <PinState3>1</PinState3> 133 <PulseWidth3>20</PulseWidth3> 134 <EnableBit>2</EnableBit> 135 </ResetSequence> ``` ## Configure Kernel and LK ``` $ perl parser.pl panel_mydemo_1080p_video.xml panel $ ls dsi-panel-mydemo-1080p-video.dtsi panel_ili9881c_720p_video.xml panel_mydemo_1080p_video.xml panel_nt35596_1080p_video.xml platform-msm8610.xml panel_hx8394f_720p_video.xml panel_mydemo_1080p_video.h panel_nt35590_720p_cmd.xml parser.pl README.txt ``` #### Configure Kernel copy *dsi-panel-mydemo-1080p-video.dtsi* to the following directory: kernel/msm-3.18/arch/arm/boot/dts/qcom/. 1. Include .dtsi files. Path: kernel/msm-3.18/arch/arm/boot/dts/qcom/msm8953-mdss-panels.dtsi ![](https://i.imgur.com/Z1YCGsy.png) 2. Modify .dtsi files. Add DSI PHY 2.0.0 timing config to the following directory: kernel/msm-3.18/arch/arm/boot/dts/qcom/msm8953-mdss-panels.dtsi. ![](https://i.imgur.com/iJclfP5.png) The parameters of timing “*mdss-dsi-panel-timings-phy-v2*” are the same as that of the timimg configured in LK (bootable/bootloader/lk/dev/gcdb/display/include/panel_mydemo_1080p_video.h) “mydemo_1080p_phy2_video_timings”. ![](https://i.imgur.com/Zks2wvH.png) ``` &dsi_mydemo_1080p_video { qcom,mdss-dsi-panel-timings-phy-v2 = [ 24 20 08 09 05 03 04 a0 /*Data 0*/ 24 20 08 09 05 03 04 a0 /*Data 1*/ 24 20 08 0a 05 03 04 a0 /*Data 2*/ 24 20 08 09 05 03 04 a0 /*Data 3*/ 24 1d 08 09 05 03 04 a0]; /*CLK lane*/ }; ``` > For example, ![](https://i.imgur.com/rwEU53g.png) The following part should be modified also: Path: *kernel/msm-3.18/arch/arm/boot/dts/qcom/msm8953-mtp.dtsi* ![](https://i.imgur.com/lfaJUTu.png) 3. Configure the Backlight. Path: kernel/msm-3.18/arch/arm/boot/dts/qcom/msm8953-mtp.dtsi ![](https://i.imgur.com/VBzDTcu.png) The GPIO to control pwm is, qcom,mdss-dsi-pwm-gpio = <&pm8953_mpps 4 0>; ![](https://i.imgur.com/GnlkRQM.png) Configure backlight type qcom,mdss-dsi-bl-pmic-control-type: a string that specifies the implementation of backlight control for this panel. "bl_ctrl_pwm" = Backlight controlled by PWM GPIO "bl_ctrl_wled" = Backlight controlled by WLED "bl_ctrl_dcs" = Backlight controlled by DCS commands(for OLED panel backlight controller) Others: Unknown backlight control. (default) #### Configure LK After the file panel_mydemo_1080p_video.h is generated, please copy it to the directory bootable/bootloader/lk/dev/gcdb/display/include/. Customers need to configure the LK to add a new panel. 1. Add several parameters to panel_mydemo_1080p_video.h to avoid compiling error. ![](https://i.imgur.com/MqY6gRA.png) ![](https://i.imgur.com/WB0FWTX.png) 2. Add the DSI PHY 2.0.0 timing config ![](https://i.imgur.com/KyjcKyR.png) 3. Add a new panel. Path: bootable/bootloader/lk/target/msm8953/oem_panel.c ![](https://i.imgur.com/fWyKDJP.png) ![](https://i.imgur.com/k8vpcJh.png) ![](https://i.imgur.com/GVywfuc.png) 4. Add new panel selection branch in function “init_panel_data”. ![](https://i.imgur.com/poPO2y6.png) 5. Choose to use the new panel in function “oem_panel_select”. The “panel_id” will be passed to kernel. ![](https://i.imgur.com/ovKM7CE.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully