Skip to content
Snippets Groups Projects
Commit ae2291fb authored by Timur Tabi's avatar Timur Tabi Committed by Andy Fleming
Browse files

fm-eth: add function fm_info_get_phy_address()


Function fm_info_get_phy_address() returns the PHY address for a given
Fman port.  This is handy when the MDIO code needs to fixup the Ethernet
nodes in the device tree to point to PHY nodes for a specific PHY address.

Signed-off-by: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarAndy Fleming <afleming@freescale.com>
parent 99abf7de
No related branches found
No related tags found
No related merge requests found
...@@ -154,6 +154,22 @@ void fm_info_set_phy_address(enum fm_port port, int address) ...@@ -154,6 +154,22 @@ void fm_info_set_phy_address(enum fm_port port, int address)
fm_info[i].phy_addr = address; fm_info[i].phy_addr = address;
} }
/*
* Returns the PHY address for a given Fman port
*
* The port must be set via a prior call to fm_info_set_phy_address().
* A negative error code is returned if the port is invalid.
*/
int fm_info_get_phy_address(enum fm_port port)
{
int i = fm_port_to_index(port);
if (i == -1)
return -1;
return fm_info[i].phy_addr;
}
/* /*
* Returns the type of the data interface between the given MAC and its PHY. * Returns the type of the data interface between the given MAC and its PHY.
* This is typically determined by the RCW. * This is typically determined by the RCW.
......
...@@ -110,6 +110,7 @@ void fman_enet_init(void); ...@@ -110,6 +110,7 @@ void fman_enet_init(void);
void fdt_fixup_fman_ethernet(void *fdt); void fdt_fixup_fman_ethernet(void *fdt);
phy_interface_t fm_info_get_enet_if(enum fm_port port); phy_interface_t fm_info_get_enet_if(enum fm_port port);
void fm_info_set_phy_address(enum fm_port port, int address); void fm_info_set_phy_address(enum fm_port port, int address);
int fm_info_get_phy_address(enum fm_port port);
void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus); void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus);
void fm_disable_port(enum fm_port port); void fm_disable_port(enum fm_port port);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment