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 71770C6FA8E for ; Wed, 21 Sep 2022 14:06:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A584284CB2; Wed, 21 Sep 2022 16:06:34 +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=1663769194; bh=Qf2O1TvGX/i4VybnRS+6+lyRVi7BixgOhep4oM39104=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=RWpeQNTIEUWEhJaDrlxyxzwkyXcU8ZC3BIlwNvhRjWWc8QcVLzViOh7HN8ocgCoc5 DaQKHUDzd2ZaZbNMzJpuD407P0xXiUYbuQ1ZSpqVaVIW9ZqD92Ul5pnQkNk8GbRMnB Tl5iti1rSY8seGTujN39ORntwZUH888J4JsUIgawvCYGvTnB43kb8qtXDtQzAdCTdL 0mBpx8zg56hMlrFRv88NP4DxUoJKhm33tPKW1b4eDkhuCiQ3+aBh5Anxs8G5pBNsXW V7UONMGbSoc6q6udJszIzVbRLHqqtnd4wzVwTRmROzbbv3gerwZV7ix5gUL8r5jI7j 4MAClYMbrQa5g== Received: by phobos.denx.de (Postfix, from userid 109) id CEBF784CA6; Wed, 21 Sep 2022 16:06:31 +0200 (CEST) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [80.241.59.207]) (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 83629849BB for ; Wed, 21 Sep 2022 16:06:28 +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-107.mailbox.org (Postfix) with ESMTPS id 4MXgFG4gjjz9scZ; Wed, 21 Sep 2022 16:06:26 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: sjg@chromium.org, trini@konsulko.com Subject: [PATCH 00/10] bootstage: Migrate from timer_get_boot_us() to timer_get_us() Date: Wed, 21 Sep 2022 16:06:15 +0200 Message-Id: <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 While working on the bootstage support for Armada XP (orion-timer) I noticed, that we currently have two API's supporting early timer functionality. These are: a) timer_early_get_rate() & timer_early_get_count() which integrates into the "normal" timer functions like timer_get() & timer_get_us() in the early boot phase, if CONFIG_TIMER_EARLY is enabled b) timer_get_boot_us(), which was introduced with bootstage IIUTC IMHO it makes more sense to not introduce a new API for this early timer functionality but re-use the "normal" API instead. This patchset migrates the timer_get_boot_us() implementations to the timer_early functions. This is done by: - Implementing the timer_early functions in the drivers currently supporting timer_get_boot_us() - Migrating bootcount to using timer_get_us() instead of timer_get_boot_us() - Completely removing timer_get_boot_us() With some minor tweaks in board_r/f for the dm_timer_init() and timer_init() call. I've tested this on Armada XP and sandbox. Thanks, Stefan Stefan Roese (10): arm: arch_timer: Add timer_early functions arm: imx: syscounter: Add timer_early functions arm: armv8: generic_timer: Add timer_early functions timer: cadence-ttc: Add timer_early functions timer: omap-timer: Add timer_early functions timer: rockchip_timer: Add timer_early functions board_f/r: Allow selection of CONFIG_TIMER_EARLY w/o CONFIG_TIMER board_f/r: Don't call timer_init() when TIMER is enabled bootstage: Migrate from timer_get_boot_us() to timer_get_us() bootstage/timer: Treewide remove timer_get_boot_us() arch/arm/cpu/armv7/arch_timer.c | 15 ++++++++--- arch/arm/cpu/armv8/generic_timer.c | 9 ++++--- arch/arm/mach-imx/syscounter.c | 12 +++++++-- arch/sandbox/cpu/cpu.c | 11 -------- boot/Kconfig | 1 + common/board_f.c | 4 +-- common/board_r.c | 5 ++-- common/bootstage.c | 26 +++++++++--------- drivers/timer/Kconfig | 1 - drivers/timer/cadence-ttc.c | 9 ++++--- drivers/timer/omap-timer.c | 9 ++++--- drivers/timer/orion-timer.c | 8 ------ drivers/timer/rockchip_timer.c | 42 ++++++++++++++++-------------- drivers/timer/tsc_timer.c | 5 ---- include/bootstage.h | 17 ++++-------- lib/time.c | 20 -------------- 16 files changed, 87 insertions(+), 107 deletions(-) -- 2.37.3