From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 1/1] timer: imx-gpt: Add timer support for i.MX SoCs family
Date: Thu, 11 Feb 2021 20:20:43 +0100 [thread overview]
Message-ID: <a37b6830-968a-03b2-93bd-a15651e63c87@benettiengineering.com> (raw)
In-Reply-To: <CAJFTR8SxKwJY0oOcKWnCVcfZy17joZAea6Zswhr6WNb=omZ98w@mail.gmail.com>
On 2/11/21 7:54 PM, Jesse T wrote:
[SNIP]
> >
> > The IPG_CLK_24M needs a different prescaler and a second enable bit.
> > This will completely bypass all other clock sources making the
> check for
> > the clock rate useless.
>
> Yes, in the operative way yes, you could also avoid passing clock
> source
> through dts, but this way we check that the right clock source is
> passed
> to dts, and that is the correct way to work I think.
>
> > It will also mean that even if we don't have a
> > correct clock source it will work at the correct timing.
>
> Yes if they provide 24Mhz.
>
> I wanted it to be like that at the moment, because a lot of imx SoCs
> setup GPT like that. Take a look here:
> https://gitlab.denx.de/u-boot/u-boot/-/blob/master/arch/arm/mach-imx/timer.c#L80-99
>
> This way the imx6* and imx7 could add their .compatible to this driver
> in the future. If someone will need some specific tweaking then they
> would send a patch adding such new DT property, like using 32K source.
> But that comes next IMHO, otherwise we should describe entirely GPT
> peripheral but what we need at the moment is getting 1ms tick like lot
> of other imx SoCs already do.
>
> The other chance would be to treat all the clock sources possibilities,
> but, at least for me, to begin this is sufficient and can be
> improved later.
>
> > I changed it to use only the 24MHz clock and ignore all others,
>
> Ok
>
> > at some
> > point it would be nice to have it only as a backup clock if the
> ccm was
> > not configured.
>
> I don't understand what you mean with backup clock can you elaborate
> more?
>
> If we have a clock source that is 0, we can still use the 24MHz clock as
> that is an always known source, and isn't?controlled by the ccm.
> Therefore if we have a dummy clock the soc will still have delays and
> timeouts at the right time. But this would make it so that we never
> return an error from clk_get_rate(&clk);
I'm not sure it is that safe. I'd prefer something that doesn't work at
all rather than something that works by a default specified inside a
driver. Since we're trying to imitate linux driver I would avoid this
solution. Often code is exchanged between u-boot, linux etc. so I'd
prefer to keep it like linux does.
Best regards
--
Giulio Benetti
Benetti Engineering sas
>
> Thank you
>
> Best regards
> --
> Giulio Benetti
> Benetti Engineering sas
>
next prev parent reply other threads:[~2021-02-11 19:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-10 0:04 [PATCH v2 0/1] Add driver support for the IMX General Purpose Timer (GPT) available Jesse Taube
2021-02-10 0:04 ` [PATCH v2 1/1] timer: imx-gpt: Add timer support for i.MX SoCs family Jesse Taube
2021-02-10 17:49 ` Giulio Benetti
2021-02-10 17:52 ` Sean Anderson
2021-02-10 20:13 ` Giulio Benetti
2021-02-11 0:09 ` Giulio Benetti
[not found] ` <7c787e3f-9869-c268-f1bb-91e387c4217f@gmail.com>
2021-02-10 20:09 ` Giulio Benetti
2021-02-11 18:54 ` Jesse T
2021-02-11 19:20 ` Giulio Benetti [this message]
2021-02-13 1:22 ` Giulio Benetti
2021-02-13 3:10 ` Jesse T
2021-02-14 2:23 ` Giulio Benetti
2021-02-10 17:22 ` [PATCH v2 0/1] Add driver support for the IMX General Purpose Timer (GPT) available Giulio Benetti
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=a37b6830-968a-03b2-93bd-a15651e63c87@benettiengineering.com \
--to=giulio.benetti@benettiengineering.com \
--cc=u-boot@lists.denx.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