Skip to content

Commit

Permalink
miiphy: Add function to retrieve MDIO bus list head
Browse files Browse the repository at this point in the history
In upcoming freescale board LX2160AQDS, the MDIO bus is muxed.
i.e. same MDIO bus can be routed to eight different slots depending
on mux register settings.

To support this mdio mux behavior, we add each MDIO bus mux as a
separate MDIO bus.

Now, various phy devices can be attached to each of these slots(mux).
The information about these devices is passed to OS via device tree.

To do the fdt fixups related to MDIO bus, its necessary that MDIO bus
list is accessed.Therefore, add a function to retrieve the list head.

Signed-off-by: Pankaj Bansal <[email protected]>
Acked-by: Joe Hershberger <[email protected]>
  • Loading branch information
pankajbansalnxp authored and jhershbe committed Oct 24, 2018
1 parent fb265a7 commit 9215bb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/miiphyutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ struct mii_dev *mdio_get_current_dev(void)
return current_mii;
}

struct list_head *mdio_get_list_head(void)
{
return &mii_devs;
}

struct phy_device *mdio_phydev_for_ethname(const char *ethname)
{
struct list_head *entry;
Expand Down
1 change: 1 addition & 0 deletions include/miiphy.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void miiphy_init(void);
int miiphy_set_current_dev(const char *devname);
const char *miiphy_get_current_dev(void);
struct mii_dev *mdio_get_current_dev(void);
struct list_head *mdio_get_list_head(void);
struct mii_dev *miiphy_get_dev_by_name(const char *devname);
struct phy_device *mdio_phydev_for_ethname(const char *devname);

Expand Down

0 comments on commit 9215bb1

Please sign in to comment.