mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 21:09:25 -04:00
net: stmmac: rk: add get_interfaces() implementation
RK platforms support RGMII and/or RMII depending on the SoC. Detect whether support for a SoC exists by whether the interface specific set_to functions have been populated, and set the appropriate bits in phylink's bitmap of interfaces. This assumes all dwmac interfaces on a SoC have identical support, but it should be noted that this is not true for RK3528 which only supports RGMII on GMAC1. However, the existing code structure permits RGMII to be configured on GMAC0 without complaint, so preserve this behaviour even though it is incorrect to avoid functional change. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/E1uPk2j-004CF6-Mf@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
d4d4126fc5
commit
1f59e30403
@@ -1864,6 +1864,18 @@ static void rk_gmac_powerdown(struct rk_priv_data *gmac)
|
||||
gmac_clk_enable(gmac, false);
|
||||
}
|
||||
|
||||
static void rk_get_interfaces(struct stmmac_priv *priv, void *bsp_priv,
|
||||
unsigned long *interfaces)
|
||||
{
|
||||
struct rk_priv_data *rk = bsp_priv;
|
||||
|
||||
if (rk->ops->set_to_rgmii)
|
||||
phy_interface_set_rgmii(interfaces);
|
||||
|
||||
if (rk->ops->set_to_rmii)
|
||||
__set_bit(PHY_INTERFACE_MODE_RMII, interfaces);
|
||||
}
|
||||
|
||||
static int rk_set_clk_tx_rate(void *bsp_priv_, struct clk *clk_tx_i,
|
||||
phy_interface_t interface, int speed)
|
||||
{
|
||||
@@ -1919,6 +1931,7 @@ static int rk_gmac_probe(struct platform_device *pdev)
|
||||
plat_dat->tx_fifo_size = 2048;
|
||||
}
|
||||
|
||||
plat_dat->get_interfaces = rk_get_interfaces;
|
||||
plat_dat->set_clk_tx_rate = rk_set_clk_tx_rate;
|
||||
|
||||
plat_dat->bsp_priv = rk_gmac_setup(pdev, plat_dat, data);
|
||||
|
||||
Reference in New Issue
Block a user