From: Thierry Reding <thierry.reding@gmail.com>
To: "Svyatoslav R." <clamor95@gmail.com>
Cc: "Rayagonda Kokatanur" <rayagonda.kokatanur@broadcom.com>,
"Tom Warren" <twarren@nvidia.com>, "Marek Vasut" <marex@denx.de>,
"Maxim Schwalm" <maxim.schwalm@gmail.com>,
"Dmitry Osipenko" <digetx@gmail.com>,
"Jonas Schwöbel" <jonasschwoebel@yahoo.de>,
Agneli <poczt@protonmail.ch>,
"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
"Michal Simek" <michal.simek@amd.com>,
"Stefan Roese" <sr@denx.de>,
"Eugen Hristev" <eugen.hristev@microchip.com>,
"Michael Walle" <michael@walle.cc>,
"Simon Glass" <sjg@chromium.org>,
"Jim Liu" <jim.t90615@gmail.com>,
"William Zhang" <william.zhang@broadcom.com>,
"Rick Chen" <rick@andestech.com>,
"Stefan Herbrechtsmeier" <stefan.herbrechtsmeier@weidmueller.com>,
"Andre Przywara" <andre.przywara@arm.com>,
"Jaehoon Chung" <jh80.chung@samsung.com>,
u-boot@lists.denx.de
Subject: Re: [PATCH v7 0/3] Timer support for ARM Tegra
Date: Tue, 31 Jan 2023 16:16:55 +0100 [thread overview]
Message-ID: <Y9kw5zimccaB1mwd@orome> (raw)
In-Reply-To: <84599727-8131-8643-5115-2896c45e2a69@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4817 bytes --]
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.
> > >
> > > - 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.
> > >
> > > Arm64 Tegra (apart T210) according to comment in tegra-common.h use
> > > architected timer.
> > >
> > > - 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.
> > >
> > > 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.
> > >
> > > ---
> > > Changeog from V6
> > > - use clk_m as timer calibration clock (this should properly fix T210)
> > > - enable timer for T210
> > >
> > > Changed from v5:
> > > - added paz00 tester
> > >
> > > Changed from v4:
> > > - added comments
> > >
> > > 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
> > >
> > > 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.
> >
> > The quickest fix would be to do this:
> >
> > --- >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 ---
> >
> > So basically make TIMER selected on everything except Tegra186, so that
> > on Tegra186 things are basically unmodified.
>
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-01-31 15:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-27 7:13 [PATCH v7 0/3] Timer support for ARM Tegra Svyatoslav Ryhel
2023-01-27 7:13 ` [PATCH v7 1/3] ARM: tegra: remap clock_osc_freq for all Tegra family Svyatoslav Ryhel
2023-01-27 7:13 ` [PATCH v7 2/3] drivers: timer: add driver for ARMv7 based Tegra devices and T210 Svyatoslav Ryhel
2023-01-27 7:13 ` [PATCH v7 3/3] ARM: tegra: include timer as default option Svyatoslav Ryhel
2023-01-27 17:15 ` [PATCH v7 0/3] Timer support for ARM Tegra Thierry Reding
2023-01-27 20:27 ` Svyatoslav R.
2023-01-31 15:16 ` Thierry Reding [this message]
2023-01-31 15:24 ` Svyatoslav Ryhel
2023-01-31 15:18 ` Tom Warren
2023-01-31 15:26 ` Svyatoslav Ryhel
2023-01-31 20:27 ` Tom Warren
2023-01-31 21:53 ` Svyatoslav Ryhel
2023-02-02 17:54 ` Tom Warren
2023-02-02 18:02 ` Svyatoslav Ryhel
2023-02-01 8:58 ` Svyatoslav Ryhel
2023-02-01 17:36 ` Tom Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y9kw5zimccaB1mwd@orome \
--to=thierry.reding@gmail.com \
--cc=andre.przywara@arm.com \
--cc=clamor95@gmail.com \
--cc=digetx@gmail.com \
--cc=eugen.hristev@microchip.com \
--cc=jh80.chung@samsung.com \
--cc=jim.t90615@gmail.com \
--cc=jonasschwoebel@yahoo.de \
--cc=marex@denx.de \
--cc=maxim.schwalm@gmail.com \
--cc=michael@walle.cc \
--cc=michal.simek@amd.com \
--cc=poczt@protonmail.ch \
--cc=rayagonda.kokatanur@broadcom.com \
--cc=rick@andestech.com \
--cc=sjg@chromium.org \
--cc=sr@denx.de \
--cc=stefan.herbrechtsmeier@weidmueller.com \
--cc=twarren@nvidia.com \
--cc=u-boot@lists.denx.de \
--cc=william.zhang@broadcom.com \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox