This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SN65DSI86: sn65dsi86:How to read/write the panel from i2c over aux?

Part Number: SN65DSI86


Tool/software:

Hi Sir,

We want to use i2c over aux to read and write the panel,and I've tried to enable the IOA(direct mode) as below code,but I don't know how to read and write the panel by sn65dsi driver.Could you please tell me how to do i2c read/write for the panel?

enable IOA code:

sn65dsi86_write(client,EDP_I2C_ADDR,0x60,0xA1);EDP_I2C_ADDR=0x2c
Could you please take the EDID read as example and give me the sample code?
EDID commands:
Thanks
  • Hi Haibin, 

    Is this being tested on the customer's board or a TI EVM? Did the customer provide any info about I2C over aux on this board?

    This previous E2E has some info about aux communication using the aardvark: https://e2e.ti.com/support/interface-group/interface/f/interface-forum/949449/sn65dsi86-i2c-over-aux-direct-method

    Best regards,
    Ikram

  • Hi Ikram,

    Thanks for your replying.

    Our project is on PVT Stage and produce many many devices,and found the white display problem,So we need to upgrade Tcon code of panel by i2c-over-aux,we find the DSI86 support IOA,but we don't know how to use DSI86 driver to  implement it.

    I've see the script that you provided,but we don't know how to implement it?

    Could you please take a read EDID as a example and give us the sample code?

    Thanks.

  • Hi Haibin,

    The script shows shows reading EDID. 0x2D is the address of the DSI bridge, and 0xA1 is written to register 0x60. Then the EDID from address 0x50 can be read. In the last line, 256 bytes are read from the EDID.

    The script was for Aardvark I2C adapter. Please change the syntax to that of your driver and read EDID the same way.

    <aardvark>
    <configure i2c="1" spi="1" gpio="0" tpower="1" pullups="0" />
    <i2c_bitrate khz="100" />
    ======Enable I2C_ADDR_CLAIM1======
    <i2c_write addr="0x2D" count="1" radix="16">60 A1</i2c_write> />
    ======Write EDID base of 00 ======
    <i2c_write addr="0x50" count="0" radix="16">00</i2c_write> />
    ======Read 256 bytes of EEID======
    <i2c_read addr="0x50" count="256" radix="16">00</i2c_read> />
    </aardvark>


    Best regards,
    Ikram

  • Hi Ikram,

    I've tried the below code,but we can't get the EDID,Could you please check below code (direct method and indirect method)?

    Thanks

    void i2c_over_aux_get_edid(struct i2c_client *client)

    {
    u8 buf[16][16] = {0};
    int i,j;
    pr_err("zhang i2c_over_aux_get_edid\n");
    #if 0 //direct
    //enable i2c over aux
    sn65dsi86_write(client,EDP_I2C_ADDR,0x60,0xA1);
    mdelay(20);
    sn65dsi86_write(client,EDP_I2C_ADDR,0x40,0x00);
    for (i = 0;i <=0XFF;i++)
    {
      sn65dsi86_write(client,EDP_I2C_ADDR,0x50,0x00);
      sn65dsi86_write(client,EDP_I2C_ADDR,0x50,0x00);
      buf[i] = sn65dsi86_read(pSn65dsi86_data->client, EDP_I2C_ADDR, i);
    }
    //sn65dsi86_write(client,EDP_I2C_ADDR,0x50,0x00);
    pr_err("zhang EDID is :\n");
    for (i = 0; i <= 0xFF;i++)
    {
      printk("%02x ",buf[i]);
    }
    #else //indirect
    //4 50 00
    sn65dsi86_write(client,EDP_I2C_ADDR,0x78,0x40);
    sn65dsi86_write(client,EDP_I2C_ADDR,0x76,0x50);
    sn65dsi86_write(client,EDP_I2C_ADDR,0x77,0x00);
    //set send bit
    sn65dsi86_write(client,EDP_I2C_ADDR,0x78,0x41);
    //enable send_int_en and IRQ_EN
    sn65dsi86_write(client,EDP_I2C_ADDR,0xE5,0x01);
    sn65dsi86_write(client,EDP_I2C_ADDR,0xE0,0x01);
    //4 50 01
    sn65dsi86_write(client,EDP_I2C_ADDR,0x78,0x40);
    sn65dsi86_write(client,EDP_I2C_ADDR,0x76,0x50);
    sn65dsi86_write(client,EDP_I2C_ADDR,0x77,0x01);
    sn65dsi86_write(client,EDP_I2C_ADDR,0x64,0x00);
    //set send bit
    sn65dsi86_write(client,EDP_I2C_ADDR,0x78,0x41);
    //enable send_int_en and IRQ_EN
    sn65dsi86_write(client,EDP_I2C_ADDR,0xE5,0x01);
    sn65dsi86_write(client,EDP_I2C_ADDR,0xE0,0x01);
    //5 50 00
    sn65dsi86_write(client,EDP_I2C_ADDR,0x78,0x50);
    sn65dsi86_write(client,EDP_I2C_ADDR,0x76,0x50);
    sn65dsi86_write(client,EDP_I2C_ADDR,0x77,0x00);
    //set send bit
    sn65dsi86_write(client,EDP_I2C_ADDR,0x78,0x41);
    //enable send_int_en and IRQ_EN
    sn65dsi86_write(client,EDP_I2C_ADDR,0xE5,0x01);
    sn65dsi86_write(client,EDP_I2C_ADDR,0xE0,0x01);
    for (i = 0; i < 16; i++)
    {
      //s13
      //5 50 10
      sn65dsi86_write(client,EDP_I2C_ADDR,0x78,0x50);
      sn65dsi86_write(client,EDP_I2C_ADDR,0x76,0x50);
      sn65dsi86_write(client,EDP_I2C_ADDR,0x77,0x10);
      //set send bit
      sn65dsi86_write(client,EDP_I2C_ADDR,0x78,0x41);
      //enable send_int_en and IRQ_EN
      sn65dsi86_write(client,EDP_I2C_ADDR,0xE5,0x01);
      sn65dsi86_write(client,EDP_I2C_ADDR,0xE0,0x01);
      //read 16 bytes data
      buf[i][0] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x79);
      buf[i][1] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x7A);
      buf[i][2] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x7B);
      buf[i][3] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x7C);
      buf[i][4] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x7D);
      buf[i][5] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x7E);
      buf[i][6] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x7F);
      buf[i][7] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x80);
      buf[i][8] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x81);
      buf[i][9] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x82);
      buf[i][10] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x83);
      buf[i][11] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x84);
      buf[i][12] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x85);
      buf[i][13] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x86);
      buf[i][14] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x87);
      buf[i][15] = sn65dsi86_read(client, EDP_I2C_ADDR, 0x88);
    }
    //1 50 00
    sn65dsi86_write(client,EDP_I2C_ADDR,0x78,0x10);
    sn65dsi86_write(client,EDP_I2C_ADDR,0x76,0x50);
    sn65dsi86_write(client,EDP_I2C_ADDR,0x77,0x00);
    //set send bit
    sn65dsi86_write(client,EDP_I2C_ADDR,0x78,0x41);
    //enable send_int_en and IRQ_EN
    sn65dsi86_write(client,EDP_I2C_ADDR,0xE5,0x01);
    sn65dsi86_write(client,EDP_I2C_ADDR,0xE0,0x01);
    pr_err("zhang EDID is :\n");
    for (i=0;i<16;i++)
      for (j=0;j<16;j++)
      pr_err("%02x ",buf[i][j]);
    #endif
    }
  • //sn65dsi86_write(client,EDP_I2C_ADDR,0x50,0x00);
    pr_err("zhang EDID is :\n");
    for (i = 0; i <= 0xFF;i++)
    {
      printk("%02x ",buf[i]);
    }

    What is the step here? The device address is 0x2D, and EDID target address is 0x50. The procedure for reading EDID is to read from target address 0x50 (EDID) starting register 0x00 register to 0xFF. 

    - Ikram

  • Hi Ikram,

    This code maybe is wrong because we don't understand the script completely.

    Could you please check whether below code(direct method) is right?

    sn65dsi86_write(client,EDP_I2C_ADDR,0x60,0xA1);

    //read EDID

    for (i = 0;i <=0XFF;i++)
    {
      buf[i] = sn65dsi86_read(pSn65dsi86_data->client,0x50, i);
    }
    Thanks
  • Hi Ikram,

    I have tested above code(direct method) that can read EDID.

    Could you please check why we can't get the edid by indirect method?Indirect code is below "#else //indirect".

    Thanks

  • Hi Haibin,

    If the direct method is working, and the source/SoC device supports clock stretching, then we would recommend just using the direct method to read EDID. If not, then we can look further into the script sequence.

    - Ikram

  • Hi  Ikram,

    I'm afraid of the direct method can't working well for ugrading the Tcon Code,so we want to you check the indrect method,if indrect method can workding well,we can use it instead direct method.

    so,could you please check my indirect method code as the last last coments?

    By the way,how to check whether "source/SoC device supports clock stretching"?

    Thanks

  • Hello, 

    Due to US public holiday on Friday 4/18/25, support will resume on Monday. Thank you for your patience. 

    Regards, 

    Logan

  • Hi Haibin,

    Previously you mentioned that direct method is working. Is it working consistently?

    It should be mentioned in the SoC/source/GPU datasheet whether clock stretching over I2C is supported. 


    For indirect method, do the following:

    1. clear register 0xF4 first. Write register 0xF4 = 0xFF

    2. Make sure 0xF4 is cleared: Read register 0xF4

    3. Program AUX_CMD = 0x4, by writing:

            - register 0x78 = 0x40

            - register 0x76 = 0x50

            - register 0x77 = 0x0
    4. Send, by writing register 0x78 = 0x41

    5. Make sure SEND_INT is set with no errors. Read register 0xF4

    6. Make sure send bit is cleared. Read register 0x78


    I attached the script below from a previous thread for the indirect method steps with the Aadvark adapter. Could you please check that this is working, and then continue with the rest of the steps.

    If the direct method is working, we would still recommend it to simplify the steps.

    Best regards,
    Ikram





    <aardvark>

    <configure i2c="1" spi="1" gpio="0" tpower="1" pullups="1" />

    <i2c_bitrate khz="100" />

    ======Clear Register 0xF4======

    <i2c_write addr="0x2D" count="1" radix="16">F4 FF</i2c_write> />

    ======Make sure register 0xF4 is cleared======

    <i2c_write addr="0x2D" count="0" radix="16">F4</i2c_write> />

    <i2c_read addr="0x2D" count="1" radix="16">00</i2c_read> />

    ======Program AUX_CMD=0x4======

    <i2c_write addr="0x2D" count="1" radix="16">78 40</i2c_write> />

    <i2c_write addr="0x2D" count="1" radix="16">76 50</i2c_write> />

    <i2c_write addr="0x2D" count="1" radix="16">77 00</i2c_write> />

    ======Send======

    <i2c_write addr="0x2D" count="1" radix="16">78 41</i2c_write> />

    ======Make sure SEND_INT is set and no errors======

    <i2c_write addr="0x2D" count="0" radix="16">F4</i2c_write> />

    <i2c_read addr="0x2D" count="1" radix="16">00</i2c_read> />

    ======Make sure SEND bit is cleared======

    <i2c_write addr="0x2D" count="0" radix="16">78</i2c_write> />

    <i2c_read addr="0x2D" count="1" radix="16">00</i2c_read> />

    </aardvark>

    Use an I2C analyzer, both register 0xF4 and 0x78 are read back correctly.





  • Hi  Ikram,

    Thanks for your supporting.

    I've tested the indirect method can work on one project,but it can't work on another project,I'm checking the differences these two projects.

  • Hi Ikram,

    By the way,what's mean below code?

    ======Write EDID base of 00 ======
    <i2c_write addr="0x50" count="0" radix="16">00</i2c_write> />

     

  • Hi Haibin,

    These two lines are for read operation. It starts reading from address 0x50 starting 0x00, and for 256 bytes. For reading I2C, this has a two step, write and read operations. 

    FOr your system, depending on how it is sent, you could just read from the address and register in one line operation.

    ======Write EDID base of 00 ======
    <i2c_write addr="0x50" count="0" radix="16">00</i2c_write> />
    ======Read 256 bytes of EEID======
    <i2c_read addr="0x50" count="256" radix="16">00</i2c_read> />

    Best regards,
    Ikram

  • Hi Ikram,

    We met i2c error when we read EDID of NG device,and found the device has no ack. We catch the wave and find the AUX P/N are swapped on NG device compare to the Normal device.Could you please tell us how to swap AUXP and AUXN by setting registers of DSI86?

    Also, as you know,we can get EDID on one project and can't get it on another project,Could you have any debug way?

    we find sometimes the 0xF4=9 and 0x78 send bit can't be clear.

    Thanks

  • Hi Ikram,

    We've just tested  the Tcon code that it swapped the AUXP and AUXN can get the EDID.

  • Hi Ikram,

    Could you please help us check why  AUXP and AUXN has swapped and how to swap them by set registers of DSI86?

    Thanks

  • Hi Haibin,

    1. Could you share the waveforms of what is captured and how they are different between working and not-working boards? Please also share the schematic, including AUX channel throughout the link. Please check AUX channel components and connections for both this device (source) and sink (display/ receiver).

    The AUX connections should be set according to DP/eDP implementation on both source and sink schematics.






    2. In the not-working boards, what are the issues seen currently?

    Are all the boards built identical or is there any differences such as different display, different eDP/DP sink, etc?




    3.SN65DSI86 can only swap the polarity of the data lanes, not the aux channel. So there is no register setting to invert the polarity.

    Best regards,
    Ikram


  • 1.Above is the NG and OK waveforms.

    Below is the schematic,

    2. In the not-working boards, what are the issues seen currently?

    Are all the boards built identical or is there any differences such as different display, different eDP/DP sink, etc?

    ---->The NG board can display normal,but when I send the read EDID commands,the dmesg log show the device(0x50) has no ACK。

  • Hi Ikram,

    Sorry,I can't upload the all pictures because my pc can't work well.

    I'll upload the NG waveform after my PC can work again.

    The NG waveform is opposite to OK waveform,that means the voltage level is high on the OK waveform but it is low on the NG waveform.

    Thanks

  • Hi Ikram,

    From the typical application, why AUX_N of the Figure9-2 1080P  panel doesn't need the pull up? Our project is also the 1080P panel and AUX_N is pull up 3.3V.

  • Hi Haibin,

    Is your panel a DP or eDP configuration? That would determine which components (AC-capacitors, pull-up and pull-down resistors) are required for the AUX channel. The Figures 9-1 and 9-2 from the datasheet are different for DP and eDP implementations. 


    On the DP/eDP sink (display) which received the DP main link and AUX, what components are added there? Please share that portion of the schematic and the waveforms for NG cases.

    Thank you,
    Ikram

  • Hi Ikram,

    Okay,I see.There is no problem at present.

    Thank you for your supporting.