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