cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gemlau@ida
Visitor
Visitor
436 Views
Registered: ‎05-07-2018

MACB driver with fixed-link and without MDIO

Dear all,

I was wondering why the "macb_mii_init" function initializes the macb internal MDIO interface, independent if a fixed-link/ fixed_phy is used.

https://github.com/Xilinx/linux-xlnx/blob/master/drivers/net/ethernet/cadence/macb_main.c

As far as I understand, the fixed_phy emulates an MDIO bus so any MDIO access should be handled there. As an example, a call of mii_bus->read() should be handled by fixed_mdio_read() and macb_mdio_read() will not be called at all.

https://github.com/Xilinx/linux-xlnx/blob/master/drivers/net/phy/fixed_phy.c

So in macb_mii_init it should be able to handle fixed_phy even before the management port is enabled.

Best,
Kai

Tags (3)
0 Kudos
3 Replies
nanz
Moderator
Moderator
354 Views
Registered: ‎08-25-2009

Hi gemlau@ida ,

You should be able to use fixed-link without MDIO:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841740/Macb+Driver


-------------------------------------------------------------------------------------------

Don’t forget to reply, kudo, and accept as solution.

If starting with Versal take a look at our Versal Design Process Hub and our Versal Blogs and our Versal Ethernet Sticky Note.

-------------------------------------------------------------------------------------------
0 Kudos
gemlau@ida
Visitor
Visitor
326 Views
Registered: ‎05-07-2018

Hi,

yes, I've tried setting the fixed-link and phy-mode="moca" but that's not what the driver actually does.

I can still see that the driver enables the management port in macb_mii_init() (line 781)

macb_writel(bp, NCR, MACB_BIT(MPE));

and allocates an mii bus struct (line 783-795).

 

The first test for a fixed-link is in macb_mdiobus_register (line 754). But although this is recognized as a fixed link, it calls mdiobus_register() on the alocated mdio bus. This schould in my oppinion be covered by the fixed_phy module.

 

I think it would be better to check for the fixed-link right at the beginning of the macb_mii_init() function.

 

Best,
Kai

0 Kudos
nanz
Moderator
Moderator
271 Views
Registered: ‎08-25-2009

Hi gemlau@ida ,

Yes, I get your point. I will bring this up with our engineering team for enhancement request. 


-------------------------------------------------------------------------------------------

Don’t forget to reply, kudo, and accept as solution.

If starting with Versal take a look at our Versal Design Process Hub and our Versal Blogs and our Versal Ethernet Sticky Note.

-------------------------------------------------------------------------------------------
0 Kudos