Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: starfive: convert to use phy_interface

dwmac-starfive uses RMII or RGMII interface modes without any PCS,
and selects the dwmac core accordingly using a register field with
the same bit encoding as the core's phy_intf_sel_i signals.

None of the DTS files set "mac-mode", so mac_interface will be
identical to phy_interface.

Convert dwmac-starfive to use phy_interface when determining the
interface mode rather than mac_interface. Also convert the error
prints to use phy_modes() so that we get a meaningful string rather
than a number for the interface mode.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1uytpa-00000006H2X-3GWx@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
6cb2b69c de696c63

+3 -3
+3 -3
drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
··· 38 38 unsigned int mode; 39 39 int err; 40 40 41 - switch (plat_dat->mac_interface) { 41 + switch (plat_dat->phy_interface) { 42 42 case PHY_INTERFACE_MODE_RMII: 43 43 mode = STARFIVE_DWMAC_PHY_INFT_RMII; 44 44 break; ··· 51 51 break; 52 52 53 53 default: 54 - dev_err(dwmac->dev, "unsupported interface %d\n", 55 - plat_dat->mac_interface); 54 + dev_err(dwmac->dev, "unsupported interface %s\n", 55 + phy_modes(plat_dat->phy_interface)); 56 56 return -EINVAL; 57 57 } 58 58