Commit 5e6e8da4 authored by Parthiban Veerasooran's avatar Parthiban Veerasooran Committed by Chris Friedt
Browse files

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: default avatarParthiban Veerasooran <parthiban.veerasooran@microchip.com>
parent 8b355e93
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ if ETH_LAN865X

config ETH_LAN865X_INIT_PRIORITY
	int "LAN865X driver init priority"
	default 72
	default 50
	help
	  LAN865X device driver initialization priority.
	  Must be initialized after SPI.
+1 −1
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ static const struct ethernet_api lan865x_api_func = {
		.tc6 = &oa_tc6_##inst};                                                            \
                                                                                                   \
	ETH_NET_DEVICE_DT_INST_DEFINE(inst, lan865x_init, NULL, &lan865x_data_##inst,              \
				      &lan865x_config_##inst, CONFIG_ETH_INIT_PRIORITY,            \
				      &lan865x_config_##inst, CONFIG_ETH_LAN865X_INIT_PRIORITY,    \
				      &lan865x_api_func, NET_ETH_MTU);

DT_INST_FOREACH_STATUS_OKAY(LAN865X_DEFINE);
+1 −11
Original line number Diff line number Diff line
# Copyright 2025 Microchip Technology Inc.
# SPDX-License-Identifier: Apache-2.0

menuconfig PHY_MICROCHIP_T1S
config PHY_MICROCHIP_T1S
	bool "Microchip 10BASE-T1S Ethernet PHYs Driver"
	default y
	depends on DT_HAS_MICROCHIP_T1S_PHY_ENABLED
@@ -10,13 +10,3 @@ menuconfig PHY_MICROCHIP_T1S
	help
	  Enable Microchip's LAN8650/1 Rev.B0/B1 Internal PHYs and
	  LAN8670/1/2 Rev.C1/C2 PHYs Driver.

if PHY_MICROCHIP_T1S

config PHY_MICROCHIP_T1S_INIT_PRIORITY
	int "Microchip T1S PHY init priority"
	default 82
	help
	  Microchip T1S phy device driver initialization priority.

endif
+1 −1
Original line number Diff line number Diff line
@@ -551,6 +551,6 @@ static DEVICE_API(ethphy, mc_t1s_phy_api) = {
	static struct mc_t1s_data mc_t1s_##n##_data;                                               \
                                                                                                   \
	DEVICE_DT_INST_DEFINE(n, &phy_mc_t1s_init, NULL, &mc_t1s_##n##_data, &mc_t1s_##n##_config, \
			      POST_KERNEL, CONFIG_PHY_MICROCHIP_T1S_INIT_PRIORITY, &mc_t1s_phy_api);
			      POST_KERNEL, CONFIG_PHY_INIT_PRIORITY, &mc_t1s_phy_api);

DT_INST_FOREACH_STATUS_OKAY(MICROCHIP_T1S_PHY_INIT);
+1 −11
Original line number Diff line number Diff line
# Copyright 2024 Microchip Technology Inc
# SPDX-License-Identifier: Apache-2.0

menuconfig MDIO_LAN865X
config MDIO_LAN865X
	bool "LAN865X MDIO driver"
	default y
	depends on DT_HAS_MICROCHIP_LAN865X_MDIO_ENABLED
	depends on ETH_LAN865X
	help
	  Enable LAN865X MDIO driver.

if MDIO_LAN865X

config MDIO_LAN865X_INIT_PRIORITY
	int "LAN865X MDIO init priority"
	default 81
	help
	  LAN865X MDIO device driver initialization priority.

endif
Loading