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 76692ECAAD5 for ; Sat, 3 Sep 2022 23:44:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7B78383F36; Sun, 4 Sep 2022 01:43:58 +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="Ix/toCWu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BD08783FC6; Sun, 4 Sep 2022 01:43:56 +0200 (CEST) Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) (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 09CEF80F60 for ; Sun, 4 Sep 2022 01:43:54 +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-vs1-xe36.google.com with SMTP id o123so5627199vsc.3 for ; Sat, 03 Sep 2022 16:43:53 -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=t+8dTLuWCAp3U3FJh2MEVDFW3aaH8zYzMtSPB9vGi6Q=; b=Ix/toCWuwp1ZAvTbjcMoBjZSsW029DBtBewCDHCC0SiXvgw7HjyPVUnLa0tedIFw+9 +1CbV3FF1hYiglPy9fTAMPDlnz7/FdE+TkK6O9GP2+Rb6HZ8OpnjmlQoUh8DaFxNTMVS e6m7VAyhIWazVq1jPEBHUvkDDPre2PyMO922omEB/syqElGjQn+N5bl3UeLHONm7RzBt 8dDMgs3UQn6SxOxSpIduUWVoSyTKcPY8PuNZeAlfDOLNx6CSUnA6Z+uO8kpbQO6tHIvN 9ziD+Vp3bfNiBt+ex12uKhC9UeWTIVKd69v3pQf6AGcV79Qn3K5PSlo8JQoYusmcZQJh T50w== 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=t+8dTLuWCAp3U3FJh2MEVDFW3aaH8zYzMtSPB9vGi6Q=; b=I6MdedPk0SdeilSPWYq9ULKzYKzCaX7RSMJJ8fziclA0gHtTrWsYYYI9V4qnJstYuD wC5W7dNuvKdEye26OyZvZnKRaZXyZalLQ0NtMPgZqYsR4SfFTiQxg+Ax8ExZNOEd9Wk7 /c4ocqYRKxdYStjxlbuFXOXMyZAxC2/XA8NMT6GhV//nQ3GjpVAwT0Yu0fCt9VL+NALY 7P8edsJEqGkTCjNSX/o5oQH/hKdOKBuCGJOzilZiCVwOC4oMj8mi8lmr8a4mpfLW2lCO Ii2+23M/3rjzZ9t0GbD4TNVO+AfCkH7Uoto8l1SKmYCNpWNBz2VG1DCS3hPdscx0u6yJ VRRw== X-Gm-Message-State: ACgBeo1A9FnbeAw67cEBjbHX4twq4ebb3s1mHpgpf8yvSoCe+p7KO0nA Z6R8jwQFBznWQRiOmXaWs9mfP2Qd6zg6UfE3Uqw= X-Google-Smtp-Source: AA6agR5HsoKDcoNKbV3guz4bIzoUou4cT8dFWs/7x+EfbY78xhB6VoI7EJkyA4aZS3gAxWQJKQMIcp8wAH3wPhQKq9o= X-Received: by 2002:a67:cc11:0:b0:391:cdf8:8bd0 with SMTP id q17-20020a67cc11000000b00391cdf88bd0mr8558780vsl.51.1662248632752; Sat, 03 Sep 2022 16:43:52 -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: <3e1fdcaf-2d9d-bcfb-3067-d8c723af52cb@denx.de> From: Tony Dinh Date: Sat, 3 Sep 2022 16:43:41 -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 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. > Thanks, > Stefan