devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	rob.herring@linaro.org, linaro-kernel@lists.linaro.org,
	linux-pm@vger.kernel.org, arnd.bergmann@linaro.org,
	grant.likely@linaro.org, olof@lixom.net, nm@ti.com,
	Sudeep.Holla@arm.com, devicetree@vger.kernel.org,
	santosh.shilimkar@oracle.com, mike.turquette@linaro.org,
	kesavan.abhilash@gmail.com, catalin.marinas@arm.com,
	ta.omasab@gmail.com, linux-arm-kernel@lists.infradead.org,
	thomas.petazzoni@free-electrons.com, l.stach@pengutronix.de,
	broonie@kernel.org, viswanath.puttagunta@linaro.org
Subject: Re: [PATCH 0/7] OPP: Introduce OPP bindings V2 and supporting code
Date: Wed, 11 Feb 2015 16:52:20 -0800	[thread overview]
Message-ID: <20150212005220.GG11190@codeaurora.org> (raw)
In-Reply-To: <cover.1423642246.git.viresh.kumar@linaro.org>

On 02/11, Viresh Kumar wrote:
> Now that I have received an verbal Ack from Rob Herring (in a personal
> conversation) about the bindings, I am showing how the code looks like with
> these new bindings.
> 
> Some part is still now done:
> - Interface for adding new detailed OPPs from platform code instead of DT
> - Providing cpufreq helpers for the next OPPs
> - Providing regulator helpers for the target/min/max ranges
> 
> Please provide feedback on how this looks like..
> 

Here's some feedback on how we can't use OPPs (and OPPs in DT) on
qcom platforms.

On these platforms the OPPs are not always frequency voltage
pairs. Sometimes they're a frequency voltage voltage triplet, or
frequency voltage current triplet. I know that the OPP framework
in the kernel doesn't support more than frequency voltage pairs,
but that doesn't mean it can't in the future, and if it needs to
do so the DT bindings shouldn't need a v3 revision.

Furthermore, we have a large number of OPP sets that apply to
different speed bins and silicon characteristics of the SoC. In
our systems we read some efuses (an eeprom of sorts) that tell us
to use a certain set of OPPs because the silicon is so fast or
has these certain characteristics. The bootloader is *not*
reading these fuses and populating OPPs in DT. So right now we
just put all these custom OPPish tables in DT and then pick the
right one based on a node name match constructed from the bits we
read in the efuses. How can we express this in DT with these
bindings?

For example, on msm8974 we have a frequency voltage current
triplet and there are 18 different sets of these triplets, each
with 23 triplets per set. We could encode all of these tables as
a bunch of nodes with compatible = "operating-points-v2" but how
do we pick the right one to assign and populate for the CPU
devices? Do we need some sort of opp-fuse-map table that encodes
the information we want somewhere?

 qcom,opp-fuse-map = <speedX binY versionZ &oppN>,
                     ...

but where do we put it? In the cpus node? Or maybe we can keep
doing the node name matching? That would required dropping the
oppN convention.

Or take msm8916 as another example. On this device the voltage
for a few frequencies comes from the efuses and then we
interpolate the rest of the frequency voltage pairs. The speed
bins are picked from another set of efuses so we can do the
interpolation. Unfortunately we don't encode the frequency in the
fuses, so we rely on a handful of tables being defined somewhere
so that we know speed bin 0 means this set of frequencies and
speed bin 1 means this set of frequencies. How do we encode this
in DT?  Should we have the frequencies as OPPs and leave the
voltage part out, filling it in at runtime based on what we read
out of the efuses? I assume it's desirable to have the frequency
tables in DT but we could also have them in the driver and if we
did that there wouldn't be any shared-opp property to set and
have the cpufreq-dt driver use to figure out clock sharing.

Also sometimes we need to correlate OPPs between each other. For
example on msm8960/apq8064 if the CPU is running at a frequency
and voltage, the L2 needs to be running at another frequency,
voltage, and voltage (triplet). The L2 is in two power domains
but it only has one clock. Can/should this be expressed in DT? It
certainly seems that it's at least easier to add it on as a
feature because OPPs are nodes instead of an array. But we need
to make sure we can support multiple regulators somehow, either
through correlated OPPs and multiple OPPs for a single device or
by being able to say opp-0-microvolt, opp-1-microvolt. I would
guess something similar could happen if there were two clocks and
one regulator although I've never seen such a scenario in
practice.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  parent reply	other threads:[~2015-02-12  0:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11  8:16 [PATCH 0/7] OPP: Introduce OPP bindings V2 and supporting code Viresh Kumar
2015-02-11  8:16 ` [PATCH 1/7] OPP: Redefine bindings to overcome shortcomings Viresh Kumar
2015-02-23 22:36   ` Kevin Hilman
2015-02-24  4:24     ` Viresh Kumar
2015-02-24 17:12       ` Kevin Hilman
2015-02-25  3:45         ` viresh kumar
2015-02-11  8:16 ` [PATCH 2/7] opp: Relocate few routines Viresh Kumar
2015-02-11  8:16 ` [PATCH 3/7] OPP: Break _opp_add_dynamic() into smaller functions Viresh Kumar
2015-02-11  8:16 ` [PATCH 4/7] opp: Parse new (v2) bindings Viresh Kumar
2015-02-11  8:16 ` [PATCH 6/7] opp: Add helpers for initializing CPU opps Viresh Kumar
2015-02-11  8:16 ` [PATCH 7/7] cpufreq-dt: Use DT to set policy->cpus/related_cpus Viresh Kumar
2015-02-12  0:52 ` Stephen Boyd [this message]
2015-02-12  7:22   ` [PATCH 0/7] OPP: Introduce OPP bindings V2 and supporting code Viresh Kumar
2015-02-12  8:20     ` Stephen Boyd
2015-02-17  7:46       ` Viresh Kumar
2015-03-22 18:56         ` Mark Brown
     [not found] ` <cover.1423642246.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-02-11  8:16   ` [PATCH 5/7] opp: convert device_opp->dev to a list of devices Viresh Kumar
2015-02-27  5:25   ` [PATCH 0/7] OPP: Introduce OPP bindings V2 and supporting code Viresh Kumar
     [not found]     ` <CAKohpokF0_or8aXwzWZ=bUX1Robk8THyqRpKjbaarg9NHufLmw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-16  9:54       ` Viresh Kumar
2015-04-01  6:22 ` Viresh Kumar
     [not found]   ` <CAKohpokDhHo1ftcB6b4b+hO125_sqjK0NKESt79GVcWEwiq04w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-01 16:43     ` Rob Herring
     [not found]       ` <CAL_JsqLCjkrb2gT-_hj-UTAs+qn2LZtEm=f_C05ovhdwkZKB-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-02  3:00         ` Viresh Kumar

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=20150212005220.GG11190@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=Sudeep.Holla@arm.com \
    --cc=arnd.bergmann@linaro.org \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=kesavan.abhilash@gmail.com \
    --cc=l.stach@pengutronix.de \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mike.turquette@linaro.org \
    --cc=nm@ti.com \
    --cc=olof@lixom.net \
    --cc=rjw@rjwysocki.net \
    --cc=rob.herring@linaro.org \
    --cc=santosh.shilimkar@oracle.com \
    --cc=ta.omasab@gmail.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=viresh.kumar@linaro.org \
    --cc=viswanath.puttagunta@linaro.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;
as well as URLs for NNTP newsgroup(s).