2010-01-29 10:07:37     PHY integration with bfin_mac driver

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2010-01-29 10:07:37     PHY integration with bfin_mac driver


Message: 85330   


In integrating the 2009R1.1-RC4 tag of uClinux, I have run into an issue with

the bfin_mac driver.


I have a BF537 device with a switch device at the end of the MII bus.  The

switch device does not have a single PHY device but instead has 5 PHY devices

that are assigned to the 5 physical port devices on the switch.  In addition

there are many registers that define the behavior of the switch and how it

segments its VLANs.  All of these registers are set via the mdio bus.


When I install the bfin_mac driver, the driver calls the mii_probe function that

queries all kinds of registers on the switch device.  Through serendipity, the

mii probe resolves to a PHY resident on the switch device.  From using the ID

returned by the PHY, I am able to install a PHY driver to perform my desired

register configuration.


Is it possible that I can explicitly specify the PHY device resident instead of

performing the probing scheme?  If not now, will this be possible in the future?





Doug Bailey




2010-01-29 10:15:56     Re: PHY integration with bfin_mac driver

Mike Frysinger (UNITED STATES)

Message: 85333   


i believe there's a bug report about this, but in the mean time, you'll have to edit:





2010-01-31 23:36:59     Re: PHY integration with bfin_mac driver

Sonic Zhang (CHINA)

Message: 85383   


You can develop a dsa switch driver and config different phy as a vitual different ethernet port.








2010-02-01 12:23:08     Re: PHY integration with bfin_mac driver


Message: 85424   


Is there a link to documentation on how DSA packets are tagged?  I have not found a document oin the Documentation directory that helps me determine how the DSA tags are handled.


From what I can gether from the source, the ethertype for DSA tagged packets are set to something different from 0x8100.  This would imply that my switch would need to know how to handle tags that start with something other than the VLAN tag field.  Or am I missing something in how DSA tags are added/removed from packets?






2010-02-01 23:41:37     Re: PHY integration with bfin_mac driver

Sonic Zhang (CHINA)

Message: 85441   


Yes, your switch need to support special hardware tag/utag head similar as 802.1q head in order to emulate virtual ethernet ports and dispatch packet to corresponding switch ports . Please refer to the spec of ksz8893 data sheet.




2010-02-03 11:49:33     Re: PHY integration with bfin_mac driver


Message: 85541   


I am trying to take the switch on the end of my MII bus and segment so that one physical port is the WAN port and the remaining 4 ports are a LAN switch.  I can easily do this with VLAN configuration within the switch.  In looking at the DSA architecture, I see the following issues impeding this.


The DSA tag uses a unique ethertype for each port that is configured.  This prevents the switch from using its VLAN capability to switch between ports meaning that I will have to perform bridging within the CPU.


I also have issues with the ethertype values that are used by the DSA as my switch (an Infineon Samurai) cannot implement a special tag for each of the physical ports.


I also noticed that the blackfin mac driver is still installing a generic phy driver and probes the switch.  Since I already need to provide a custom PHY driver, it appears that using VLAN configuration set up by a custom PHY driver works better for my application.






2010-02-03 13:48:13     Re: PHY integration with bfin_mac driver


Message: 85549   




The Phy driver should be controlled by your Kconfig. We just select PHYLIB, not which specfic phy is used. Have a look under "PHY Device support and infrastructure".






2010-02-03 22:26:56     Re: PHY integration with bfin_mac driver

Sonic Zhang (CHINA)

Message: 85565   


DSA framework is not designed for your use case. It is used to emulate virtual ethernet ports via one physical MAC.


If the only purpose in your case is to attach the MAC to a given phy device, you can define the expected phy_id in the bfin_mac platform data and check its activity in mii_probe phy search loop. The probe function should be changed accordingly.