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.

Linux/AM3352: I2C Slave address setting

Part Number: AM3352

Tool/software: Linux

Hi .

 

Good day.

I’m the TI SW FAE Rio.

 

We have a customer want to have this topology:

  1. 3 pcs of AM335 , let’s say A/B/C.
  2. A will be the I2C Master.
  3. B/C will be the I2C Slave.
  4. Our question:

How to set the different I2C Slave onto B + C?

 

We have studied some materials like below.

  1. Do we need to change the “val” in the I2C_SLAVE_READ_REQUESTED in the i2c-slave-eeprom.c?
  2. Or we can change the value of this OMAP_I2C_STAT_AAS in the i2c-omap.c?

 

 

BR Rio

  • Hello Rio,

    It looks like the i2c-omap driver is for I2C master mode only. Please take a look at the links in Pavel's answer in the post AM335x I2C Slave Driver.

    Regards,

    Nick

  • Hi Nick:

    #1. i have read your post regarding the 4 links you point as above.
    However, there is no recently implement on the current SDK release.

    #2. We have checked the TI Linux SDK on the 5.xx version , there is "I2C_Slave" config indeed.
    So, I think if we open it, the I2C Slave will be activate.
    Can you double confirm this?

    #3. Following #2, can you tell us how to change the I2C Address on the I2C_Slave site?

    In short, if we want to assign the I2C address on B & C device (see my original post).

    Do we need to change the “val” in the I2C_SLAVE_READ_REQUESTED in the i2c-slave-eeprom.c?
    Or we can change the value of this OMAP_I2C_STAT_AAS in the i2c-omap.c?

    Thanks.

    BR Rio
  • Hello Rio,

    I might be missing something. Where are you finding "I2C_Slave" config?

    You can find a description of the Linux i2c slave interface here: www.kernel.org/.../slave-interface

    The AM335x hardware is capable of being an I2C slave. that is why you see AAS defined in i2c-omap.c. But that does not mean it has been enabled in software.

    i2c-slave-eeprom is only a software backend. We still need the bus driver itself to support acting as an i2c slave. I do not see anything in the i2c-omap driver to indicate that TI has added functionality to the driver that allows the software to act as an i2c slave. Running "git log drivers/i2c/busses/i2c-omap.c" also does not yield any commits that claim to add i2c slave support for the bus driver.

    Regards,
    Nick
  • Hi Nick:

    Many Thanks for your detail explanation.

    ==>Where are you finding "I2C_Slave" config
    (Rio: I look up it from the ".config", so, I think if we enable it, then, the I2C driver will be activated as Slave mode".

    If our customer needs to have the I2C slave in the current 5.0 Release sdk,
    What's the extra work that we need to do and follow up.

    May you tell us the detail steps thus we can implement here?

    BR Rio
  • Hi Nick:

    Will this patch work for I2C Slave?

    ==>
    patchwork.kernel.org/.../


    BR Rio
  • Hello Rio,

    It does not look like that request for comment patch (RFC) was ever upstreamed. Look at the discussion in that patch and the e2e posts that Matthijs linked for more discussion on whether the patch would get i2c slave working without bugs on AM335x.

    Regards,
    Nick
  • Hello Rio,

    I was able to track down the internal discussion on that RFC. Ravikumar stopped development of i2c slave because of the hardware complications brought up in your link. So no, that patch would not provide fully featured i2c slave support as-is.

    It might be possible that the patch could be modified to provide partial i2c slave support for your customer. But I would not be able to support their driver development if they decided to try to get i2c slave working. They would need to consider the points brought up in that RFC and decide what they were going to do from there.

    Regards,
    Nick