diff --git a/drivers/ethernet/nxp_enet/eth_nxp_enet.c b/drivers/ethernet/nxp_enet/eth_nxp_enet.c index dd993e8e3b9589..c5b1ac92b13d0a 100644 --- a/drivers/ethernet/nxp_enet/eth_nxp_enet.c +++ b/drivers/ethernet/nxp_enet/eth_nxp_enet.c @@ -502,6 +502,8 @@ static void eth_nxp_enet_iface_init(struct net_if *iface) const struct device *dev = net_if_get_device(iface); struct nxp_enet_mac_data *data = dev->data; const struct nxp_enet_mac_config *config = dev->config; + const struct device *phy_dev = config->phy_dev; + struct phy_link_state state; net_if_set_link_addr(iface, data->mac_addr, sizeof(data->mac_addr), @@ -518,6 +520,14 @@ static void eth_nxp_enet_iface_init(struct net_if *iface) ethernet_init(iface); net_if_carrier_off(iface); + /* In case the phy driver doesn't report a state change due to link being up + * before calling phy_configure, we should check the state ourself, and then do a + * pseudo-callback + */ + phy_get_link_state(phy_dev, &state); + + nxp_enet_phy_cb(phy_dev, &state, (void *)dev); + config->irq_config_func(); nxp_enet_driver_cb(config->mdio, NXP_ENET_MDIO, NXP_ENET_INTERRUPT_ENABLED, NULL);