[U-Boot] phy device driver issues
Aaron Williams
Aaron.Williams at cavium.com
Wed Oct 10 10:10:53 CEST 2012
Hi,
I haven't been following the list closely for a while but I have run
into some issues when writing some drivers for some non-standard PHY
devices.
One PHY I am supporting is the Cortina CS4321 device. This PHY can be
configured in various modes such as XAUI, RXAUI, SGMII, and several FC
implementations. My problem is that this PHY does not follow any of the
standards as far as register usage and it requires a significant amount
of configuration to make it work, including downloading firmware into
the device.
One problem I have is that phy_connect ends up calling the probe
function before phy_device has had the dev field connected. This is a
problem because the easiest way for me to tell is by looking at
information associated with the Ethernet device which we pull from the
device tree. I reordered the code in phy_connect so it hooks up the
Ethernet device to phy_device before calling reset, though ideally that
information should be present when probe is called.
In my driver, I created a call-back function in order to determine
what mode the PHY should operate in, but in order for the callback
function to know it needs to know what Ethernet device it is connected to.
Both probe and reset are called before this information is available.
Another issue I have is that since the Cortina CS4321 uses non-standard
registers, get_phy_id() does not work. In our tree I just declared the
function as weak but I don't think this is a good long-term solution.
Ideally device tree support should be integrated more deeply into U-Boot
so each PHY device would have its node offset stored like in the Linux
driver.
-Aaron
--
Aaron Williams
Software Engineer
Cavium, Inc.
(408) 943-7198 (510) 789-8988 (cell)
More information about the U-Boot
mailing list