@@ -458,49 +458,12 @@ static void eth_nxp_enet_rx_thread(struct k_work *work)
458
458
ENET_EnableInterrupts (data -> base , kENET_RxFrameInterrupt );
459
459
}
460
460
461
- static int nxp_enet_phy_configure (const struct device * phy , uint8_t phy_mode )
462
- {
463
- enum phy_link_speed speeds = LINK_HALF_10BASE | LINK_FULL_10BASE |
464
- LINK_HALF_100BASE | LINK_FULL_100BASE ;
465
- int ret ;
466
- struct phy_link_state state ;
467
-
468
- if (COND_CODE_1 (IS_ENABLED (CONFIG_ETH_NXP_ENET_1G ),
469
- (phy_mode == NXP_ENET_RGMII_MODE ), (0 ))) {
470
- speeds |= (LINK_HALF_1000BASE | LINK_FULL_1000BASE );
471
- }
472
-
473
- /* Configure the PHY */
474
- ret = phy_configure_link (phy , speeds , 0 );
475
-
476
- if (ret == - ENOTSUP ) {
477
- phy_get_link_state (phy , & state );
478
-
479
- if (state .is_up ) {
480
- LOG_WRN ("phy_configure_link returned -ENOTSUP, but link is up. "
481
- "Speed: %s, %s-duplex" ,
482
- PHY_LINK_IS_SPEED_1000M (state .speed ) ? "1 Gbits" :
483
- PHY_LINK_IS_SPEED_100M (state .speed ) ? "100 Mbits" : "10 Mbits" ,
484
- PHY_LINK_IS_FULL_DUPLEX (state .speed ) ? "full" : "half" );
485
- } else {
486
- LOG_ERR ("phy_configure_link returned -ENOTSUP and link is down." );
487
- return - ENETDOWN ;
488
- }
489
- } else if (ret ) {
490
- LOG_ERR ("phy_configure_link failed with error: %d" , ret );
491
- return ret ;
492
- }
493
-
494
- return 0 ;
495
- }
496
-
497
461
static void nxp_enet_phy_cb (const struct device * phy ,
498
462
struct phy_link_state * state ,
499
463
void * eth_dev )
500
464
{
501
465
const struct device * dev = eth_dev ;
502
466
struct nxp_enet_mac_data * data = dev -> data ;
503
- const struct nxp_enet_mac_config * config = dev -> config ;
504
467
enet_mii_speed_t speed ;
505
468
enet_mii_duplex_t duplex ;
506
469
@@ -524,16 +487,13 @@ static void nxp_enet_phy_cb(const struct device *phy,
524
487
}
525
488
526
489
ENET_SetMII (data -> base , speed , duplex );
527
- }
528
-
529
- LOG_INF ("Link is %s" , state -> is_up ? "up" : "down" );
530
490
531
- if (!state -> is_up ) {
532
- net_eth_carrier_off (data -> iface );
533
- nxp_enet_phy_configure (phy , config -> phy_mode );
534
- } else {
535
491
net_eth_carrier_on (data -> iface );
492
+ } else {
493
+ net_eth_carrier_off (data -> iface );
536
494
}
495
+
496
+ LOG_INF ("Link is %s" , state -> is_up ? "up" : "down" );
537
497
}
538
498
539
499
static void eth_nxp_enet_iface_init (struct net_if * iface )
@@ -793,11 +753,6 @@ static int eth_nxp_enet_init(const struct device *dev)
793
753
794
754
ENET_ActiveRead (data -> base );
795
755
796
- err = nxp_enet_phy_configure (config -> phy_dev , config -> phy_mode );
797
- if (err ) {
798
- return err ;
799
- }
800
-
801
756
LOG_DBG ("%s MAC %02x:%02x:%02x:%02x:%02x:%02x" ,
802
757
dev -> name ,
803
758
data -> mac_addr [0 ], data -> mac_addr [1 ],
0 commit comments