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.

J721EXSOMXEVM: Interfacing EEPROM using I2C

Part Number: J721EXSOMXEVM
Other Parts Discussed in Thread: CDCE6214, USB2ANY

Hello,

  1. Could you please let me know where in J721e Linux can I find the list of API to interface EEPROM via I2C?
  2. What is the EEPROM address on I2C bus on J721e EVM?

Also could you let me know the API associated for these action

  • Initialize I2C communication with EEPROM address.
  • Select EEPROM page to commit.
  • Read EEPROM from a specific address.
  • Write EEPROM from  a specific address.
  • Write EEPROM page.
  • Read EEPROM page.
  • Lock & Unlock EEPROM.

Thank you,

Satish

  • Hi Satish,

    May i know the use case details. What is the exact intent here? Writing EEPROM is not done.
    So i want to understand your use case before i start digging into what can be done.

    Best Regards,
    Keerthy

  • Hi Keerthy,

    We have a clock generator chip i.e. CDCE6214 Q1 which is connected to J7 board over main_i2c5. 

    In order to enable the clock we have to program this clock chip. Programming involves writing bunch of registers, these registers are mapped to EEPROM so there are instructions for EEPROM page commit, Unclock /lock EEPROM etc.

    The exact programming sequence is as follows:

    1. Write from R85 to R0. It is important to write R0 at last.
    2. Select the EEPROM page to commit to. Since pin pin HW_SW_CTRL = high, write 0x0003 0200
    3. Unlock EEPROM. Write 0x000F 5037
    4. Start register commit. Since pin HW_SW_CTRL = high, write 0x0003 0600
    5. Wait for 200ms. Keep reading back R7 until R7[5] = 0. This means that EEPROM programming is done.
    6. Re-lock EEPROM. Write 0x000F A037

    In order to achieve this I wanted to know the API in Linux to interface EEPROM over I2C which can allow me to perform this programming. Hope this helps.

    Thanks,

    Satish

  • CDCE6214

    I will check internally but i am not sure if this is the closest driver that can be used for the above part:
    drivers/clk/clk-cdce925.c

    Can you take a look at that ?

    Best Regards,
    Keerthy

  • Hi Keerthy,

    I looked at that Driver code and unfortunately, it won't serve our full purpose. The resister it sets will likely enable the clock however our need is also to enable AVB audio from this clock chip.

    Meantime I checked with CDCE6214 Interface team and they suggested to tool call USB2Any (usb to I2C adapter board) to probe the I2C pins of this clock and write those registers directly from PC. This tool will serve our purpose. We are most likely going to stick with this tool.