From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [linux-sunxi] [PATCH] clk: sunxi-ng: fix PLL_CPUX adjusting on H3
Date: Thu, 19 Jan 2017 16:45:38 +0100 [thread overview]
Message-ID: <20170119154538.4ge5vez36kvmase6@lukather> (raw)
In-Reply-To: <c4152a9b-9b31-5ed7-39cd-da1a3489bc89@megous.com>
On Wed, Jan 18, 2017 at 06:48:35PM +0100, Ond?ej Jirman wrote:
> Dne 18.1.2017 v 17:56 Maxime Ripard napsal(a):
> >>> What's your current plan to fix that? I guess the easiest (and most
> >>> likely to be reusable) would be to allow for clock tables, instead of
> >>> using the generic approach. We might have some other clocks (like
> >>> audio or video) that would need such a precise tuning in the future
> >>> too.
> >>
> >> My proposed solution is this for M factor (H3 specific solution):
> >>
> >> https://github.com/megous/linux/commit/88be3d421e958579026135d8acec4b3983958738
> >
> > This one is fine.
> >
> >> and this for P factor:
> >>
> >> https://github.com/megous/linux/commit/d7f274ed0c13fa9b4099445cb6bf9b2f8f2cfa8a
> >>
> >> Perhaps it should be configurable if the P limitation is not universal
> >> for all NKMP clocks. But I haven't read all the datasheets.
> >
> > And this is exactly what I wanted to avoid, for the reason you're
> > giving :)
> >
> > This is some generic code, and yet you're putting a clock and SoC
> > specific limit in there. You have two ways to deal with that. Either
> > come up with some generic throttling mecanism to force a particular
> > value above or below a given threshold, but that might be tedious to
> > do, and require some significant rework.
> >
> > Or you can use a table, which is generic and should be relatively
> > easy. I really think this is the most straightforward solution, and
> > even more so since we just want to support a limited number of
> > frequencies in this case.
>
> So I would add a pointer to a table to struct ccu_nkmp and define the
> table itself in ccu-sun8i-h3.c?
>
> If struct ccu_nkmp would have non-NULL pointer to a table, it would be
> used instead of the math in ccu_nkmp.c.
>
> Sounds ok?
Yep, sounds perfect!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170119/4ec64c25/attachment.sig>
prev parent reply other threads:[~2017-01-19 15:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-25 0:28 [PATCH] clk: sunxi-ng: fix PLL_CPUX adjusting on H3 megous at megous.com
2016-11-25 3:22 ` [linux-sunxi] " Chen-Yu Tsai
2016-11-25 6:35 ` Maxime Ripard
2017-01-07 15:49 ` [linux-sunxi] " Ondřej Jirman
2017-01-09 9:59 ` Maxime Ripard
2017-01-09 14:50 ` Ondřej Jirman
2017-01-16 16:43 ` Maxime Ripard
2017-01-16 16:51 ` Ondřej Jirman
2017-01-18 16:56 ` Maxime Ripard
2017-01-18 17:48 ` Ondřej Jirman
2017-01-19 15:45 ` Maxime Ripard [this message]
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=20170119154538.4ge5vez36kvmase6@lukather \
--to=maxime.ripard@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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