From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2C72AC32771 for ; Wed, 21 Sep 2022 14:08:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A218F84CB9; Wed, 21 Sep 2022 16:07:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1663769226; bh=oagsZhX0qQ7Cd2OUcRT/qfhOuvFXqM8jfv267kZBW6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GLqyKpKIs5QD3f7fQMzs45pMiUOsgIG71oT9PCgea021rIZF9w7GlfkOhJ/kQUc6p Xhlb5SWiBDZMH190N9yQXpqHkd2mBS1IH+5mwPeZqfehH4jBAvZiaNbAuljgBNEFtM LYNOJ3Ue+GA/5vm0sW0/Yw1CeoEJw4eoAVU0pJ2LtrDCa3IEcUgMGAxLhiMZ9rG/F7 DzwXVYetdR9gVbsP2X1yclTXbLPgvjdQwLTwIKPkTaZgfLrs4FIFoLa0XeV26CBldK 87E3YJ9syLCuKCbZS77gcO/WfM/CjwYqlD0/JDJw9kqke33A1xRD6CF8jYk2SquHwe +gLUqgtqm++vA== Received: by phobos.denx.de (Postfix, from userid 109) id 558B184C9B; Wed, 21 Sep 2022 16:06:42 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:101:465::204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C490384CA2 for ; Wed, 21 Sep 2022 16:06:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4MXgFK6rndz9sW2; Wed, 21 Sep 2022 16:06:29 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: sjg@chromium.org, trini@konsulko.com Subject: [PATCH 07/10] board_f/r: Allow selection of CONFIG_TIMER_EARLY w/o CONFIG_TIMER Date: Wed, 21 Sep 2022 16:06:22 +0200 Message-Id: <20220921140625.999002-8-sr@denx.de> In-Reply-To: <20220921140625.999002-1-sr@denx.de> References: <20220921140625.999002-1-sr@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean The early timer functions provided via CONFIG_TIMER_EARLY don't need CONFIG_TIMER to be enabled, as they don't make use of the DM timer and uclass interface. This patch now allow the selection of CONFIG_TIMER_EARLY w/o CONFIG_TIMER, enabling this early timer functionality also for non CONFIG_TIMER drivers. With this change it's necessary to guard the dm_timer_init() call in initr_dm_devices() & initf_dm() additionally via CONFIG_TIMER. Signed-off-by: Stefan Roese --- common/board_f.c | 2 +- common/board_r.c | 2 +- drivers/timer/Kconfig | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index f92d7b9faf4c..b1f67bfa72aa 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -787,7 +787,7 @@ static int initf_dm(void) if (ret) return ret; - if (IS_ENABLED(CONFIG_TIMER_EARLY)) { + if (IS_ENABLED(CONFIG_TIMER) && IS_ENABLED(CONFIG_TIMER_EARLY)) { ret = dm_timer_init(); if (ret) return ret; diff --git a/common/board_r.c b/common/board_r.c index 50670b5615a5..56575e552df8 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -254,7 +254,7 @@ static int initr_dm_devices(void) { int ret; - if (IS_ENABLED(CONFIG_TIMER_EARLY)) { + if (IS_ENABLED(CONFIG_TIMER) && IS_ENABLED(CONFIG_TIMER_EARLY)) { ret = dm_timer_init(); if (ret) return ret; diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig index fd8745ffc2e0..91107b662b7e 100644 --- a/drivers/timer/Kconfig +++ b/drivers/timer/Kconfig @@ -39,7 +39,6 @@ config VPL_TIMER config TIMER_EARLY bool "Allow timer to be used early in U-Boot" - depends on TIMER # initr_bootstage() requires a timer and is called before initr_dm() # so only the early timer is available default y if X86 && BOOTSTAGE -- 2.37.3