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 C9B66C38142 for ; Tue, 31 Jan 2023 15:17:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D9B1085AB9; Tue, 31 Jan 2023 16:17:04 +0100 (CET) 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="WF3YQtiA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DB03785AB7; Tue, 31 Jan 2023 16:17:02 +0100 (CET) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 31FB885AB9 for ; Tue, 31 Jan 2023 16:16:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=thierry.reding@gmail.com Received: by mail-ed1-x536.google.com with SMTP id m8so5490297edd.10 for ; Tue, 31 Jan 2023 07:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=0v1Z/JXnOb1ePV/7B4Qc1p229lM7KdHMEZ1lm1fa3gA=; b=WF3YQtiAP0PnRzv/4bw8weEiXgf4dKFBq5VyX2MsFGAlrNSR1ftvq9sbUVC4SV/0OM i2GBMPXb05z5aidoHNw+w0YW41Fef97H7CxA+RduIEIaNRRI+v3AsmHjO8GeomqLz8D6 NfBTwUY+LVq6+IMNDNutRqVthmV/UY5p+vPhWSME5RpMbYhN/hft2mgZaGbdeEZ5mNAb J6aWPkgU5cKBz3b7m0/Y7NUF4KzTKlPb/a6FZvo3d0gLFz1eRpjbAt7gNB1BVwSd4Rgo D1IKmXM5gBZ8IKHz7xgwJvFm8n7DcpbG1eqgATPrV6H6L82ZxI/2r+xVPELSnNmLe2lB My/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0v1Z/JXnOb1ePV/7B4Qc1p229lM7KdHMEZ1lm1fa3gA=; b=cWdwqnj+H7k8Bqju16H3Lvyz7TJVr4mjddpowxI6zK9WxXZBW0//otRI1+Q953vpCT ALNJSmPqHQs1fqvfmDD4MgcvhdOdhFwEJC2UlvOt8WslWfhfz2NYQ6sfkVC9EmMtwg9r xZ7YPC6Yc6FdXeYfW6WEeR216hQJzRVwENBgXRyUahwiZczl8hwvWiHAlnWB0p02iiKT dW3gAOnPM6luj/FF79SghihOKyx8oJXDqHc2T1MRYwsb1s/lQqODDYnzmU2MTBx0Z/bE zRhneTDQxF5Zr7dR6+wYrvSLSGm6ONToGuyAYINzQsyULhAnoEUlUOMhOMwxKeRBjGGD DkHQ== X-Gm-Message-State: AFqh2koh30axlEeJZogn1CNALpIAsnNerfH0q7hNV3eEdz5Kzvc1PwH4 YFyxGoAVb0Grus0Rf0P+wBg= X-Google-Smtp-Source: AMrXdXt6G2NCBEW1Xon/jvVEm8y3r3p+OcIWW2jutSineoZXT4MTgvrwUNwdtqDRKG3ec+cN2wdnMQ== X-Received: by 2002:a05:6402:1770:b0:48e:9afd:de66 with SMTP id da16-20020a056402177000b0048e9afdde66mr55142028edb.34.1675178218707; Tue, 31 Jan 2023 07:16:58 -0800 (PST) Received: from orome (p200300e41f201d00f22f74fffe1f3a53.dip0.t-ipconnect.de. [2003:e4:1f20:1d00:f22f:74ff:fe1f:3a53]) by smtp.gmail.com with ESMTPSA id y9-20020aa7d509000000b004a2569f6ba0sm2353519edq.82.2023.01.31.07.16.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 07:16:57 -0800 (PST) Date: Tue, 31 Jan 2023 16:16:55 +0100 From: Thierry Reding To: "Svyatoslav R." Cc: Rayagonda Kokatanur , Tom Warren , Marek Vasut , Maxim Schwalm , Dmitry Osipenko , Jonas =?utf-8?B?U2Nod8O2YmVs?= , Agneli , Heinrich Schuchardt , Michal Simek , Stefan Roese , Eugen Hristev , Michael Walle , Simon Glass , Jim Liu , William Zhang , Rick Chen , Stefan Herbrechtsmeier , Andre Przywara , Jaehoon Chung , u-boot@lists.denx.de Subject: Re: [PATCH v7 0/3] Timer support for ARM Tegra Message-ID: References: <20230127071312.13844-1-clamor95@gmail.com> <84599727-8131-8643-5115-2896c45e2a69@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="y15pL3a1c5WM+mtU" Content-Disposition: inline In-Reply-To: <84599727-8131-8643-5115-2896c45e2a69@gmail.com> User-Agent: Mutt/2.2.9 (2022-11-12) 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 --y15pL3a1c5WM+mtU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 27, 2023 at 10:27:57PM +0200, Svyatoslav R. wrote: > On 1/27/23 19:15, Thierry Reding wrote: > > On Fri, Jan 27, 2023 at 09:13:09AM +0200, Svyatoslav Ryhel wrote: > > > - ARM: tegra: remap clock_osc_freq for all Tegra family > > > Enum clock_osc_freq was designed to use only with T20. > > > This patch remaps it to use additional frequencies, added in > > > T30+ SoC while maintaining backwards compatibility with T20. > > >=20 > > > - drivers: timer: add timer driver for ARMv7 based Tegra devices > > > Add timer support for T20/T30/T114/T124 and T210 based devices. > > > Driver is based on DM, has device tree support and can be > > > used on SPL and early boot stage. > > >=20 > > > Arm64 Tegra (apart T210) according to comment in tegra-common.h use > > > architected timer. > > >=20 > > > - ARM: tegra: include timer as default option > > > Enable TIMER as default option for all Tegra devices and > > > enable TEGRA_TIMER for TEGRA_ARMV7_COMMON and TEGRA210. > > > Additionally enable SPL_TIMER if build as SPL part and > > > drop deprecated configs from common header. > > >=20 > > > P. S. I have no arm64 Tegra and according to comment in > > > tegra-common.h > > > Use the Tegra US timer on ARMv7, but the architected timer on ARMv8. > > >=20 > > > --- > > > Changeog from V6 > > > - use clk_m as timer calibration clock (this should properly fix T2= 10) > > > - enable timer for T210 > > >=20 > > > Changed from v5: > > > - added paz00 tester > > >=20 > > > Changed from v4: > > > - added comments > > >=20 > > > Changed from v3: > > > - removed BOOTSTAGE ifdefs > > > - use early timer on boot stage unconditionally > > > --- > > > Svyatoslav Ryhel (3): > > > ARM: tegra: remap clock_osc_freq for all Tegra family > > > drivers: timer: add driver for ARMv7 based Tegra devices and T210 > > > ARM: tegra: include timer as default option > > >=20 > > > arch/arm/Kconfig | 1 + > > > arch/arm/include/asm/arch-tegra/clock.h | 9 +- > > > arch/arm/mach-tegra/Kconfig | 3 + > > > arch/arm/mach-tegra/clock.c | 17 +++- > > > arch/arm/mach-tegra/cpu.c | 70 ++++++++++--- > > > arch/arm/mach-tegra/tegra114/clock.c | 13 +-- > > > arch/arm/mach-tegra/tegra124/clock.c | 13 +-- > > > arch/arm/mach-tegra/tegra20/clock.c | 4 +- > > > arch/arm/mach-tegra/tegra210/clock.c | 22 +--- > > > arch/arm/mach-tegra/tegra30/clock.c | 10 +- > > > drivers/timer/Kconfig | 8 ++ > > > drivers/timer/Makefile | 1 + > > > drivers/timer/tegra-timer.c | 130 +++++++++++++++++++++= +++ > > > drivers/usb/host/ehci-tegra.c | 46 +++++++-- > > > include/configs/tegra-common.h | 6 -- > > > 15 files changed, 274 insertions(+), 79 deletions(-) > > > create mode 100644 drivers/timer/tegra-timer.c > > Ugh... turns out I had completely messed up the testing on Tegra186 and > > it wasn't working at all. The problem is that the selection of the TIMER > > symbol for all of Tegra causes the driver model to be used, but there is > > no DM driver for the architected timer that's used on Tegra186. > >=20 > > The quickest fix would be to do this: > >=20 > > --- >8 --- > > diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig > > index b50eec5b8c9b..05c8ce0e08dd 100644 > > --- a/arch/arm/mach-tegra/Kconfig > > +++ b/arch/arm/mach-tegra/Kconfig > > @@ -56,7 +56,6 @@ config TEGRA_COMMON > > select MISC > > select OF_CONTROL > > select SPI > > - select TIMER > > imply CMD_DM > > imply CRC32_VERIFY > > @@ -83,6 +82,7 @@ config TEGRA_ARMV7_COMMON > > select TEGRA_PINCTRL > > select TEGRA_PMC > > select TEGRA_TIMER > > + select TIMER > > config TEGRA_ARMV8_COMMON > > bool "Tegra 64-bit common options" > > @@ -137,6 +137,7 @@ config TEGRA210 > > select TEGRA_PMC > > select TEGRA_PMC_SECURE > > select TEGRA_TIMER > > + select TIMER > > config TEGRA186 > > bool "Tegra186 family" > > --- >8 --- > >=20 > > So basically make TIMER selected on everything except Tegra186, so that > > on Tegra186 things are basically unmodified. >=20 > I can propose to include 'select TIMER' directly into TEGRA_TIMER config > option. This will eliminate need of including it into mach-tegra Kconfigs. TEGRA_TIMER itself depends on TIMER, which is a more correct dependency given how that's all structured. > BTW, may you check current patch set on T124 and T210 if those work > properly. My T30 devices work fine and same as before after switch to clk= _m > as timer calibration clock. With the above on top, the series works fine on Tegra124, Tegra210 and Tegra186. Thierry --y15pL3a1c5WM+mtU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmPZMOcACgkQ3SOs138+ s6Go0w/9GfXmyk7XKLkWj/STuBjbdIWvEfCxJ/FCLlaVDRcISTUqV9wUNSdOs/xU npv6bGbpgKGJq5Q4/rz4aMBv9D9siwY6BmoyfmD7KO7nSr+U6dWrTgaaf4GFxGAi TYjtZPGZ8ZxSoIAdWOmdnzvpOpwobdeXKWWKUWfcJiDeTZoIvK9lyrCGeXx0o1Hp xhy5b2IrCLMQFsg7w7PfBm0bG/ULL/QhHQFtvm+EmHLGJrW/jYDEnLHeRFWdTJZk bJQ8hc6orV4hQ2Wq0mNcw0jNh7yKbEh8XkuUu11K0kdH5n1YVXysSqmLRy+19NXm LbdyVcFg6GI+UBoCTd5l0u7osnJBBz5Y2OMizWzwMaR23QRr8lia7lcji/jiOVEG TYXj95PpZXkOauob+MFADfUu6Znj1EOU5Dt8jES2pKmgP3lCwDCdOn9y/uPylUXj nzmAt1QmG3hoeQD3+hlDbd+5I2DqGEQPrPYAuVQd3vU0hj5bkU/7/EIURd6bTNIB rkbFYcJj0YbJOnyJt7qakNvYy1NGZQkErmwdrZJpKEIofuz1+h9+5v6nFpW0mFaM qDt3YGO2mUkprIiN7d/3naphHE6k9LuQInfeRclvBEG6jxnwLyoKy5iC7IKf57Sj Eao33FRU88ZHAhGCkKYXWwzLVIeLe5cLtgC+UHz9YyNfhlyGvu4= =uZhT -----END PGP SIGNATURE----- --y15pL3a1c5WM+mtU--