Skip to content

Commit 5e6e8da

Browse files
ParthibanI17164cfriedt
authored andcommitted
drivers: ethernet: lan865x: fix module init priority
Align the LAN865x driver module initialization priority with the default priorities of MDIO and PHY drivers. The microchip_t1s PHY driver supports both LAN865x internal PHY and LAN867x external PHY. It was observed that the microchip_t1s driver initialization priority did not match the priority sequence used by the GMAC driver when the evb-lan8670-rmii (an external LAN8670 PHY) was connected to the SAME54 Curiosity Ultra platform, leading to potential initialization order issues. This change ensures the correct initialization sequence for reliable operation. The initialization priorities of the microchip_t1s and mdio_lan865x drivers are now set to the default values used in Zephyr. The LAN865x driver init priority is updated to the most appropriate value so that the microchip_t1s init priority aligns with all MAC drivers, maintaining the correct initialization sequence. Since the microchip_t1s driver can be used by many MAC drivers, keeping the default priority provided by Zephyr is a good approach. Instead, setting a specific priority for the eth_lan865x driver is more appropriate to ensure proper initialization order. Signed-off-by: Parthiban Veerasooran <[email protected]>
1 parent 8b355e9 commit 5e6e8da

File tree

6 files changed

+6
-26
lines changed

6 files changed

+6
-26
lines changed

drivers/ethernet/Kconfig.lan865x

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if ETH_LAN865X
2121

2222
config ETH_LAN865X_INIT_PRIORITY
2323
int "LAN865X driver init priority"
24-
default 72
24+
default 50
2525
help
2626
LAN865X device driver initialization priority.
2727
Must be initialized after SPI.

drivers/ethernet/eth_lan865x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ static const struct ethernet_api lan865x_api_func = {
478478
.tc6 = &oa_tc6_##inst}; \
479479
\
480480
ETH_NET_DEVICE_DT_INST_DEFINE(inst, lan865x_init, NULL, &lan865x_data_##inst, \
481-
&lan865x_config_##inst, CONFIG_ETH_INIT_PRIORITY, \
481+
&lan865x_config_##inst, CONFIG_ETH_LAN865X_INIT_PRIORITY, \
482482
&lan865x_api_func, NET_ETH_MTU);
483483

484484
DT_INST_FOREACH_STATUS_OKAY(LAN865X_DEFINE);
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2025 Microchip Technology Inc.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
menuconfig PHY_MICROCHIP_T1S
4+
config PHY_MICROCHIP_T1S
55
bool "Microchip 10BASE-T1S Ethernet PHYs Driver"
66
default y
77
depends on DT_HAS_MICROCHIP_T1S_PHY_ENABLED
@@ -10,13 +10,3 @@ menuconfig PHY_MICROCHIP_T1S
1010
help
1111
Enable Microchip's LAN8650/1 Rev.B0/B1 Internal PHYs and
1212
LAN8670/1/2 Rev.C1/C2 PHYs Driver.
13-
14-
if PHY_MICROCHIP_T1S
15-
16-
config PHY_MICROCHIP_T1S_INIT_PRIORITY
17-
int "Microchip T1S PHY init priority"
18-
default 82
19-
help
20-
Microchip T1S phy device driver initialization priority.
21-
22-
endif

drivers/ethernet/phy/phy_microchip_t1s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,6 @@ static DEVICE_API(ethphy, mc_t1s_phy_api) = {
551551
static struct mc_t1s_data mc_t1s_##n##_data; \
552552
\
553553
DEVICE_DT_INST_DEFINE(n, &phy_mc_t1s_init, NULL, &mc_t1s_##n##_data, &mc_t1s_##n##_config, \
554-
POST_KERNEL, CONFIG_PHY_MICROCHIP_T1S_INIT_PRIORITY, &mc_t1s_phy_api);
554+
POST_KERNEL, CONFIG_PHY_INIT_PRIORITY, &mc_t1s_phy_api);
555555

556556
DT_INST_FOREACH_STATUS_OKAY(MICROCHIP_T1S_PHY_INIT);

drivers/mdio/Kconfig.lan865x

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
# Copyright 2024 Microchip Technology Inc
22
# SPDX-License-Identifier: Apache-2.0
33

4-
menuconfig MDIO_LAN865X
4+
config MDIO_LAN865X
55
bool "LAN865X MDIO driver"
66
default y
77
depends on DT_HAS_MICROCHIP_LAN865X_MDIO_ENABLED
88
depends on ETH_LAN865X
99
help
1010
Enable LAN865X MDIO driver.
11-
12-
if MDIO_LAN865X
13-
14-
config MDIO_LAN865X_INIT_PRIORITY
15-
int "LAN865X MDIO init priority"
16-
default 81
17-
help
18-
LAN865X MDIO device driver initialization priority.
19-
20-
endif

drivers/mdio/mdio_lan865x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ static DEVICE_API(mdio, mdio_lan865x_api) = {
6464
.dev = DEVICE_DT_GET(DT_INST_PARENT(n)), \
6565
}; \
6666
DEVICE_DT_INST_DEFINE(n, NULL, NULL, NULL, &mdio_lan865x_config_##n, POST_KERNEL, \
67-
CONFIG_MDIO_LAN865X_INIT_PRIORITY, &mdio_lan865x_api);
67+
CONFIG_MDIO_INIT_PRIORITY, &mdio_lan865x_api);
6868

6969
DT_INST_FOREACH_STATUS_OKAY(MICROCHIP_LAN865X_MDIO_INIT)

0 commit comments

Comments
 (0)