From: "Marek Behún" <marek.behun@nic.cz>
To: Stefan Roese <sr@denx.de>
Cc: "Pali Rohár" <pali@kernel.org>, u-boot@lists.denx.de
Subject: Re: [PATCH v2] arm: mvebu: a37xx: Define CONFIG_SYS_REF_CLK and use it instead of get_ref_clk()
Date: Tue, 17 Aug 2021 14:50:10 +0200 [thread overview]
Message-ID: <20210817145010.32f295f5@thinkpad> (raw)
In-Reply-To: <c9b895bb-ed1b-12e7-42c0-dd73b6be2b9d@denx.de>
> > +#elif defined(CONFIG_ARMADA_3700)
> > +/* SAR values for Armada 3700 */
> > +#define MVEBU_TEST_PIN_LATCH_N MVEBU_REGISTER(0x13808)
> > +#define MVEBU_XTAL_MODE_MASK BIT(9)
> > +#define CONFIG_SYS_REF_CLK ((readl(MVEBU_TEST_PIN_LATCH_N) & MVEBU_XTAL_MODE_MASK) ? \
> > + 40000000 : 25000000)
Stefan,
we discussed this with Pali yesterday. For now, I am okay with it, but
I consider this bad design.
This either should be done via the clk API or, if we insist on keeping
it simple, via a static inline function, with caching via a static
variable, so that the register needs to be read only once (at least for
each compilation unit).
Regarding the clk API kernel has driver for armada-37xx-xtal. But I am
thinking about expanding the clk-fixed-mmio driver so that it would be
more generic and could be used for this.
What do you think?
Marek
next prev parent reply other threads:[~2021-08-17 12:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-11 18:53 [PATCH 1/2] arm: mvebu: axp: Properly check for Armada XP in mach/soc.h Pali Rohár
2021-08-11 18:53 ` [PATCH 2/2] arm: mvebu: a37xx: Define CONFIG_SYS_REF_CLK and use it instead of get_ref_clk() Pali Rohár
2021-08-16 10:02 ` [PATCH v2] " Pali Rohár
2021-08-17 7:47 ` Stefan Roese
2021-08-17 12:50 ` Marek Behún [this message]
2021-08-17 12:56 ` Stefan Roese
2021-09-01 9:12 ` Stefan Roese
2021-09-01 12:14 ` Tom Rini
2021-09-01 12:32 ` Pali Rohár
2021-09-01 12:35 ` Tom Rini
2021-09-01 12:40 ` Pali Rohár
2021-09-01 12:41 ` Tom Rini
2021-09-01 12:46 ` Pali Rohár
2021-09-01 12:58 ` Tom Rini
2021-09-01 12:56 ` Tom Rini
2021-08-16 7:58 ` [PATCH 1/2] arm: mvebu: axp: Properly check for Armada XP in mach/soc.h Stefan Roese
2021-09-01 9:09 ` Stefan Roese
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=20210817145010.32f295f5@thinkpad \
--to=marek.behun@nic.cz \
--cc=pali@kernel.org \
--cc=sr@denx.de \
--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