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 70B2FC54EE9 for ; Sun, 4 Sep 2022 00:38:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C6AAD83108; Sun, 4 Sep 2022 02:38:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="UbuLEWR2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 41F8883FC6; Sun, 4 Sep 2022 02:38:16 +0200 (CEST) Received: from mail-ua1-x92f.google.com (mail-ua1-x92f.google.com [IPv6:2607:f8b0:4864:20::92f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 991FA82105 for ; Sun, 4 Sep 2022 02:38:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mibodhi@gmail.com Received: by mail-ua1-x92f.google.com with SMTP id u1so2152951uan.3 for ; Sat, 03 Sep 2022 17:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=jevUjyd8HJCY4WiAJ0A5dTNRwTvA99KMD2l8jgapI3Q=; b=UbuLEWR2Wzah3UmfeoRtqEVcxPLY09wGhba6oDyRataNRDLEVGCtKLtj5OfbWqrF64 optjkSTObwUVpBIM04ZDVzx6GjkOjYvPCg57/EeprCAkwbgFK18weIi3mvkSyXLMLSUz 8nEA7CgRBz1JdbGsVEJtej1jkfdGxo4hJFS6aNx6RAfYVd3kH0KCgOtVrR27KD4kzT0F qXJuglfPXSuzm5CNNmHsC7PaFLb9uJG0L1P3qdiqUoRQ9lFqDQt+eI4gJaMc1F/XOq1H VHQncBiYeRXtcK0qYfiSj8lwYm3PVq/LIFkWSz+ohcLwZvOe2Sr/3Z8uVKnI67wMoHHx qMkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=jevUjyd8HJCY4WiAJ0A5dTNRwTvA99KMD2l8jgapI3Q=; b=P/AYHBR06PWCXZFEWZVsxg65bw7hrcj4QmulVX20H6mE6b/+9jxaet3UHGyWR3VZbu 5etXRfI+wK5XgzSa0spM0iUvVkNH8MB7fz/mwSDoeX5IntqEAZV2uhSfJSnqWHTSRLaY XVBcy8w7UwWuaTgX5UQHTCxyHvuzxlzLbN5ME3T6bnofGcb5k8GzczsXwbFY+VOYsr1a yYvt5UwFRVr8TPlwWwy2+LoOngfvOpivyEYXkbc+duVKIT3kjuCnQxSNWklwfwMtPzhH 5ZSV8E4I1UK4gd/CcrxrpjQTGe2SSbp11U0Nze8c2pmGYj5tjywsh/z4dIoadIRH+lpu Vsfw== X-Gm-Message-State: ACgBeo3Fd7uE9dDBe4yH5uaqCr2B2XaZcMYexY3ic1eP3sqNZtFUz/Ay YSLfjtiOOb+aCaSX1sm+bYMkoYglQlhpGaGK8i8= X-Google-Smtp-Source: AA6agR6uVidJHpEUVo3egjoFHbnkRxBxFViMLdnmqQm6XDqaf92FLLRzf2AFrDi8dnSMeoxmJOt58w9ZPBmLrX3yPoE= X-Received: by 2002:ab0:555c:0:b0:3ae:441f:262b with SMTP id u28-20020ab0555c000000b003ae441f262bmr780741uaa.95.1662251892340; Sat, 03 Sep 2022 17:38:12 -0700 (PDT) MIME-Version: 1.0 References: <20220902062554.1197435-1-sr@denx.de> <20220902062554.1197435-4-sr@denx.de> <3e1fdcaf-2d9d-bcfb-3067-d8c723af52cb@denx.de> In-Reply-To: From: Tony Dinh Date: Sat, 3 Sep 2022 17:38:01 -0700 Message-ID: Subject: Re: [PATCH v2 3/8] timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support To: Stefan Roese Cc: U-Boot Mailing List , =?UTF-8?Q?Pali_Roh=C3=A1r?= , Michael Walle , Simon Glass Content-Type: text/plain; charset="UTF-8" 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 Hi Pali, On Sat, Sep 3, 2022 at 5:02 PM Tony Dinh wrote: > > Hi Stefan, > > Sorry, that message was prematurely sent (fat finger). Please see the > continuation below. > > On Sat, Sep 3, 2022 at 4:43 PM Tony Dinh wrote: > > > > Hi Stefan, > > > > On Sat, Sep 3, 2022 at 3:44 AM Stefan Roese wrote: > > > > > > Hi Tony, > > > > > > On 03.09.22 11:44, Tony Dinh wrote: > > > > Hi Stefan, > > > > > > > > On Thu, Sep 1, 2022 at 11:25 PM Stefan Roese wrote: > > > >> > > > >> Add timer_get_boot_us() to support boards, that have CONFIG_BOOTSTAGE > > > >> enabled, like pogo_v4. > > > >> > > > >> Signed-off-by: Stefan Roese > > > >> --- > > > >> v2: > > > >> - Change timer_get_boot_us() to use the timer_early functions > > > >> - Remove #if CONFIG_IS_ENABLED(BOOTSTAGE) > > > >> > > > >> Simon, I'm currently looking into this timer_get_boot_us() to using > > > >> timer_early_get_count() etc consolidation. > > > > > > > > Indeed, as you've mentioned above, I think timer_early_get_count() and > > > > timer_early_get_rate() do need to take into consideration what the > > > > input_clock_type is for Kirkwood boards with CONFIG_BOOTSTAGE such as > > > > the Pogo V4. > > > > > > > > I'm seeing on the Pogo V4 test, the timer command reports time about 6 > > > > times slower than it should. It does seem to jive with the fact that > > > > the Pogo V4 CONFIG_SYS_TCLK is 166Mhz, versus MVEBU 25MHz clock rate. > > > > > > Ah, I've missing updating the early functions to also differentiate > > > between fixed clocks and TCLK timer. > > > > > > Please give the attached patch a try - should be applied on top of this > > > latest patchset. > > > > That looks promising, but I think we are still missing something. > After applying the attached patch, I ran the test again and it behaved > the same way (clock rate 6 times slower). So I did another test. > > --- Test 1 > Pogo_V4> timer start; sleep 60; timer get; sleep 30; timer get > 60.000 > 90.000 > > So apparently the sleep cmd has reset the correct clock rate. > > --- Test 2 > > Pogo_V4> timer start; sleep 30; timer get; sleep 30; timer get > 30.000 > 60.000 > > And then wait for 30 seconds, do another "timer get" (I expected to > see about 90 to 95 seconds). > > Pogo_V4> timer get > 66.237 > > The different call tree with the timer vs the sleep command made a > difference. But I could not see where. > > --- Test 3 > > Then I recalled about CONFIG_TIMER_EARLY. It is not selected by > default in Kconfig currently. So I enabled that to see the behavior. > But running this build hangs right off the bat. No u-boot version > banner is printed out. > Is there a way to get the CPU frequency from the board upon start up? Thanks, Tony