[PATCH net-next 2/4] net: sparx5/lan969x: enable the switch core after clock setup

Daniel Machon daniel.machon at microchip.com
Fri Nov 13 02:19:41 PST 2026


sparx5_init_switchcore() ends by setting HSCH_RESET_CFG.CORE_ENA, so the
switch core and queue system are already running when
sparx5_init_coreclock() configures the core clock afterwards. That is
fine for the dividers it sets on sparx5, but a later patch makes it also
program the lan969x core PLL, which should be done before the queue
system is enabled.

Move the CORE_ENA write to mchp_sparx5_probe(), right after
sparx5_init_coreclock(), so the core is enabled once its clock is set
up.

CORE_ENA also tells sparx5_init_switchcore() that the switch memories
are already initialized. The switch is only reset once, when the reset
controller probes, so after an unbind and bind CORE_ENA is still set
and the core clock is configured with the queue system running.

Signed-off-by: Daniel Machon <daniel.machon at microchip.com>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
index 68c80c63f9087..93a7cb89493c4 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
@@ -471,9 +471,6 @@ static int sparx5_init_switchcore(struct sparx5 *sparx5)
 	spx5_wr(ANA_AC_STAT_RESET_RESET_SET(1), sparx5, ANA_AC_STAT_RESET);
 	spx5_wr(ASM_STAT_CFG_STAT_CNT_CLR_SHOT_SET(1), sparx5, ASM_STAT_CFG);
 
-	/* Enable switch-core and queue system */
-	spx5_wr(HSCH_RESET_CFG_CORE_ENA_SET(1), sparx5, HSCH_RESET_CFG);
-
 	return 0;
 }
 
@@ -928,6 +925,9 @@ static int mchp_sparx5_probe(struct platform_device *pdev)
 		goto cleanup_config;
 	}
 
+	/* Enable switch-core and queue system */
+	spx5_wr(HSCH_RESET_CFG_CORE_ENA_SET(1), sparx5, HSCH_RESET_CFG);
+
 	for (idx = 0; idx < sparx5->port_count; ++idx) {
 		config = &configs[idx];
 		if (!config->node)

-- 
2.34.1




More information about the linux-arm-kernel mailing list