Skip to contentSkip to conversation

arm: mach-k3: am62px: Fix MCU_CLKOUT0 parent clock mux

PATCH In review Parth Pancholi 3 participants 3 messages Apr 8, 2025 – Apr 18, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mach-k3: am62px: Fix MCU_CLKOUT0 parent clock mux

From: Parth Pancholi <[email protected]>

CU_CLKOUT0 can be driven by two input clocks: a 25 MHz and a 50 MHz source. Currently, the 25 MHz option is not selectable due to an incorrect mux configuration where the 50 MHz clock is duplicated in the parent list.

This patch fixes the mux setup, allowing proper selection of the 25 MHz clock source for MCU_CLKOUT0.

Similar configuration is already correctly implemented in AM62 clock data for 'hsdiv4_16fft_main_2_hsdivout1_clk10', where MCU_CLKOUT0 parent switching behaves as expected.

---
 arch/arm/mach-k3/r5/am62px/clk-data.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-k3/r5/am62px/clk-data.c +3 -2
index 4b9892fe0516..bc62d1d0d084 100644
@@ -59,7 +59,7 @@ static const char * const sam62_pll_ctrl_wrap_mcu_0_sysclkout_clk_parents[] = {
 
 static const char * const clkout0_ctrl_out0_parents[] = {
 	"hsdiv4_16fft_main_2_hsdivout1_clk",
-	"hsdiv4_16fft_main_2_hsdivout1_clk",
+	"hsdiv4_16fft_main_2_hsdivout1_clk10",
 };
 
 static const char * const main_emmcsd0_refclk_sel_out0_parents[] = {
@@ -193,6 +193,7 @@ static const struct clk_data clk_list[] = {
 	CLK_DIV("hsdiv4_16fft_main_1_hsdivout2_clk", "pllfracf2_ssmod_16fft_main_1_foutvcop_clk", 0x681088, 0, 7, 0, 0),
 	CLK_DIV("hsdiv4_16fft_main_1_hsdivout3_clk", "pllfracf2_ssmod_16fft_main_1_foutvcop_clk", 0x68108c, 0, 7, 0, 0),
 	CLK_DIV("hsdiv4_16fft_main_2_hsdivout1_clk", "pllfracf2_ssmod_16fft_main_2_foutvcop_clk", 0x682084, 0, 7, 0, 0),
+	CLK_DIV("hsdiv4_16fft_main_2_hsdivout1_clk10", "pllfracf2_ssmod_16fft_main_2_foutvcop_clk", 0x682084, 0, 7, 0, 0),
 	CLK_DIV("hsdiv4_16fft_main_2_hsdivout2_clk", "pllfracf2_ssmod_16fft_main_2_foutvcop_clk", 0x682088, 0, 7, 0, 0),
 	CLK_DIV("hsdiv4_16fft_mcu_0_hsdivout0_clk", "pllfracf2_ssmod_16fft_mcu_0_foutvcop_clk", 0x4040080, 0, 7, 0, 0),
 	CLK_MUX_PLLCTRL("sam62_pll_ctrl_wrap_main_0_sysclkout_clk", sam62_pll_ctrl_wrap_main_0_sysclkout_clk_parents, 2, 0x410000, 0),
@@ -281,7 +282,7 @@ static const struct dev_clk soc_dev_clk_data[] = {
 	DEV_CLK(146, 5, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
 	DEV_CLK(157, 36, "clkout0_ctrl_out0"),
 	DEV_CLK(157, 37, "hsdiv4_16fft_main_2_hsdivout1_clk"),
-	DEV_CLK(157, 38, "hsdiv4_16fft_main_2_hsdivout1_clk"),
+	DEV_CLK(157, 38, "hsdiv4_16fft_main_2_hsdivout1_clk10"),
 	DEV_CLK(157, 40, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
 	DEV_CLK(157, 54, "mshsi2c_main_0_porscl"),
 	DEV_CLK(157, 91, "sam62_pll_ctrl_wrap_mcu_0_sysclkout_clk"),
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

On April 8, 2025 thus sayeth Parth Pancholi:

Quoted 9 lines

From: Parth Pancholi <[email protected]>

CU_CLKOUT0 can be driven by two input clocks: a 25 MHz and a 50 MHz source. Currently, the 25 MHz option is not selectable due to an incorrect mux configuration where the 50 MHz clock is duplicated in the parent list.

This patch fixes the mux setup, allowing proper selection of the 25 MHz clock source for MCU_CLKOUT0.

Quoted 7 lines

Similar configuration is already correctly implemented in AM62 clock data for 'hsdiv4_16fft_main_2_hsdivout1_clk10', where MCU_CLKOUT0 parent switching behaves as expected.

---

Good catch!

~Bryan

#2 lore raw
In reply to Parth Pancholi
Quoted 8 lines · Parth Pancholi

CU_CLKOUT0 can be driven by two input clocks: a 25 MHz and a 50 MHz source. Currently, the 25 MHz option is not selectable due to an incorrect mux configuration where the 50 MHz clock is duplicated in the parent list.

This patch fixes the mux setup, allowing proper selection of the 25 MHz clock source for MCU_CLKOUT0.

[...]

Applied to u-boot/master, thanks!

[1/1] arm: mach-k3: am62px: Fix MCU_CLKOUT0 parent clock mux

      commit: 5e94661e465f1929e0dc3c27fa949b82b1ebddd2
Signature · 1 line
Tom