SPI I2C Bridge Device Tree

Hi everyone,

I am designing a board with Ethernet and USB connected to MIO and between RGMII for the Ethernet PHY and ULPI for the USB PHY, there are no MIO pins left available to use for resetting the PHYs. I want to connect an I2C GPIO expander to the I2C available on J3 and then use that to drive the reset pins on the PHYs. I understand that the I2C buses on the connectors are connected to the I2C on the platform controller, and accessed by the Zynq by talking to the platform controller over SPI. What do I have to put in the device tree to be able to use the I2C on J3? I have looked at the device tree bindings for the PiSmasher, but the I2C nodes there seem to refer to the I2C controllers built-in to the Zynq. Is that right, or am I misunderstanding something? The motivation for this is that I want USB and Ethernet to work without having to program the PL.

Thanks,

Cameron

Hey Cameron,

Yeah, that’s a tricky one. One question/idea: Is selecting an Ethernet PHY that accepts I2C (or has an I2C mode) an option? If so, I believe you should be able to set those two MIO MDIO pins on J3 as I2C. Then you can hang your GPIO expander off that bus (shared with whatever other I2C devices are on there).

The only ‘gotcha’ there is the Linux Ethernet driver might need to be modified, but it shouldn’t require anything too insane (as far as Linux driver hacking goes).

Thoughts?

-Cousins

I totally forgot to mention the Ethernet PHY I am using. I am using the KSZ9031 from Microchip. I actually decided to move the Ethernet RGMII and MDIO signals to the PL on JA2 to make the routing easier, which frees up MIO pins for I2C.

Thanks for the suggestion though :slight_smile:

Cameron