aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/fm
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2022-04-07 00:33:01 +0200
committerRamon Fried <ramon@neureality.ai>2022-04-10 08:44:12 +0300
commit123ca114e07ecf28aa2538748d733e2b22d8b8b5 (patch)
tree0a5481e51e4e50b33daf4d10f37574f6f797b04f /drivers/net/fm
parent9c06b4815ce1d663085c214133762614bba79fbe (diff)
downloadu-boot-123ca114e07ecf28aa2538748d733e2b22d8b8b5.zip
u-boot-123ca114e07ecf28aa2538748d733e2b22d8b8b5.tar.gz
u-boot-123ca114e07ecf28aa2538748d733e2b22d8b8b5.tar.bz2
net: introduce helpers to get PHY interface mode from a device/ofnode
Add helpers ofnode_read_phy_mode() and dev_read_phy_mode() to parse the "phy-mode" / "phy-connection-type" property. Add corresponding UT test. Use them treewide. This allows us to inline the phy_get_interface_by_name() into ofnode_read_phy_mode(), since the former is not used anymore. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Diffstat (limited to 'drivers/net/fm')
-rw-r--r--drivers/net/fm/eth.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index 5e0d0bc..1ffe9e2 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -954,17 +954,6 @@ int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info)
return 0;
}
#else /* CONFIG_DM_ETH */
-#ifdef CONFIG_PHYLIB
-phy_interface_t fman_read_sys_if(struct udevice *dev)
-{
- const char *if_str;
-
- if_str = ofnode_read_string(dev_ofnode(dev), "phy-connection-type");
- debug("MAC system interface mode %s\n", if_str);
-
- return phy_get_interface_by_name(if_str);
-}
-#endif
static int fm_eth_bind(struct udevice *dev)
{
@@ -1038,7 +1027,7 @@ static int fm_eth_probe(struct udevice *dev)
reg = (void *)(uintptr_t)dev_read_addr(dev);
fm_eth->mac_type = dev_get_driver_data(dev);
#ifdef CONFIG_PHYLIB
- fm_eth->enet_if = fman_read_sys_if(dev);
+ fm_eth->enet_if = dev_read_phy_mode(dev);
#else
fm_eth->enet_if = PHY_INTERFACE_MODE_SGMII;
printf("%s: warning - unable to determine interface type\n", __func__);