How to handle software controlled bus switches in the device tree?

David Daney ddaney at caviumnetworks.com
Thu Apr 7 02:08:12 EST 2011


I have some boards that have I2C controlled switches that are used to 
control the connection of Ethernet PHY devices to their MDIO busses.

There are two MDIO busses, and the PHY can be attached to one or the 
other based on the setting of the switch.

I can describe the presence of the switch on the I2C bus, but boot 
software or an operating system needs to set the switch to realize a 
PHY/MDIO bus topology.

Currently we are hard-coding the switch initialization in the bootloader 
and then assuming a fixed PHY topology based on that initialization.

It would be nice to somehow be able to specify the configuration in the 
device tree, but there are some dependencies.

The I2C bus and switch driver would have to be initialized to set the 
switches to the proper values before the MDIO/PHY drivers were started.

Any ideas about how to approach this problem?

Thanks in advance,
David Daney



More information about the devicetree-discuss mailing list