@@ -459,51 +459,12 @@ static void eth_nxp_enet_rx_thread(struct k_work *work)
459
459
ENET_EnableInterrupts (data -> base , kENET_RxFrameInterrupt );
460
460
}
461
461
462
- static int nxp_enet_phy_configure (const struct device * phy , uint8_t phy_mode )
463
- {
464
- enum phy_link_speed speeds = LINK_HALF_10BASE | LINK_FULL_10BASE |
465
- LINK_HALF_100BASE | LINK_FULL_100BASE ;
466
- int ret ;
467
- struct phy_link_state state ;
468
-
469
- if (COND_CODE_1 (IS_ENABLED (CONFIG_ETH_NXP_ENET_1G ),
470
- (phy_mode == NXP_ENET_RGMII_MODE ), (0 ))) {
471
- speeds |= (LINK_HALF_1000BASE | LINK_FULL_1000BASE );
472
- }
473
-
474
- /* Configure the PHY */
475
- ret = phy_configure_link (phy , speeds , 0 );
476
- if (ret == - EALREADY ) {
477
- return 0 ;
478
- } else if (ret == - ENOTSUP || ret == - ENOSYS ) {
479
- phy_get_link_state (phy , & state );
480
-
481
- if (state .is_up ) {
482
- LOG_WRN ("phy_configure_link returned %d, but link is up. "
483
- "Speed: %s, %s-duplex" ,
484
- ret ,
485
- PHY_LINK_IS_SPEED_1000M (state .speed ) ? "1 Gbits" :
486
- PHY_LINK_IS_SPEED_100M (state .speed ) ? "100 Mbits" : "10 Mbits" ,
487
- PHY_LINK_IS_FULL_DUPLEX (state .speed ) ? "full" : "half" );
488
- } else {
489
- LOG_ERR ("phy_configure_link returned %d and link is down." , ret );
490
- return - ENETDOWN ;
491
- }
492
- } else if (ret ) {
493
- LOG_ERR ("phy_configure_link failed with error: %d" , ret );
494
- return ret ;
495
- }
496
-
497
- return 0 ;
498
- }
499
-
500
462
static void nxp_enet_phy_cb (const struct device * phy ,
501
463
struct phy_link_state * state ,
502
464
void * eth_dev )
503
465
{
504
466
const struct device * dev = eth_dev ;
505
467
struct nxp_enet_mac_data * data = dev -> data ;
506
- const struct nxp_enet_mac_config * config = dev -> config ;
507
468
enet_mii_speed_t speed ;
508
469
enet_mii_duplex_t duplex ;
509
470
@@ -527,16 +488,13 @@ static void nxp_enet_phy_cb(const struct device *phy,
527
488
}
528
489
529
490
ENET_SetMII (data -> base , speed , duplex );
530
- }
531
-
532
- LOG_INF ("Link is %s" , state -> is_up ? "up" : "down" );
533
491
534
- if (!state -> is_up ) {
535
- net_eth_carrier_off (data -> iface );
536
- nxp_enet_phy_configure (phy , config -> phy_mode );
537
- } else {
538
492
net_eth_carrier_on (data -> iface );
493
+ } else {
494
+ net_eth_carrier_off (data -> iface );
539
495
}
496
+
497
+ LOG_INF ("Link is %s" , state -> is_up ? "up" : "down" );
540
498
}
541
499
542
500
static void eth_nxp_enet_iface_init (struct net_if * iface )
@@ -813,11 +771,6 @@ static int eth_nxp_enet_init(const struct device *dev)
813
771
814
772
ENET_ActiveRead (data -> base );
815
773
816
- err = nxp_enet_phy_configure (config -> phy_dev , config -> phy_mode );
817
- if (err ) {
818
- return err ;
819
- }
820
-
821
774
LOG_DBG ("%s MAC %02x:%02x:%02x:%02x:%02x:%02x" ,
822
775
dev -> name ,
823
776
data -> mac_addr [0 ], data -> mac_addr [1 ],
0 commit comments