[PATCHv4 22/26] arm: mach-k3: j721e_init: Force early probe of clk-k3 driver

Tero Kristo kristo at kernel.org
Tue May 11 10:31:00 CEST 2021

From: Dave Gerlach <d-gerlach at ti.com>

Force the clk-k3 driver to probe early during R5 SPL boot to ensure the
default system clock configuration is completed. Many other drivers
assume a default state of the clock tree and it is currently possible
for them to probe before clk-k3 depending on the exact system

Signed-off-by: Dave Gerlach <d-gerlach at ti.com>
Reported-by: Keerthy <j-keerthy at ti.com>
Tested-by: Keerthy <j-keerthy at ti.com>
Signed-off-by: Tero Kristo <kristo at kernel.org>
 arch/arm/mach-k3/j721e_init.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 1a4f796e5e..b5268372dd 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -180,6 +180,18 @@ void board_init_f(ulong dummy)
 			k3_mmc_stop_clock, k3_mmc_restart_clock);
+	/*
+	 * Force probe of clk_k3 driver here to ensure basic default clock
+	 * configuration is always done.
+	 */
+	ret = uclass_get_device_by_driver(UCLASS_CLK,
+					  DM_DRIVER_GET(ti_clk),
+					  &dev);
+	if (ret)
+		panic("Failed to initialize clk-k3!\n");
 	/* Prepare console output */

More information about the U-Boot mailing list