Skip to content

Commit

Permalink
net: macb: ignore tx_clk if MII is used
Browse files Browse the repository at this point in the history
If the MII interface is used, the PHY is the clock master, thus don't
set the clock rate. On Zynq-7000, this will prevent the following
warning:
  macb e000b000.ethernet eth0: unable to generate target frequency: 25000000 Hz

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20210120194303.28268-1-michael@walle.cc
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Michael Walle authored and Jakub Kicinski committed Jan 22, 2021
1 parent 1903852 commit 43e5763
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/cadence/macb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ static void macb_set_tx_clk(struct macb *bp, int speed)
if (!bp->tx_clk || (bp->caps & MACB_CAPS_CLK_HW_CHG))
return;

/* In case of MII the PHY is the clock master */
if (bp->phy_interface == PHY_INTERFACE_MODE_MII)
return;

switch (speed) {
case SPEED_10:
rate = 2500000;
Expand Down

0 comments on commit 43e5763

Please sign in to comment.