From patchwork Thu Jun 3 06:32:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 1487020 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=fxXZcHXS; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FwbmH6thNz9sPf for ; Thu, 3 Jun 2021 16:37:19 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 27D9E82FEE; Thu, 3 Jun 2021 08:34:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="fxXZcHXS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A21DB82FC1; Thu, 3 Jun 2021 08:33:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A69D882FBA for ; Thu, 3 Jun 2021 08:33:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kristo@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 94C7E61400; Thu, 3 Jun 2021 06:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622702014; bh=nwWHOYYuOHnkXqwE2fTiwAqYUuTks5GSAPk5h9yfTZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fxXZcHXSavG6RzGQlam7viCp4UpsfVg2SmUv9d0DzZoHA0l3EPFcpxldcWn5yJXNM sh1LucEd/jP6t4wPG6309ZiNx+oDOyp+joDQ7ZN4NZkvoqxdPbQi9AYszbHNCfhMg4 U40lMvxMx9C9UcFIUE3ebmeDn6Ep0n5mrgIvrStd/JIuDfsPVVCeK55QYObcxwMvPI gjBhpLvOYL3pCiJLBEFn+7R9batC+laiAvDMzyzSFzNEaTUE+BdtphVOpacPOLGxoi FoPOukedBe8B2h8c02eAPacbUQUpzwusPKPSe7CD78tVtgfytIaWRTPvnSlmUX5DXP l633w/Wl5TBMw== From: Tero Kristo To: u-boot@lists.denx.de, lokeshvutla@ti.com Cc: trini@konsulko.com Subject: [PATCHv5 22/26] arm: mach-k3: j721e_init: Force early probe of clk-k3 driver Date: Thu, 3 Jun 2021 09:32:51 +0300 Message-Id: <20210603063255.5483-23-kristo@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210603063255.5483-1-kristo@kernel.org> References: <20210603063255.5483-1-kristo@kernel.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean From: Dave Gerlach 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 configuration. Signed-off-by: Dave Gerlach Reported-by: Keerthy Tested-by: Keerthy Signed-off-by: Tero Kristo --- 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 76a04a9035..833568d4b8 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_sysfw_loader(is_rom_loaded_sysfw(&bootdata), k3_mmc_stop_clock, k3_mmc_restart_clock); +#ifdef CONFIG_SPL_CLK_K3 + /* + * 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"); +#endif + /* Prepare console output */ preloader_console_init();