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.

BEAGLEBK: I2C Slave device

Part Number: BEAGLEBK

Hello

I want to make the beaglebone black an i2c slave for my raspberry pi as the master. I am familiar with creating simple character drivers and i know a little bit about
instantiating devices on the device tree. I was wondering if someone could help me out. I have done some researching on the topic but im not sure that it will work the way i want it to.

I started off with the device tree which i plan to implement as an overlay and insert it in the /boot/uEnv.txt
My device tree currently looks like this:

i2c_bbs@29{
compatible = "fn,i2c_bbs";
reg = <0x29>;
#address-cells = <1>;
#size-cells = <0>;
};

The unit address of the device tree matches the address the bbb will have on the i2c bus. I've been checking out device tree binding on:


https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/devicetree/bindings/i2c/i2c.txt


and i noticed that some device trees include interrupts and interrupt parent properties. However i am not sure what interrupts will be used for slave i2c on the beaglebone black.

I would also like to include the clock-frequency parameter and set it to 100000 but ive been reluctant to do so since im not sure which clock to reference. An example online has
the following:

clock-names = "skel-i2c";
clocks = <&clkc 38>;

but for my particular case I'm not sure what clock node i should reference or what the number 38 means.

As for the i2c device driver i am still researching how to write one for a slave client. I believe that i may have found some that may be usefull but im not sure if they are
exactly what im looking for. It would help out alot if someone could see if these could be any use:

elixir.bootlin.com/.../i2c-designware-slave.c

github.com/.../i2c-core-slave.c

I just need some guidance so i know I'm on the right track in creating an slave i2c driver that will actually work for the beaglebone black. Any help with this will be greatly
appreciated. Thank you.