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 433E6C32771 for ; Wed, 21 Sep 2022 14:07:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6050384CA6; Wed, 21 Sep 2022 16:06:44 +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=1663769204; bh=QQHcz664K8i9V/P6ehFpYoDaEtLILaqh1MabVqJCIVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tFRkJ89Rz1wiEa/hRFnVP3hrR06Y3VIyffnlTsI4DPQJCaVbCqLhQ0UReJfG8cjHK vnxvT1kT42qfIqdfkRTyUH1dW7CkVxlpHXzEWDcB9XVozOl+6Rxx5JVQIjfpe9INIv uTLiyGRgoJYJHfsF9mFY1djoCF2Icbh8IblkJE3lE8sL4obYZKk+rBqtFuirlwBxTD sT7h8UkJmAnSMKY388XoaE0xLBA+mwcAeQQGVBH9GA97iJ3crHs2Aocr5LpBs/H2LI 9hQAVN5MLIBEGzgnUt+nwXM+8qi7XFloEZhjARziaiTNiM9zFR1/cBgwV1f1N0BbD6 p8debZf0DdK0A== Received: by phobos.denx.de (Postfix, from userid 109) id 4DA4084C9B; Wed, 21 Sep 2022 16:06:35 +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 0B93C84C9B for ; Wed, 21 Sep 2022 16:06:30 +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 [IPv6:2001:67c:2050:b231:465::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 4MXgFJ0XbNz9sTd; Wed, 21 Sep 2022 16:06:28 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: sjg@chromium.org, trini@konsulko.com, Michal Simek , Andre Przywara Subject: [PATCH 03/10] arm: armv8: generic_timer: Add timer_early functions Date: Wed, 21 Sep 2022 16:06:18 +0200 Message-Id: <20220921140625.999002-4-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-Rspamd-Queue-Id: 4MXgFJ0XbNz9sTd 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 Currently this timer driver provides timer_get_boot_us() to support the BOOTSTAGE functionality. This patch adds the timer_early functions so that the "normal" timer functions can be used, when CONFIG_TIMER_EARLY is enabled. timer_get_boot_us() will get removed in a follow-up patch, once the BOOTSTAGE interface is migrated to timer_get_us(). Signed-off-by: Stefan Roese Cc: Michal Simek Cc: Andre Przywara --- arch/arm/cpu/armv8/generic_timer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c index f27a74b9d09b..01a1a167311e 100644 --- a/arch/arm/cpu/armv8/generic_timer.c +++ b/arch/arm/cpu/armv8/generic_timer.c @@ -115,3 +115,13 @@ ulong timer_get_boot_us(void) return val / get_tbclk(); } + +unsigned long notrace timer_early_get_rate(void) +{ + return get_tbclk(); +} + +u64 notrace timer_early_get_count(void) +{ + return get_ticks(); +} -- 2.37.3