Skip to content

Commit

Permalink
arch/risc-v/src/mpfs/mpfs_ethernet.c: Remove unnecessary phyinit
Browse files Browse the repository at this point in the history
mpfs_phyinit() was called twice during ifup().

Signed-off-by: Jani Paalijarvi <[email protected]>
  • Loading branch information
jpaali committed Aug 29, 2024
1 parent 96fb224 commit a31689c
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions arch/risc-v/src/mpfs/mpfs_ethernet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3350,6 +3350,17 @@ static int mpfs_phyinit(struct mpfs_ethmac_s *priv)
{
int ret = -EINVAL;

#ifdef CONFIG_MPFS_PHYINIT
/* Perform any necessary, board-specific PHY initialization */

ret = mpfs_phy_boardinitialize(priv->intf);
if (ret < 0)
{
nerr("ERROR: Failed to initialize the PHY: %d\n", ret);
return ret;
}
#endif

#ifdef ETH_HAS_MDIO_PHY

/* Configure PHY clocking */
Expand Down Expand Up @@ -3496,31 +3507,11 @@ static int mpfs_ethconfig(struct mpfs_ethmac_s *priv)

ninfo("Entry\n");

#ifdef CONFIG_MPFS_PHYINIT
/* Perform any necessary, board-specific PHY initialization */

ret = mpfs_phy_boardinitialize(priv->intf);
if (ret < 0)
{
nerr("ERROR: Failed to initialize the PHY: %d\n", ret);
return ret;
}
#endif

/* Reset the Ethernet block */

ninfo("Reset the Ethernet block\n");
mpfs_ethreset(priv);

/* Initialize the PHY */

ninfo("Initialize the PHY\n");
ret = mpfs_phyinit(priv);
if (ret < 0)
{
return ret;
}

/* Initialize the MAC and DMA */

ninfo("Initialize the MAC and DMA\n");
Expand Down

0 comments on commit a31689c

Please sign in to comment.